Dear all.
I'm currently working on recurrent event analysis and decided to weight subjects based on the Number of days they contributed to the study. Now i have generated simple weight by dividing the actual days each person contributed by Total number of days contributed by all subjects together. Now i tried doing weighted cox analysis using iweights but when i run the model it is considering only 5 subjects. Following is my data of first four subjects
Code:
stset Endday [iweight = Wt10000], id(rid) failure(NonAdherence==1) enter( Startday ) exit(time .)
stcox gage_ld
Output:
. stset Endday [iweight = Wt10000], id(rid) failure(NonAdherence==1) enter( Startday ) exit(time .) scale(1)
id: rid
failure event: NonAdherence == 1
obs. time interval: (Endday[_n-1], Endday]
enter on or after: time Startday
exit on or before: time .
weight: [iweight=Wt10000]
------------------------------------------------------------------------------
10,741 total observations
0 exclusions
------------------------------------------------------------------------------
10,741 observations remaining, representing
2,070 subjects
3,390 failures in multiple-failure-per-subject data
327,886 total analysis time at risk and under observation
at risk from t = 0
earliest observed entry t = 0
last observed exit t = 229
. stcox gage_ld
failure _d: NonAdherence == 1
analysis time _t: Endday
enter on or after: time Startday
exit on or before: time .
id: rid
weight: [iweight=Weight]
Iteration 0: log likelihood = .48397286
Iteration 1: log likelihood = .78416524
Iteration 2: log likelihood = .7896293
Iteration 3: log likelihood = .78963023
Refining estimates:
Iteration 0: log likelihood = .78963023
Cox regression -- Breslow method for ties
No. of subjects = 1 Number of obs = 5
No. of failures = 2
Time at risk = 164.2037884
LR chi2(1) = 0.61
Log likelihood = .78963023 Prob > chi2 = 0.4343
------------------------------------------------------------------------------
_t | Haz. Ratio Std. Err. z P>|z| [95% Conf. Interval]
-------------+----------------------------------------------------------------
gage_ld | .8304996 .2043726 -0.75 0.450 .5127108 1.345261
------------------------------------------------------------------------------
.
. Now the problem here is i have 2070 subjects with 10741 but the analysis says only 1 subjects with 5 observation. Here the iweight is not really serving my purpose of adjusting the hazard.
Please guide me how to use these weights to adjust in the Hazard estimation instaed of increasing sample size using weights.
Thanks in advance!!
I'm currently working on recurrent event analysis and decided to weight subjects based on the Number of days they contributed to the study. Now i have generated simple weight by dividing the actual days each person contributed by Total number of days contributed by all subjects together. Now i tried doing weighted cox analysis using iweights but when i run the model it is considering only 5 subjects. Following is my data of first four subjects
rid | visdtl | gage_ld | Startday | Endday | NonAdherence | Weight |
1 | January 4, 2019 | 13 | 0 | 34 | 1 | 0.0006195 |
1 | February 4, 2019 | 18 | 34 | 65 | 0 | 0.0006195 |
1 | March 8, 2019 | 22 | 65 | 97 | 0 | 0.0006195 |
1 | April 8, 2019 | 27 | 97 | 128 | 1 | 0.0006195 |
1 | May 6, 2019 | 31 | 128 | 156 | 1 | 0.0006195 |
1 | June 3, 2019 | 35 | 156 | 184 | 0 | 0.0006195 |
1 | June 22, 2019 | 37 | 184 | 203 | 0 | 0.0006195 |
2 | December 28, 2018 | 16 | 0 | 27 | 1 | 0.0004638 |
2 | March 26, 2019 | 29 | 27 | 115 | 1 | 0.0004638 |
2 | April 23, 2019 | 33 | 115 | 143 | 0 | 0.0004638 |
2 | May 2, 2019 | 34 | 143 | 152 | 0 | 0.0004638 |
3 | December 28, 2018 | 19 | 0 | 27 | 0 | 0.0005096 |
3 | March 25, 2019 | 32 | 27 | 114 | 1 | 0.0005096 |
3 | May 17, 2019 | 39 | 114 | 167 | 1 | 0.0005096 |
7 | January 7, 2019 | 18 | 0 | 31 | 0 | 0.0005249 |
7 | February 8, 2019 | 23 | 31 | 63 | 0 | 0.0005249 |
7 | March 6, 2019 | 26 | 63 | 89 | 0 | 0.0005249 |
7 | April 5, 2019 | 31 | 89 | 119 | 0 | 0.0005249 |
7 | May 10, 2019 | 36 | 119 | 154 | 0 | 0.0005249 |
7 | May 30, 2019 | 38 | 154 | 172 | 0 | 0.0005249 |
stset Endday [iweight = Wt10000], id(rid) failure(NonAdherence==1) enter( Startday ) exit(time .)
stcox gage_ld
Output:
. stset Endday [iweight = Wt10000], id(rid) failure(NonAdherence==1) enter( Startday ) exit(time .) scale(1)
id: rid
failure event: NonAdherence == 1
obs. time interval: (Endday[_n-1], Endday]
enter on or after: time Startday
exit on or before: time .
weight: [iweight=Wt10000]
------------------------------------------------------------------------------
10,741 total observations
0 exclusions
------------------------------------------------------------------------------
10,741 observations remaining, representing
2,070 subjects
3,390 failures in multiple-failure-per-subject data
327,886 total analysis time at risk and under observation
at risk from t = 0
earliest observed entry t = 0
last observed exit t = 229
. stcox gage_ld
failure _d: NonAdherence == 1
analysis time _t: Endday
enter on or after: time Startday
exit on or before: time .
id: rid
weight: [iweight=Weight]
Iteration 0: log likelihood = .48397286
Iteration 1: log likelihood = .78416524
Iteration 2: log likelihood = .7896293
Iteration 3: log likelihood = .78963023
Refining estimates:
Iteration 0: log likelihood = .78963023
Cox regression -- Breslow method for ties
No. of subjects = 1 Number of obs = 5
No. of failures = 2
Time at risk = 164.2037884
LR chi2(1) = 0.61
Log likelihood = .78963023 Prob > chi2 = 0.4343
------------------------------------------------------------------------------
_t | Haz. Ratio Std. Err. z P>|z| [95% Conf. Interval]
-------------+----------------------------------------------------------------
gage_ld | .8304996 .2043726 -0.75 0.450 .5127108 1.345261
------------------------------------------------------------------------------
.
. Now the problem here is i have 2070 subjects with 10741 but the analysis says only 1 subjects with 5 observation. Here the iweight is not really serving my purpose of adjusting the hazard.
Please guide me how to use these weights to adjust in the Hazard estimation instaed of increasing sample size using weights.
Thanks in advance!!