Dear all, I have a study with 3 treatments and a time-to-event outcome measured multiple times over time for each patient.
I am in an observational setting and I calculated the IPW (inverse probability weights) after calculating the propensity scores via a multinomial model.
When I do
STATA in the output correctly tells me that I have 838 subjects.
However, when I go to do my cox model STATA sees each observation as a single patient and says I've got 4,899 patients!
Do you know where I am wrong?
Thank you so much!
Gianfranco
I am in an observational setting and I calculated the IPW (inverse probability weights) after calculating the propensity scores via a multinomial model.
When I do
Code:
stset stset followup [pweight=group_w], id(id) failure(OutYN==0)
Code:
. stset followup [pweight=group_w], id(id) failure(OutYN==0)
Survival-time data settings
ID variable: id
Failure event: OutYN==0
Observed time interval: (followup[_n-1], followup]
Exit on or before: failure
Weight: [pweight=group_w]
--------------------------------------------------------------------------
2,554 total observations
20 weights invalid PROBABLE ERROR
--------------------------------------------------------------------------
2,534 observations remaining, representing
838 subjects
205 failures in single-failure-per-subject data
20,208.4 total analysis time at risk and under observation
At risk from t = 0
Earliest observed entry t = 0
Last observed exit t = 36
Code:
. xi: stcox ib2.AED_4_trattamenti
Failure _d: OutYN==0
Analysis time _t: followup
ID variable: id
Weight: [pweight=group_w]
(sum of wgt is 14,692.6996538639)
Iteration 0: log pseudolikelihood = -9614.0512
Iteration 1: log pseudolikelihood = -9585.6003
Iteration 2: log pseudolikelihood = -9585.3606
Iteration 3: log pseudolikelihood = -9585.3606
Refining estimates:
Iteration 0: log pseudolikelihood = -9585.3606
Cox regression with Breslow method for ties
No. of subjects = 4,899 Number of obs = 2,534
No. of failures = 1,159
Time at risk = 116,995.778
Wald chi2(2) = 5.05
Log pseudolikelihood = -9585.3606 Prob > chi2 = 0.0800
(Std. err. adjusted for 838 clusters in id)
-----------------------------------------------------------------------------------
| Robust
_t | Haz. ratio std. err. z P>|z| [95% conf. interval]
------------------+----------------------------------------------------------------
AED_4_trattamenti |
Brivaracetam | 1.65829 .4509027 1.86 0.063 .9732213 2.82559
Perampanel | 1.658218 .3839784 2.18 0.029 1.053263 2.610638
-----------------------------------------------------------------------------------
Thank you so much!
Gianfranco

Comment