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:

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

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.