0

Using the rms package of Frank Harrell I constructed a predictive model using the lrm function.

I want to compare if this model has a significant better predictive value on a binomial event in comparison with another (lrm-) model.

I used different functions like anova(model1, model2) or the pR2 function of the pscl library to compare the pseudo R^2, but they all don't work with the lrm based model.

What can I do best to see if my new model is significant beter than the earlier model?

Update: Here is a example (where I want to predict the chance on bone metastasis) to check if size or stage (in addition to other variabele) gives the best model:

library(rms)
getHdata(prostate)

ddd <- datadist(prostate)
options( datadist = "ddd" )

mod1 = lrm(as.factor(bm) ~ age + sz + rx, data=prostate, x=TRUE, y=TRUE)

mod2 = lrm(as.factor(bm) ~ age + stage + rx, data=prostate, x=TRUE, y=TRUE)
merv
  • 67,214
  • 13
  • 180
  • 245
Klaas J
  • 41
  • 3

2 Answers2

0

It seems fundamentally the question is about comparing two non-nested models.

If you fit your models using the glm function you can use the -vuong- function in -pscl- package.

0

To test the fit of 2 nested models, you can use the lrtest function from the "rms" package.

lrtest(mod1,mod2)

Paul Tran
  • 1
  • 1