Jan Verbesselt
2005-Aug-12 13:45 UTC
[R] HowTo derive a correct likelihood-ratio chi-squared statistic from lrm() with a rsc() ?
Dear R helpers,>From the lrm( ) model used for binary logistic regression, we used the L.R.model value (or the G2 value, likelihood-ratio chi-squared statistic) to evaluate the goodness-of-fit of the models. The model with the lowest G2 value consequently, has the best performance and the highest accuracy. However our model includes rsc() functions to account for non-linearity. We would like to penalize the L.R. model function for the non-linearity because the L.R. model value we obtain from different models are just the inverse of the derived c-index and AIC (from the lrm) (?!). So the L.R. Model is higher for the best model and not lower as explained above… The models: These are the models knots <- 5 lrm.iRVI <- lrm(arson ~ rcs(iRVI,knots)) lrm.ARND <- lrm(arson ~ rcs(ARND,knots)) lrm.ARNDiRVI <- lrm(arson ~ rcs(ARND,knots)+rcs(iRVI,knots)) and the L.R. model values are bigger, the better the model becomes (it is the inverse of our derived AIC and c-index). Normally, the best model should have the lowest G2 value. Could we solve this by penalizing the model or is there another way to derive a correct G2 value when rcs() functions are used in an lrm() model? e.g., lrm.iRVI <- lrm(arson ~ rcs(iRVI,knots), penalty=list(simple=10,nonlinear=100,nonlinear.interaction=4)) but this does not work. Is the AIC value a good approx for the L.R. model? (see function below) dAIC <- function(fit){ logl <- oos.loglik(fit) # derive -2*logL of the model k <- 2 edf <- fit$stats[4] # 'edf' is the equivalent degrees of freedom (i.e., the number of parameters for usul parametric models) of 'fit'. lrmAIC <- logl + k*edf return(lrmAIC) } Best regards, Jan _______________________________________________________________________ Ir. Jan Verbesselt Research Associate Group of Geomatics Engineering Department Biosystems ~ M³-BIORES Vital Decosterstraat 102, 3000 Leuven, Belgium Tel: +32-16-329750 Fax: +32-16-329760 http://gloveg.kuleuven.ac.be/ _______________________________________________________________________ [[alternative HTML version deleted]]
Reasonably Related Threads
- Penalized likelihood-ratio chi-squared statistic: L.R. model for Goodness of fit?
- negetative AIC values: How to compare models with negative AIC's
- (no subject)
- Loop for the convergence of shape parameter
- Solved: linear regression example using MLE using optim()