[R-sig-ME] including the same variable both as fixed and as part of a complex random variable?

Hans Ekbrand hans at sociologi.cjb.net
Tue Oct 4 15:13:37 CEST 2011


On Tue, Oct 04, 2011 at 09:54:36AM +0000, ONKELINX, Thierry wrote:
> Dear Hans,

Dear Thierry, I really appreciate the input you have already given (in
this thread and in others). I know I'm indepted to you even if you
don't respond further.

> I am assuming that labour.market.position (LMP) is continuous.

Oh, sorry for not specifying that, it is not. Both LMP and country are
unordered factors, and poverty is binary factor.

> fit.1 and fit.2 are different. In fit 2, the fixed effect of LMP is the slope in an 'average' country. the random effect of LMP in then the difference in slope between a country and the 'average' country. In fit 1 you have no slope for an 'average' country (the slope = 0). So the random effect of LMP in fit 1 is the slope for each country.

I think I understand this. While fit 1 has no slope for an 'average'
country, I guess one could calculate such an 'average' slope given the
slopes for each country. What I am really after is whether this
difference between fit.1 and fit.2 is "real" in the sense that one
could end up having a better fit than the other (e.g. using a
loglikelihood ratio test). 

I was a bit suprised over the following results (similar, but not
exactly the type of models as discussed above)

> anova(a,b)
Data: poverty.risks
Models:
a: poverty.third.year ~ 1 + LMP + (1 | country:LMP)
b: poverty.third.year ~ 1 + LMP + (1 | country) + (1 | country:LMP)
  Df   AIC   BIC logLik  Chisq Chi Df Pr(>Chisq)    
a 15 96754 96903 -48362                             
b 16 96702 96861 -48335 53.589      1  2.471e-13 ***
---
Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1 

I would have guessed that the addition of (1 | country) in B would not
improve the fit, since each country is allowed to have its' own slope
per LMP. But I was wrong, and I don't really understand why. Both
country and LMP are unordered factors.

In my - obviously erroneous - understanding, model (b) above just seem
to be waste of degrees of freedom. Actually, the only reason I see to
use (b) rather than (a) is that you get the a nice decomposition of
effects, so you immediatly get an answer to the question: "are there
country specific effects of LMP?". But there is obviously more than that
going on here, since the fit was better in (b), than in (a).


--
Hans Ekbrand




More information about the R-sig-mixed-models mailing list