Dear all, is there a way to extract individual likelihoods from a glm/lrm object? By individual likelihoods, I mean the likelihoods whose product give the overall likelihood of the model. I guess the code in the base package, used to compute the Akaike Information Criterion may help me. However, I couldn't figure it out, probably because I'm rather new to likelihood theory and ML estimation ;-) Thanks for any help/suggestion/tip, Bruno
Dear Bruno, residuals(mod, type="deviance") gives you the deviance residuals for the model, so sum(residuals(mod, type="deviance")^2) is the deviance. I hope that this helps, John At 02:29 PM 1/16/2004 +0100, Bruno Giordano wrote:>Dear all, >is there a way to extract individual likelihoods from a glm/lrm object? >By individual likelihoods, I mean the likelihoods whose product give the >overall likelihood of the model. >I guess the code in the base package, used to compute the Akaike Information >Criterion may help me. >However, I couldn't figure it out, probably because I'm rather new to >likelihood theory and ML estimation ;-) >Thanks for any help/suggestion/tip, > Bruno----------------------------------------------------- John Fox Department of Sociology McMaster University Hamilton, Ontario, Canada L8S 4M4 email: jfox at mcmaster.ca phone: 905-525-9140x23604 web: www.socsci.mcmaster.ca/jfox
> > Dear all, > is there a way to extract individual likelihoods from a glm/lrm object? > By individual likelihoods, I mean the likelihoods whose product give the > overall likelihood of the model. > I guess the code in the base package, used to compute the Akaike Information > Criterion may help me. > However, I couldn't figure it out, probably because I'm rather new to > likelihood theory and ML estimation ;-)The aic function just sums the corresponding density ("d") function with log=T (except for the normal and inverse Gauss, where it is written out explicitly). Note that mle are not available for the dispersion parameter of the gamma and inverse Gauss, although this makes vary little difference in almost all cases. Thus, you just need to feed the fitted values (and, if appropriate, the dispersion estimate) into the corresponding density function without summing. Cheers, Jim> Thanks for any help/suggestion/tip, > Bruno > > ______________________________________________ > R-help at stat.math.ethz.ch mailing list > https://www.stat.math.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html >
Maybe Matching Threads
- negetative AIC values: How to compare models with negative AIC's
- likelihoods in SAS GENMOD vs R glm
- Definition of AIC (Akaike information criterion) for normal error models
- LaTex error when creating DVI version when compiling package
- dlm package and Log Likelihoods