I am using STATA version 15.1 and am struggling to estimate margins for a continuous predictor in a Cox model.
My model is as follows:
Code:
stcox c.NECK_BMD##c.PTH i.mode age gender smoke diabetic bmi i.ethnicity logcrp
failure _d: fracture == 1
analysis time _t: (t2-origin)
origin: time t1
id: MRN
Iteration 0: log likelihood = -308.62837
Iteration 1: log likelihood = -275.99979
Iteration 2: log likelihood = -274.80494
Iteration 3: log likelihood = -274.7894
Iteration 4: log likelihood = -274.78939
Refining estimates:
Iteration 0: log likelihood = -274.78939
Cox regression -- Breslow method for ties
No. of subjects = 541 Number of obs = 882
No. of failures = 53
Time at risk = 1373854
LR chi2(13) = 67.68
Log likelihood = -274.78939 Prob > chi2 = 0.0000
----------------------------------------------------------------------------------
_t | Haz. Ratio Std. Err. z P>|z| [95% Conf. Interval]
-----------------+----------------------------------------------------------------
NECK_BMD | .0132728 .018612 -3.08 0.002 .0008499 .207286
PTH | .9605353 .0210715 -1.84 0.066 .9201112 1.002735
|
c.NECK_BMD#c.PTH | 1.055137 .0265155 2.14 0.033 1.004427 1.108408
|
mode |
2 | .6173586 .2190188 -1.36 0.174 .3080057 1.237417
3 | 2.961642 1.734868 1.85 0.064 .9395427 9.335739
|
age | 1.05512 .0123535 4.58 0.000 1.031184 1.079613
gender | .8067608 .2493522 -0.69 0.487 .440207 1.478538
smoke | 1.143296 .3512041 0.44 0.663 .6261551 2.087544
diabetic | .954896 .296503 -0.15 0.882 .5195784 1.754935
bmi | .9986224 .0300873 -0.05 0.964 .9413597 1.059368
|
ethnicity |
2 | .6176335 .2603139 -1.14 0.253 .2703803 1.410869
3 | 1.470432 .58065 0.98 0.329 .67814 3.188385
|
logcrp | 1.3047 .1370784 2.53 0.011 1.061889 1.603032
----------------------------------------------------------------------------------
After that model, I tried to launch the following command to compute and represent margins:
Code:
margins, dydx(NECK_BMD) continuous at(PTH=(0(5)100))
------------------------------------------------------------------------------
| Delta-method
| dy/dx Std. Err. z P>|z| [95% Conf. Interval]
-------------+----------------------------------------------------------------
NECK_BMD |
_at |
1 | -8.539205 10.21442 -0.84 0.403 -28.5591 11.48069
2 | -7.721337 9.325521 -0.83 0.408 -25.99902 10.55635
3 | -6.962114 8.508685 -0.82 0.413 -23.63883 9.714602
4 | -6.255928 7.754922 -0.81 0.420 -21.4553 8.943438
5 | -5.59767 7.056651 -0.79 0.428 -19.42845 8.233112
6 | -4.98267 6.407584 -0.78 0.437 -17.5413 7.575963
7 | -4.406646 5.802647 -0.76 0.448 -15.77963 6.966333
8 | -3.865657 5.237974 -0.74 0.461 -14.1319 6.400582
9 | -3.356057 4.710975 -0.71 0.476 -12.5894 5.877285
10 | -2.874453 4.22053 -0.68 0.496 -11.14654 5.397634
11 | -2.417671 3.767345 -0.64 0.521 -9.801531 4.966189
12 | -1.982715 3.354536 -0.59 0.554 -8.557484 4.592055
13 | -1.566732 2.988485 -0.52 0.600 -7.424056 4.290592
14 | -1.166978 2.67983 -0.44 0.663 -6.419348 4.085393
15 | -.7807768 2.443964 -0.32 0.749 -5.570858 4.009305
16 | -.4054869 2.299532 -0.18 0.860 -4.912487 4.101513
17 | -.0384554 2.263205 -0.02 0.986 -4.474257 4.397346
18 | .3230266 2.342194 0.14 0.890 -4.267589 4.913642
19 | .6817762 2.530825 0.27 0.788 -4.278549 5.642102
20 | 1.040779 2.814964 0.37 0.712 -4.476449 6.558007
21 | 1.403259 3.179551 0.44 0.659 -4.828547 7.635066
------------------------------------------------------------------------------
Warning: Multiple observations per subject are detected. Predictions that require averaging over the dataset may not be appropriate. Use the at()
option to compute predictions at fixed values of the covariates.
Now here is my problem: How can p-values for NECK_BMD be absolutely non significant when this same variable is very significant in the main model? There is most likely something obvious that I am missing here or not understanding properly. Whould you have some insights about that?
Thank you very much and best regards.
David J
0 Response to Cox model margins estimates
Post a Comment