Re: [R] AIC and anova, lme
Patrick Giraudoux univ-fcomte.fr> writes: > > Dear listers, > > Here we have a strange result we can hardly cope with. We want to > compare a null mixed model with a mixed model with one independent > variable. > > > lmmedt1<-lme(mediane~1, random=~1|site, na.action=na.omit, data=bdd2) > > lmmedt9<-lme(mediane~log(0.0001+transat), random=~1|site, > na.action=na.omit, data=bdd2) ... > The usual conclusion would be that the two models are equivalent and to > keep the null model for parsimony (!). > > However, an anova shows that the variable 'log(1e-04 + transat)' is > significantly different from 0 in model 2 (lmmedt9) > > > anova(lmmedt9) > numDF denDF F-value p-value > (Intercept) 120 289.43109 <.0001 > log(1e-04 + transat) 120 31.18446 <.0001 > Ask the author of pgirmess to add some checks for the model as anova and stepAIC do: Dieter - library(MASS) library(nlme) fm1 <- lme(distance ~ age, data = Orthodont) fm2 <- lme(distance ~ age + Sex, data = Orthodont, random = ~ 1) >>In anova.lme(fm1, fm2) : << Fitted objects with different fixed effects. REML comparisons are not<< meaningful. stepAIC(fm2) >>Error in extractAIC.lme(fit, scale, k = k, ...) : >> AIC undefined for REML fit __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] AIC and anova, lme
ian white a écrit : Patrick, The likelihoods of two models fitted using REML cannot be compared unless the fixed effects are the same in the two models. Many thanks for this reminder. Shame on me: it recalls me that this subject may have been already largely discussed on this list. Now, I can search the archives specifically with the REML issue... All the best, Patrick On Tue, 2008-02-26 at 14:38 +0100, Patrick Giraudoux wrote: Dear listers, Here we have a strange result we can hardly cope with. We want to compare a null mixed model with a mixed model with one independent variable. > lmmedt1<-lme(mediane~1, random=~1|site, na.action=na.omit, data=bdd2) > lmmedt9<-lme(mediane~log(0.0001+transat), random=~1|site, na.action=na.omit, data=bdd2) Using the Akaike Criterion and selMod of the package pgirmess gives the following output: > selMod(list(lmmedt1,lmmedt9)) model LL K N2K AIC deltAIC w_i AICc deltAICc w_ic 2 log(1e-04 + transat) 44.63758 4 7.5 -81.27516 0.00 0.65 -79.67516 0.00 0.57 11 43.02205 3 10.0 -80.04410 1.231069 0.35 -79.12102 0.554146 0.43 The usual conclusion would be that the two models are equivalent and to keep the null model for parsimony (!). However, an anova shows that the variable 'log(1e-04 + transat)' is significantly different from 0 in model 2 (lmmedt9) > anova(lmmedt9) numDF denDF F-value p-value (Intercept) 120 289.43109 <.0001 log(1e-04 + transat) 120 31.18446 <.0001 Has anyone an opinion about what looks like a paradox here ? Patrick __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] AIC and anova, lme
Patrick, The likelihoods of two models fitted using REML cannot be compared unless the fixed effects are the same in the two models. On Tue, 2008-02-26 at 14:38 +0100, Patrick Giraudoux wrote: > Dear listers, > > Here we have a strange result we can hardly cope with. We want to > compare a null mixed model with a mixed model with one independent > variable. > > > lmmedt1<-lme(mediane~1, random=~1|site, na.action=na.omit, data=bdd2) > > lmmedt9<-lme(mediane~log(0.0001+transat), random=~1|site, > na.action=na.omit, data=bdd2) > > Using the Akaike Criterion and selMod of the package pgirmess gives the > following output: > > > selMod(list(lmmedt1,lmmedt9)) > model LL K N2K AIC deltAIC w_i AICc > deltAICc w_ic > 2 log(1e-04 + transat) 44.63758 4 7.5 -81.27516 0.00 0.65 -79.67516 > 0.00 0.57 > 11 43.02205 3 10.0 -80.04410 1.231069 0.35 -79.12102 > 0.554146 0.43 > > The usual conclusion would be that the two models are equivalent and to > keep the null model for parsimony (!). > > However, an anova shows that the variable 'log(1e-04 + transat)' is > significantly different from 0 in model 2 (lmmedt9) > > > anova(lmmedt9) > numDF denDF F-value p-value > (Intercept) 120 289.43109 <.0001 > log(1e-04 + transat) 120 31.18446 <.0001 > > Has anyone an opinion about what looks like a paradox here ? > > Patrick > > > > __ > R-help@r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
[R] AIC and anova, lme
Dear listers, Here we have a strange result we can hardly cope with. We want to compare a null mixed model with a mixed model with one independent variable. > lmmedt1<-lme(mediane~1, random=~1|site, na.action=na.omit, data=bdd2) > lmmedt9<-lme(mediane~log(0.0001+transat), random=~1|site, na.action=na.omit, data=bdd2) Using the Akaike Criterion and selMod of the package pgirmess gives the following output: > selMod(list(lmmedt1,lmmedt9)) model LL K N2K AIC deltAIC w_i AICc deltAICc w_ic 2 log(1e-04 + transat) 44.63758 4 7.5 -81.27516 0.00 0.65 -79.67516 0.00 0.57 11 43.02205 3 10.0 -80.04410 1.231069 0.35 -79.12102 0.554146 0.43 The usual conclusion would be that the two models are equivalent and to keep the null model for parsimony (!). However, an anova shows that the variable 'log(1e-04 + transat)' is significantly different from 0 in model 2 (lmmedt9) > anova(lmmedt9) numDF denDF F-value p-value (Intercept) 120 289.43109 <.0001 log(1e-04 + transat) 120 31.18446 <.0001 Has anyone an opinion about what looks like a paradox here ? Patrick __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.