Skip to content
Prev 6588 / 20628 Next

Efficiency of random and fixed effects estimators

In the following, reg.fe1 is parameterised a bit differently, to make its output 
more directly comparable with that from the random effects model reg.re1
(also I have reordered the terms so that the aliased parameter is that 
associated with a level (as it happens, the 99th) of id)

reg.fe1<-lm(happy~factor(obs)*factor(d)+factor(id))
summary(reg.fe1)

reg.fe1<-lm(happy~factor(obs)*factor(d)+C(factor(id),contr.sum))
summary(reg.fe1)

Coefficients: (1 not defined because of singularities)
                           Estimate Std. Error t value Pr(>|t|)
(Intercept)                 0.01593    0.69578   0.023 0.981781
factor(obs)1               -1.63826    0.20978  -7.809 6.46e-12
factor(d)1                  0.10152    1.20867   0.084 0.933233
. . . .
factor(obs)1:factor(d)1     3.11316    0.27787  11.204  < 2e-16

                        Estimate Std. Error t value
(Intercept)              0.11537    0.22373   0.516
factor(obs)1            -1.63826    0.20978  -7.809
factor(d)1              -0.07294    0.29634  -0.246
factor(obs)1:factor(d)1  3.11316    0.27787  11.204

The parameters factor(obs)1 and factor(obs)1:factor(d)1 are estimated in the stratum 
of individual observations (2 observations per id). Note that factor(obs)1:factor(d)1 
is the difference of level 2 of obs from level 1 of obs at the second level of d.
Hence the random effects analysis gives estimates that are exactly the same, with 
the same SEs, as for the fixed effects analysis.  Degrees of freedom are also exactly
the same.

The parameter factor(d) contrasts individuals (2 observations each) exposed to one
type of movie with those exposed to the other type.  Variation between individuals
now comes into play.  The SE (really an SED) for the random effects analysis is now 
very substantially greater than the (seriously biased downwards) SE for the fixed
effects analysis.  The random variation added in base.happy<-rep(rnorm(100),each=2)
now comes into play, in addition to the random variation associated with individual
observations, added in happy<-base.happy+1.5*d*obs+rnorm(200). 

John Maindonald             email: john.maindonald at anu.edu.au
phone : +61 2 (6125)3473    fax  : +61 2(6125)5549
Centre for Mathematics & Its Applications, Room 1194,
John Dedman Mathematical Sciences Building (Building 27)
Australian National University, Canberra ACT 0200.
http://www.maths.anu.edu.au/~johnm
On 23/08/2011, at 2:06 PM, Daniel Malter wrote: