Skip to main content
3 of 5
added 52 characters in body
luciano
  • 14.6k
  • 36
  • 97
  • 129

Should a mixed effects model be used?

This post provides an excellent example of the inner workings of a mixed effects model: http://emhart.github.com/blog/2012/11/16/making-sense-of-random-effects/

In a hypothetical study, I have measured the wing length of a bird species at 10 different locations:

df <- data.frame(wing.length=rnorm(30),
                 location=paste('location', rep(1:10, 3)), 
                 county=paste('county', sort(rep(1:3, 10))))

First 15 rows of dataframe:

   wing.length    location   county
1     29.29024  location 1 county 1
2     30.06387  location 2 county 1
3     27.72127  location 3 county 1
4     29.74502  location 4 county 1
5     29.85506  location 5 county 1
6     30.26669  location 6 county 1
7     30.58748  location 7 county 1
8     30.47608  location 8 county 1
9     31.86882  location 9 county 1
10    28.87578 location 10 county 1
11    30.00726  location 1 county 2
12    30.52488  location 2 county 2
13    30.64339  location 3 county 2
14    29.93695  location 4 county 2
15    27.86217  location 5 county 2

There is a hierarchical structure here, However, unlike the mixed effects model in the linked blog post where each individual is measured 5 times, each location is only measured once.

In my hypothetical example, should a type of mixed effects model be applied, or would a two-way ANOVA be more appropriate? If a mixed effects model is needed, then what type?

luciano
  • 14.6k
  • 36
  • 97
  • 129