User Tools

Site Tools


resources:lme

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
resources:lme [2015/06/24 11:30] anthonyresources:lme [2019/05/22 16:08] (current) – external edit 127.0.0.1
Line 55: Line 55:
 >terms in the model and I would advocate performing a likelihood ratio >terms in the model and I would advocate performing a likelihood ratio
 >test comparing the two models >test comparing the two models
-+>
 ><code rsplus> ><code rsplus>
 >fm <- glmer(SameSite~BreedSuc1+Sex+(1|Bird), family="binomial") >fm <- glmer(SameSite~BreedSuc1+Sex+(1|Bird), family="binomial")
Line 62: Line 62:
 >anova(fm0, fm) >anova(fm0, fm)
 ></code> ></code>
- 
 >Even though the function is called anova it will, in this case, >Even though the function is called anova it will, in this case,
 >perform a likelihood ratio test (LRT).  It also prints the values of >perform a likelihood ratio test (LRT).  It also prints the values of
 >AIC and BIC if you prefer to compare models according to one of those >AIC and BIC if you prefer to compare models according to one of those
 >criteria but I prefer using the likelihood ratio for nested models. >criteria but I prefer using the likelihood ratio for nested models.
- 
 >However, before doing that comparison you should ask yourself whether >However, before doing that comparison you should ask yourself whether
 >you want to compare models that have the, apparently unnecessary term >you want to compare models that have the, apparently unnecessary term
 >for Sex in them.  The way I would approach the model building is first >for Sex in them.  The way I would approach the model building is first
 >to reduce the model to >to reduce the model to
- 
 ><code rsplus> ><code rsplus>
 >fm1 <- lmer(SameSite~BreedSuc1+(1|Bird), family="binomial") >fm1 <- lmer(SameSite~BreedSuc1+(1|Bird), family="binomial")
 ></code> ></code>
- 
 >You could then compare >You could then compare
- 
 ><code rsplus> ><code rsplus>
 >anova(fm1, fm) >anova(fm1, fm)
-></code+></code> 
-+
 >which I presume will give a large p-value for the LRT, so we prefer >which I presume will give a large p-value for the LRT, so we prefer
 >the simpler model, fm1.  After that, I would compare >the simpler model, fm1.  After that, I would compare
- 
 ><code rsplus> ><code rsplus>
 >fm2 <- lmer(SameSite ~ 1 + (1|Bird), family="binomial") >fm2 <- lmer(SameSite ~ 1 + (1|Bird), family="binomial")
 ></code> ></code>
resources/lme.1435159836.txt.gz · Last modified: (external edit)