[R] Obtaining fitted model information

John Fox jfox at mcmaster.ca
Sun Oct 31 19:37:35 CET 2004

Dear Thomas,

To get the number of independent parameters in the lm object mod, you can
use mod$rank, sum(!is.na(coef(mod)), or -- if there are no linear
dependencies among the columns of the model matrix -- length(coef(mod)).

I hope this helps,

John Fox
Department of Sociology
McMaster University
Hamilton, Ontario
Canada L8S 4M4

> -----Original Message-----
> From: r-help-bounces at stat.math.ethz.ch 
> [mailto:r-help-bounces at stat.math.ethz.ch] On Behalf Of Thomas 
> W Volscho
> Sent: Sunday, October 31, 2004 12:41 PM
> To: r-help at stat.math.ethz.ch
> Subject: [R] Obtaining fitted model information
> Dear list,
> I am brand new to R  and using Dalgaard's (2002) book 
> Introductory Statistics with R (thus, some of my terminology 
> may be incorrect).
> I am fitting regression models and I want to use Hurvich and 
> Tsai's AICC statistic to examine my regression models.  This 
> penalty can be expressed as: 2*npar * (n/(n-npar-1)).
> While you can obtain AIC, BIC, and logLik, I want to impose 
> the AICC penalty instead.
> After fitting a model.  Is there a way of obtaining the 
> "npar" and then assigning it to a variable?
> Essentially, I want to then write a simple function to add 
> the AICC penalty to (-2*logLik).
> Thank you in advance for any help,
> Tom Volscho
> ************************************        
> Thomas W. Volscho
> Graduate Student
> Dept. of Sociology U-2068
> University of Connecticut
> Storrs, CT 06269
> Phone: (860) 486-3882
> http://vm.uconn.edu/~twv00001
> ______________________________________________
> R-help at stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide! 
> http://www.R-project.org/posting-guide.html

More information about the R-help mailing list