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) #p-value 1-pchisq(x.stat, df=lr.fit$df.residual) ##  0.4364181