Using the Cement hardening data in Anderson (2008) Model Based Inference in the Life Sciences. A Primer on Evidence, and working with the best model which is lm ( y ~ x1 + x2, data = cement ) the AIC value from R is model <- lm ( formula = y ~ x1 + x2 , data cement ) AIC ( model ) 64.312 which can be converted to AICc by adding the bias correction factor 2*K*(K+1)/(n-K-1) to give the AICc value of 69.312 (addition of 5, where n=13 and K=4). This same value, 69.31, can be obtained using R package AICcmodavg library ( AICcmodavg ) data (cement) cement Cand.models <- list( ) Cand.models[[1]] <- lm ( y ~ x1 + x2, data = cement ) Cand.models[[2]] <- lm ( y ~ x3 + x4, data = cement ) Cand.models[[3]] <- lm ( y ~ x1 + x2 + x1 * x2, data cement ) Cand.models[[4]] <- lm ( y ~ x3 + x4 + x3 * x4, data cement ) ## vector of model names Modnames <- paste("MODEL", 1:4, sep=" ") ## AICc aictab ( cand.set = Cand.models, modnames = Modnames ) However, the AICc value reported by Anderson (2008) is 32.41. The AICc value obtained using RSS value (i.e., calculating AICc "manually" from the output of linear regression) is 32.41. Thanks for any help. David New R user, minimal familiarity with statistics. [[alternative HTML version deleted]]
This is answered in ?AIC. Have you read it? -- Bert On Mon, Feb 13, 2012 at 10:22 AM, david hamer <j.david.hamer at gmail.com> wrote:> Using the Cement hardening data in Anderson (2008) Model Based Inference in > the Life Sciences. A Primer on Evidence, and working with the best model > which is > ? ?lm ?( ?y ?~ ? x1 ? + ? x2, ? ?data = cement ?) > the AIC value from R is > > ? ?model ? ?<- ? ?lm ?( formula ? = ? y ? ~ ? x1 ? + ?x2 ?, ? data > cement ?) > ? ?AIC ( model ) > > 64.312 > > which can be converted to AICc by adding the bias correction factor > 2*K*(K+1)/(n-K-1) to give the AICc value of > 69.312 > (addition of 5, where n=13 and K=4). > > This same value, 69.31, can be obtained using R package > AICcmodavg > > ? library ?( ?AICcmodavg ?) > ? data (cement) > ? cement > ? Cand.models ? <- ? list( ) > ? Cand.models[[1]] ? <- ? lm ?( ?y ?~ ? x1 ? + ? x2, ? ?data = cement ?) > ? Cand.models[[2]] ? <- ? lm ?( ?y ? ?~ ? x3 ? + ? x4, ? ? data = cement ?) > ? Cand.models[[3]] ? <- ? lm ?( ?y ? ~ ? x1 + x2 + x1 * x2, ? data > cement ?) > ? Cand.models[[4]] ? <- ? lm ?( ?y ? ~ ? x3 ?+ ?x4 ?+ ?x3 * x4, ? data > cement ?) > ? ? ## ? vector of model names > ? Modnames ? <- ? paste("MODEL", 1:4, sep=" ? ? ") > ? ? ## ? AICc > ? aictab ? ( ?cand.set ? = ? Cand.models, ? modnames ?= ?Modnames ?) > > However, the AICc value reported by Anderson (2008) is > 32.41. > The AICc value obtained using RSS value (i.e., calculating AICc "manually" > from the output of linear regression) is > 32.41. > > Thanks for any help. > David > New R user, minimal familiarity with statistics. > > ? ? ? ?[[alternative HTML version deleted]] > > ______________________________________________ > R-help at 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.-- Bert Gunter Genentech Nonclinical Biostatistics Internal Contact Info: Phone: 467-7374 Website: http://pharmadevelopment.roche.com/index/pdb/pdb-functional-groups/pdb-biostatistics/pdb-ncb-home.htm
hi: the definition of AIC can vary a lot from paper to paper and textbook to textbook because some people keep the multiplicative constants and other's don't. all that matters when using AIC is COMPARISON. the value itself means nothing. So, you'll be fine no matter what you use as long as you're consistent. On Mon, Feb 13, 2012 at 1:22 PM, david hamer <j.david.hamer@gmail.com>wrote:> Using the Cement hardening data in Anderson (2008) Model Based Inference in > the Life Sciences. A Primer on Evidence, and working with the best model > which is > lm ( y ~ x1 + x2, data = cement ) > the AIC value from R is > > model <- lm ( formula = y ~ x1 + x2 , data > cement ) > AIC ( model ) > > 64.312 > > which can be converted to AICc by adding the bias correction factor > 2*K*(K+1)/(n-K-1) to give the AICc value of > 69.312 > (addition of 5, where n=13 and K=4). > > This same value, 69.31, can be obtained using R package > AICcmodavg > > library ( AICcmodavg ) > data (cement) > cement > Cand.models <- list( ) > Cand.models[[1]] <- lm ( y ~ x1 + x2, data = cement ) > Cand.models[[2]] <- lm ( y ~ x3 + x4, data = cement ) > Cand.models[[3]] <- lm ( y ~ x1 + x2 + x1 * x2, data > cement ) > Cand.models[[4]] <- lm ( y ~ x3 + x4 + x3 * x4, data > cement ) > ## vector of model names > Modnames <- paste("MODEL", 1:4, sep=" ") > ## AICc > aictab ( cand.set = Cand.models, modnames = Modnames ) > > However, the AICc value reported by Anderson (2008) is > 32.41. > The AICc value obtained using RSS value (i.e., calculating AICc "manually" > from the output of linear regression) is > 32.41. > > Thanks for any help. > David > New R user, minimal familiarity with statistics. > > [[alternative HTML version deleted]] > > ______________________________________________ > 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. >[[alternative HTML version deleted]]