More Mixed Effects
Here is any example of a potential study:
“Pizza Hut is interested in the ounces of cheese on a large cheese pizza. Each pizza worker is asked to produce ten large cheese pizzas. The number of ounces of cheese on each pizza is then weighed. Assume that each pizza is constructed by a single worker and each worker works at a single Pizza Hut. The Pizza Hut statisticians believe some workers tend to be more generous with the cheese. The Pizza Hut statisticians also believe that workers at the same store may influence each other and therefore produce similar pizzas.”
Here are the specifications of the corresponding model I would build in R:
Response Variable: ounces of cheese on large pizza.
Type of Model: A linear mixed model with a normal response.
Fixed Effects: Just an intercept that would correspond to the mean weight of cheese (in ounces) on a large pizza.
Random Effects: Employee ID and Pizza Hut Branch ID. Each employee and each branch would get a random intercept.
Structure of Random Effects: This is a nested structure. Employees are nested within the Pizza Hut Branch they work at.
Here is another example of a potential study:
“Consider teams of runners competing during a season of cross country. Each runner experiences variability from race to race, and each team’s runners vary. Assume the coaching staff stays constant during a season and that no student athletes transfer schools. The NCAA president wants to quantify the rate at which runners improve during the season.”
If we were to build a model for this study, it would look something like this:
\[lmer(Time\thicksim{}Week+(1|Runner)+(1|Team)) \]
Where
Time: Time taken to run 6 km
Week: Week the race took place. Week 1, 2, 3, etc
Runner: A runner’s ID number
Team: A team’s ID number
Thus, this would be a linear mixed model with a normal response. Here we are looking to see the linear relationship between the time since the cross-country season started and the time taken to run 6 km. There are random effects for each runner and for each team. Thus, this is a nested correlation structure. Runners are nested within the team they run for.