I am running a logistic regression predictive model with death (sta) as the binary outcome variable, and age (continuous variable), and cancer status (variable can; categorical variable) as predictors.

I want to assess its calibration. I decided to try the "Pearson Residual" test (pls see my code below). I want to know is there any requirement for the PR test (e.g. sample size, type of predictors, etc)? I also used the Hosmer-Lemeshow (HL) test but it yielded different results (Pearson suggests good fit but the HL test does not).

Thank you so much for the help!

lr.fit <- glm(sta~age+can, data=icu, family=binomial)
p.res <- resid(lr.fit, type="pearson")
x.stat <- sum(p.res^2)
1-pchisq(x.stat, df=lr.fit$df.residual) 
## [1] 0.4364181

  • 1
    $\begingroup$ Please don't repost questions: it is much preferred that you edit the original so that the comment thread is not lost. $\endgroup$
    – whuber
    Nov 26 '21 at 17:31
  • $\begingroup$ @whuber Can you pls disregard the other post and provide a comment/advice on this post? Thanks! $\endgroup$
    – R Beginner
    Nov 26 '21 at 17:38

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.