In the following exercise, we will set up a simple nested model, and we will show that the estimates are different if we contemplate the nesting/don’t contemplate it, because of how the variables are coded:
- First, we load a dataset that contains the companies' areas and people working there. We have a numerical variable called Rating.
- If we look at the cross tabulation, we can see that each level of the Person factor appears 5 times in each area:
xtabs(~ Group + Person, data)
- Let's look at the results if we treat the results as nested versus crossed. Clearly, the results are different, as the names are the same across ...