Hello. I need to know how can R compute AIC when I study a regression model? For example, if I use these data: growth tannin 1 12 0 2 10 1 3 8 2 4 11 3 5 6 4 6 7 5 7 2 6 8 3 7 9 3 8 and I do model <- lm (growth ~ tannin) AIC(model)
R responses: 38.75990 I know the following formula to compute AIC: AIC= -2*log-likelihood + 2*(p+1) In my example, it would be: AIC=-2*log-likelihood + 2*2 but I don't know how R computes log-likelihood: logLik(model) 'log Lik.' -16.37995 (df=3) Thanks, Arnau. ------------------------------------------------------------ Arnau Mir Torres Edifici A. Turmeda Campus UIB Ctra. Valldemossa, km. 7,5 07122 Palma de Mca. tel: (+34) 971172987 fax: (+34) 971173003 email: [EMAIL PROTECTED] URL: http://dmi.uib.es/~arnau ______________________________________________ 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.