[R] Mixed effect models
Daniel Malter
daniel at umd.edu
Fri Aug 12 00:40:47 CEST 2011
I am afraid this is one of these posts where I have to quote David Winsemius:
"The advancement of science would be safer if you knew what you were doing."
Moreover, these are questions best addressed to your local statistician
rather than the R-help list. With exceptions, the R-help list helps to solve
questions about/problems with R, but not about your empirical modeling
strategy per se. The reason for this is sound: we do not know what you are
doing.
As for your first question: I do not see, why you would want to compute a
p-value by hand, because the output provides a p-value for the fixed
effects.
Also, green roof does not have a negative "trend" with Totalabundance. Your
Habitat variable is a categorical variable and thus compares Totalabundance
between the (obviously three) categories of Habitat. Therefore, there is not
trend but only categorical distinctions here. The intercept tells you the
average value of Totalabundance for the first category of Habitat. The
HabitatGreen roof coefficient tells you whether Totalabundance is
significantly different for the first and second category of Habitat. The
coefficient of HabitatGreen space tells you whether the first and third
category are significantly different in Totalabundance.
Your results (if modeled properly) would indicate that there is no
significant difference between the first (the omitted baseline absorbed by
the intercept) and the third (HabitatGreen space) category. There may be a
significant difference in Totalabundance between the first and the second
(HabitatGreen roof) category, but the evidence is statistically weak (only
marginally significant at the 10 percent level).
The step of getting into more complex analyses (pertaining to your question
about interaction terms, etc.), should only follow a thorough study of the
basics of ANOVA/regression analysis.
HTH,
Daniel
Eleanor Spratt wrote:
>
> I am using two mixed effect models. Firstly, what I am trying to do is to
> compare green roofs abundance with brownfield, green roof with green space
> abundance, and finally green
> space with brownfield abundance. I am unsure if I have done the
> correct model. I have to use a mixed effect model because my data is
> nested.
>
> This is the code and output
>
>> model1<-lmer(Total.abundance~Habitat+(1|Site)+(1|Week),REML=FALSE,family=poisson)
>> summary(model1)
>
> Generalized linear mixed model fit by the Laplace approximation
> Formula: Total.abundance ~ Habitat + (1 | Site) + (1 | Week)
> AIC BIC logLik deviance
> 1780 1795 -884.9 1770
> Random effects:
> Groups Name Variance Std.Dev.
> Site (Intercept) 0.62318 0.78941
> Week (Intercept) 0.13883 0.37260
> Number of obs: 150, groups: Site, 15; Week, 10
>
> Fixed effects:
> Estimate Std. Error z value Pr(>|z|)
> (Intercept) 2.8116 0.3740 7.517 5.59e-14 ***
> HabitatGreen roof -0.8676 0.5040 -1.721 0.0852 .
> HabitatGreen space 0.2008 0.5021 0.400 0.6892
> ---
> Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
>
> Correlation of Fixed Effects:
> (Intr) HbttGr
> HabittGrnrf -0.668
> HabttGrnspc -0.671 0.498
>
> From this I understand that green roof has a negative trend with
> brownfield, and green space has no significance with brownfield. But
> what about green roof and green space???? Is there a way of
> interpreting this information from the above data. Is it like ANOVA
> where you have to manually calculate the p value. Or do I have to
> simplify this model by reducing my Habitat factors levels (e.g.
> combining green space and brownfield together).
>
> My second mixed effect model is seeing if environmental factors influence
> the mixed effect model, but I want to use interactions. When I plot this I
> get an error message.
>
>> model1<-lmer(Total.abundance~(area+Hemeroby+Age+isolation+Height+Bare.ground+Grass+Non.grass)^2+(1|Site)+(1|Week),REML=FALSE,family=poisson)
>
> Error: inner loop 1; cannot correct step size
> In addition: Warning message:
> step size truncated due to divergence
>
> Thus I tried it without interactions-
>> model1<-lmer(Total.abundance~area+Hemeroby+Age+isolation+Height+Bare.ground+Grass+Non.grass+(1|Site)+(1|Week),REML=FALSE,family=poisson)
>
> but with a couple of simplifications of the model the intercept was not
> significant, so I dont' know what to do.
>
> Kind Regards
>
> Ellie
>
--
View this message in context: http://r.789695.n4.nabble.com/Mixed-effect-models-tp3737266p3737514.html
Sent from the R help mailing list archive at Nabble.com.
More information about the R-help
mailing list