Dear all, I have a database in which I collected the time-to-event data of the drop out of 3 drugs and several covariates regarding the safety and the efficacy of drugs. Specifically I have the following variables:
- “AED_4_trattamenti” (categorical variable)
- “EventiYN” (time dependent dichotomous variable)
- “dicOutcome” (time dependent dichotomous variable)
- “OutYN==0” (drug dropout)
- “followup” (followup time)
- “ipw” (inverse probability weight variable)
The aim is to estimate longitudinal adverse events (variable “EventiYN”) and efficacy of drugs (variable “dicOutcome”) simultaneously with dropout, being the adverse events and efficacy correlate to retention rate of the drugs. I tried to ran a joint model with gsem command in Stata (16.1 version).
I declared time-to-event data:
and then ran the following code:
I would like to introduce the shared random effect and use the following code, but it never worked:
How would you correct the command?
Thanks in advance
Cristina
- “AED_4_trattamenti” (categorical variable)
- “EventiYN” (time dependent dichotomous variable)
- “dicOutcome” (time dependent dichotomous variable)
- “OutYN==0” (drug dropout)
- “followup” (followup time)
- “ipw” (inverse probability weight variable)
The aim is to estimate longitudinal adverse events (variable “EventiYN”) and efficacy of drugs (variable “dicOutcome”) simultaneously with dropout, being the adverse events and efficacy correlate to retention rate of the drugs. I tried to ran a joint model with gsem command in Stata (16.1 version).
I declared time-to-event data:
Code:
stset followup [pweight=ipw], id(id) failure(OutYN==0)
Code:
gsem (EventiYN dicOutcome<- i.AED_4_trattamenti followup, family(binomial) link(logit))(_t <- i.AED_4_trattamenti, family(loglogistic, failure(_d))), pweight(ipw) nocapslatent
Code:
Iteration 0: log pseudolikelihood = -4581.2249 (not concave)
Iteration 1: log pseudolikelihood = -3969.0842
Iteration 2: log pseudolikelihood = -3812.1741
Iteration 3: log pseudolikelihood = -3786.4502
Iteration 4: log pseudolikelihood = -3784.5576
Iteration 5: log pseudolikelihood = -3784.5314
Iteration 6: log pseudolikelihood = -3784.5313
Generalized structural equation model Number of obs = 2,473
Response : EventiYN Number of obs = 2,446
Family : Bernoulli
Link : logit
Response : dicOutcome Number of obs = 2,444
Family : Bernoulli
Link : logit
Response : _t Number of obs = 2,473
Family : loglogistic No. of failures = 197
Form : accelerated failure-time Time at risk = 39837.533
Link : log
Log pseudolikelihood = -3784.5313
-----------------------------------------------------------------------------------
| Robust
| Coef. Std. Err. z P>|z| [95% Conf. Interval]
------------------+----------------------------------------------------------------
EventiYN |
AED_4_trattamenti |
Lacosamide | -.5863494 .199902 -2.93 0.003 -.9781502 -.1945486
Perampanel | .2842013 .1571316 1.81 0.071 -.0237709 .5921736
|
followup | -.0122873 .0065292 -1.88 0.060 -.0250843 .0005096
_cons | -1.657448 .1557996 -10.64 0.000 -1.96281 -1.352086
------------------+----------------------------------------------------------------
dicOutcome |
AED_4_trattamenti |
Lacosamide | .3758846 .1213616 3.10 0.002 .1380203 .6137489
Perampanel | .2033386 .1085773 1.87 0.061 -.0094691 .4161462
|
followup | .0136721 .0043052 3.18 0.001 .005234 .0221102
_cons | -.1572054 .110741 -1.42 0.156 -.3742538 .0598429
------------------+----------------------------------------------------------------
_t |
AED_4_trattamenti |
Lacosamide | .526203 .2148662 2.45 0.014 .1050729 .947333
Perampanel | -.1240905 .1655805 -0.75 0.454 -.4486223 .2004412
|
_cons | 4.923666 .161632 30.46 0.000 4.606873 5.240459
------------------+----------------------------------------------------------------
/_t |
logs | -.1293126 .0423066 -.212232 -.0463931
-----------------------------------------------------------------------------------
Code:
gsem (EventiYN dicOutcome <- i.AED_4_trattamenti followup U1[id]@1, family(binomial) link(logit))(_t <- i.AED_4_trattamenti U1[id]@gamma, family(loglogistic, failure(_d))), pweight(ipw) nocapslatent
Thanks in advance
Cristina
Code:
input float AED_4_trattamenti byte EventiYN float(dicOutcome OutYN followup ipw) 1 0 0 1 6 1.284481 1 0 0 1 12 1.284481 1 0 0 1 12.866667 1.284481 1 0 0 1 36 1.284481 3 0 0 1 6 .8313999 3 0 1 1 12 .8313999 3 0 1 1 20.766666 .8313999 3 0 1 1 36 .8313999 3 0 0 1 6 .841961 3 0 0 1 12 .841961 3 0 0 1 21.3 .841961 3 0 0 1 36 .841961 2 0 0 1 6 3.090479 2 0 1 1 12 3.090479 2 0 1 1 14.2 3.090479 2 0 1 1 36 3.090479 3 0 0 1 6 .8506127 3 0 0 1 12 .8506127 3 0 0 1 24 .8506127 3 0 0 1 33.466667 .8506127 3 0 0 1 6 .8296934 3 0 0 1 12 .8296934 3 0 0 0 20 .8296934 3 0 0 1 6 .8333105 3 0 1 1 12 .8333105 3 0 1 1 24 .8333105 3 0 1 1 33.466667 .8333105 2 1 0 1 6 1.447543 2 1 0 1 12 1.447543 2 1 0 1 33.466667 1.447543 2 1 0 1 36 1.447543 3 0 0 1 6 .8858476 3 0 1 1 12 .8858476 3 0 1 1 24 .8858476 3 0 1 1 33.466667 .8858476 3 0 1 1 6 .905351 3 0 1 1 12 .905351 3 0 1 1 24 .905351 3 0 1 1 36 .905351 3 0 0 1 6 .8569638 3 1 1 1 12 .8569638 3 1 0 1 24 .8569638 3 1 0 1 36 .8569638 3 1 1 1 6 .999061 3 0 1 1 12 .999061 3 0 1 1 24 .999061 3 0 1 1 36 .999061 3 0 1 1 6 .8074597 3 0 1 1 12 .8074597 3 0 1 1 24 .8074597 3 0 1 1 36 .8074597 2 0 1 1 6 .6663928 2 0 1 1 12 .6663928 2 0 1 1 24 .6663928 2 0 1 1 33.466667 .6663928 2 0 1 1 6 1.1937268 2 0 1 1 12 1.1937268 2 0 1 1 24 1.1937268 2 0 1 1 36 1.1937268 2 0 1 1 6 .69568 2 0 1 1 12 .69568 2 0 1 1 24 .69568 2 0 1 1 33.266666 .69568 2 0 1 1 6 1.1056215 2 1 1 1 12 1.1056215 2 1 1 1 24 1.1056215 2 1 1 1 33.466667 1.1056215 2 0 1 1 6 .652993 2 0 1 1 12 .652993 2 0 1 1 24 .652993 2 0 1 1 36 .652993 2 0 1 1 6 .6847076 2 0 1 1 12 .6847076 2 0 1 1 24 .6847076 2 0 1 1 33.466667 .6847076 2 0 0 1 6 1.604853 2 0 0 1 12 1.604853 2 0 0 0 13 1.604853 2 1 0 1 6 .7084799 2 1 0 1 12 .7084799 2 1 0 0 13 .7084799 2 0 0 1 6 .7275482 2 0 1 1 12 .7275482 2 1 1 1 24 .7275482 2 1 1 1 36 .7275482 2 0 1 1 6 .8143203 2 0 1 1 12 .8143203 2 0 1 1 24 .8143203 2 0 1 1 33.466667 .8143203 1 0 1 1 6 .5977339 1 0 1 1 12 .5977339 1 0 1 1 24 .5977339 1 0 1 1 33.466667 .5977339 1 0 0 1 6 .5239564 1 0 0 1 12 .5239564 1 0 0 0 19 .5239564 1 0 0 1 6 .5305537 1 0 0 1 12 .5305537 1 0 0 0 16 .5305537 1 0 1 1 6 1.076907 end
