Sorry for this, as I am new to R. I noticed that rms::calibrate with backward generated factors in final model and their coefficients are quite different from glm with step() function under the same criteria or the lrm() with the final factors.
Are coefficients of the final factors in "Approximate Estimates after Deleting Factor" different from the coefficients by these final factors in a lrm function?
I have already noticed to use the tyep = "individual" for the fast backward to behave like step. But the coefficient I got are still different.
Here I defined a full model with some variables and did the calibration with backward stepwise by p-value:
mod1.cal <- lrm(Death~ Age + Gender + F + IH + SH + M + A + C + BS + PSY, data = data, x = T, y = T)
set.seed(2020)
cal1 <- rms::calibrate(mod1.cal, method = 'boot', B = 100, bw = T, rule =
'p', sls = 0.05, type = 'individual', data = data)
The results were:
Backwards Step-down - Original Model
Deleted Chi-Sq d.f. P Residual d.f. P AIC
PSY 0.18 1 0.6716 0.18 1 0.6716 -1.82
F 2.84 1 0.0921 3.02 2 0.2212 -0.98
Approximate Estimates after Deleting Factors
Coef S.E. Wald Z P
Intercept -7.74397 0.572982 -13.515 0.000e+00
Age 0.06096 0.006425 9.489 0.000e+00
Gender=Male 0.86812 0.202052 4.297 1.735e-05
IH=Present 0.52113 0.193214 2.697 6.994e-03
SH=Present 0.70469 0.196477 3.587 3.350e-04
M=Presnet 0.88153 0.286214 3.080 2.070e-03
A=Present 0.60711 0.213466 2.844 4.454e-03
C=Present -1.02122 0.324155 -3.150 1.630e-03
BS=Abnormal 1.79088 0.291809 6.137 8.401e-10
Factors in Final Model
[1] Age Gender IH SH M A C BS
Then I applied the factos in final model again with lrm for a model:
mod1.final <- lrm(Death~ Age + Gender + IH + SH + M + A + C + BS, data = data, x = T, y = T)
And the results were:
Logistic Regression Model
lrm(formula = Death ~ Age + Gender + IH + SH + M + A + C + BS,
data = data, x = T, y = T)
Model Likelihood Discrimination Rank Discrim.
Ratio Test Indexes Indexes
Obs 1395 LR chi2 326.85 R2 0.365 C 0.850
Alive 1184 d.f. 8 g 1.964 Dxy 0.700
Death 211 Pr(> chi2) <0.0001 gr 7.126 gamma 0.700
max |deriv| 1e-10 gp 0.178 tau-a 0.180
Brier 0.095
Coef S.E. Wald Z Pr(>|Z|)
Intercept -7.7719 0.5702 -13.63 <0.0001
Age 0.0612 0.0064 9.57 <0.0001
Gender=Male 0.8708 0.2015 4.32 <0.0001
IH=Present 0.5217 0.1926 2.71 0.0068
SH=Present 0.7047 0.1968 3.58 0.0003
M=Present 0.8856 0.2874 3.08 0.0021
A=Present 0.6071 0.2131 2.85 0.0044
C=Present -1.0251 0.3252 -3.15 0.0016
BS=Abnormal 1.7998 0.2920 6.16 <0.0001
And I checked the coef of the mod1.final:
coef(mod1.final)
Intercept Age Gender=Male IH=Present SH=Present M=Present
A=Present C=Present BS=Abnormal
-7.7719073 0.0612293 0.8707690 0.5216842 0.7046757 0.8855560
0.6070599 -1.0250605 1.7997968
Can someone help on this.
Thanks
Add up the results from validation for questions:
index.orig training test optimism index.corrected n
Dxy 0.7889 0.8004 0.7752 0.0252 0.7637 100
R2 0.4818 0.5008 0.4645 0.0363 0.4455 100
Intercept 0.0000 0.0000 -0.0986 0.0986 -0.0986 100
Slope 1.0000 1.0000 0.9105 0.0895 0.9105 100
Emax 0.0000 0.0000 0.0387 0.0387 0.0387 100
D 0.3220 0.3361 0.3084 0.0277 0.2943 100
U -0.0014 -0.0014 0.0015 -0.0030 0.0015 100
Q 0.3235 0.3376 0.3069 0.0307 0.2928 100
B 0.0802 0.0768 0.0824 -0.0056 0.0858 100
g 2.4779 2.6190 2.3844 0.2346 2.2433 100
gp 0.2016 0.2041 0.1984 0.0056 0.1959 100