[R] R-help Digest, Vol 129, Issue 15

Kamil Bartoń k.barton at abdn.ac.uk
Fri Nov 15 17:14:13 CET 2013


works ok with mock-up data. Can you give some code to reproduce this error?

kamil



On 2013-11-15 11:00, r-help-request w r-project.org wrote:
> Message: 56
> Date: Thu, 14 Nov 2013 18:01:27 -0800
> From: Lilly Dethier<lillydethier w gmail.com>
> To:r-help w r-project.org
> Subject: [R] Error in MuMIn "models are not all fitted to the same
>       data"
> Message-ID:
>       <CAOK+e=Z_0pMEFKdPxZ5Eub+DYhHFjzGk3Lcqczsa9TimAP4n_w w mail.gmail.com>
> Content-Type: text/plain
>
> I'm pretty new to GLMMs and model averaging, but think I'm getting some
> understanding of it all through lots of reading. However, I keep receiving
> an error message when trying to average models that I don't understand and
> can't find any resources about. I'm doing science education research trying
> to evaluate population demographic factors that predict biology student
> math performance. I have a lot of factors and so I tested a lot of models.
> 6 of my models had pretty similar AIC values (and evidence ratios of less
> than 2.7) so I'm trying to average them. I keep receiving an error message
> that says the models are not fitted to the same data, but I have no idea
> how this is possible because all the models are from the same set of data
> (same file and same variables)...strangely it seems to work when I try to
> average MEx7, MEx10, & MEx22 only OR MEx24, MEx29, and MEx47 only. My code
> is below. Any ideas? Thanks for any advice you can offer!!
>
> library(MuMIn)
> MEx7=lmer(cbind(c.score, w.score) ~ year + transfer + gender + p.math +
> (1|section) + (1|quarter), family=binomial, data=survey.full, REML=F)
> MEx10=lmer(cbind(c.score, w.score) ~ transfer + gender + p.math + Pmajor +
> (1|section) + (1|quarter), family=binomial, data=survey.full, REML=F)
> MEx22=lmer(cbind(c.score, w.score) ~ year + transfer + p.math + (1|section)
> + (1|quarter), family=binomial, data=survey.full, REML=F)
> MEx24=lmer(cbind(c.score, w.score) ~ transfer + gender + p.math +
> (1|section) + (1|quarter), family=binomial, data=survey.full, REML=F)
> MEx29=lmer(cbind(c.score, w.score) ~ transfer + p.math + Pmajor +
> (1|section) + (1|quarter), family=binomial, data=survey.full, REML=F)
> MEx47=lmer(cbind(c.score, w.score) ~ transfer + p.math + (1|section) +
> (1|quarter), family=binomial, data=survey.full, REML=F)
> MExAvg=model.avg(rank=AIC, MEx24, MEx7, MEx10, MEx47, MEx29, MEx22)
>
> Error in model.avg.default(rank = AIC, MEx24, MEx7, MEx10, MEx47, MEx29,  :
>    models are not all fitted to the same data
> Lilly Dethier





The University of Aberdeen is a charity registered in Scotland, No SC013683.



More information about the R-help mailing list