I'm trying to fit a split population survival model using CUREGR to estimate the proportion of drug traffickers who commit no further offence. When I go to check the residuals, however, I get the following message: 'varlist not allowed.' The code I'm trying to run and output I get appears below:
stset reoff1xfreetime, failure(reoff1xflag==1) scale(1)
cureregr i.agegroup sex i.disadvantage if contactrank==1, dist(lognormal) class(mixture) link(linear) scale(i.agegroup sex i.disadvantage)
estat ic
predict double cs, csnell
stset cs, failure(reoff1xflag)
sts generate km=s
generate double H=-ln(km)
line H cs cs, sort
. do "C:\Users\dwath\AppData\Local\Temp\STD1520_000000. tmp"
. stset reoff1xfreetime, failure(reoff1xflag==1) scale(1)
failure event: reoff1xflag == 1
obs. time interval: (0, reoff1xfreetime]
exit on or before: failure
487,695 total observations
23,998 observations end on or before enter()
463,697 observations remaining, representing
298,284 failures in single-record/single-failure data
455749164 total analysis time at risk and under observation
at risk from t = 0
earliest observed entry t = 0
last observed exit t = 10,831
. cureregr i.agegroup sex i.disadvantage if contactrank==1, dist(lognormal) class(mixture) link(linear) scale(i.agegroup sex i.disadvantage)
failure _d: reoff1xflag == 1
analysis time _t: reoff1xfreetime
cf: linear, kn: lognormal, model: mixture
cf_initial_coef: 0.3506 pi: 0.3506
Fitting constant-only model:
Iteration 0: log likelihood = -828933.25 (not concave)
Iteration 1: log likelihood = -277200.84
Iteration 2: log likelihood = -269109.38
Iteration 3: log likelihood = -266528.91
Iteration 4: log likelihood = -266363.71
Iteration 5: log likelihood = -266360.44
Iteration 6: log likelihood = -266360.44
Fitting full model:
Iteration 0: log likelihood = -266360.44 (not concave)
Iteration 1: log likelihood = -265145.47
Iteration 2: log likelihood = -264766.41
Iteration 3: log likelihood = -264620.63
Iteration 4: log likelihood = -264616.74
Iteration 5: log likelihood = -264616.73
No. of subjects = 60919 Number of obs = 60,919
LR chi2(18) = 3487.41
Log likelihood = -264616.73 Prob > chi2 = 0.0000
Coef. Std. Err. z P>z [95% Conf. Interval]
cure_frac
agegroup
20- .0978393 .01061 9.22 0.000 .0770442 .1186345
25- .1417434 .0111299 12.74 0.000 .1199291 .1635577
30- .1664177 .0094989 17.52 0.000 .1478002 .1850353
40- .2424493 .0114263 21.22 0.000 .2200541 .2648444
50- .4224677 .0167158 25.27 0.000 .3897054 .45523
sex -.1218376 .0090675 -13.44 0.000 -.1396096 -.1040656
disadvantage
advantaged -.0394597 .0124852 -3.16 0.002 -.0639302 -.0149892
disadvantaged -.0385665 .012088 -3.19 0.001 -.0622585 -.0148745
highly disadvantaged -.0793836 .0118008 -6.73 0.000 -.1025128 -.0562545
_cons .3399919 .0211807 16.05 0.000 .2984785 .3815054
scale
agegroup
20- -.4246738 .0476752 -8.91 0.000 -.5181154 -.3312321
25- -.4220895 .0502865 -8.39 0.000 -.5206493 -.3235298
30- -.4657804 .0445832 -10.45 0.000 -.5531618 -.3783989
40- -.6488177 .0526931 -12.31 0.000 -.7520942 -.5455412
50- -1.093875 .0808464 -13.53 0.000 -1.252331 -.9354194
sex -.0100778 .0424117 -0.24 0.812 -.0932033 .0730477
disadvantage
advantaged .2256552 .0543107 4.15 0.000 .1192083 .3321022
disadvantaged .1756349 .0527449 3.33 0.001 .0722568 .2790129
highly disadvantaged .2866025 .0513186 5.58 0.000 .1860198 .3871851
_cons -6.705231 .0989532 -67.76 0.000 -6.899176 -6.511286
shape
_cons -.7465485 .0069688 -107.13 0.000 -.7602071 -.73289
. estat ic
Akaike's information criterion and Bayesian information criterion
Model N ll(null) ll(model) df AIC BIC
. 60,919 -266360.4 -264616.7 21 529275.5 529464.8
Note: BIC uses N = number of observations. See [R] BIC note.
. predict double cs, csnell
varlist not allowed
r(101);
end of do-file
r(101);
.
stset reoff1xfreetime, failure(reoff1xflag==1) scale(1)
cureregr i.agegroup sex i.disadvantage if contactrank==1, dist(lognormal) class(mixture) link(linear) scale(i.agegroup sex i.disadvantage)
estat ic
predict double cs, csnell
stset cs, failure(reoff1xflag)
sts generate km=s
generate double H=-ln(km)
line H cs cs, sort
. do "C:\Users\dwath\AppData\Local\Temp\STD1520_000000. tmp"
. stset reoff1xfreetime, failure(reoff1xflag==1) scale(1)
failure event: reoff1xflag == 1
obs. time interval: (0, reoff1xfreetime]
exit on or before: failure
487,695 total observations
23,998 observations end on or before enter()
463,697 observations remaining, representing
298,284 failures in single-record/single-failure data
455749164 total analysis time at risk and under observation
at risk from t = 0
earliest observed entry t = 0
last observed exit t = 10,831
. cureregr i.agegroup sex i.disadvantage if contactrank==1, dist(lognormal) class(mixture) link(linear) scale(i.agegroup sex i.disadvantage)
failure _d: reoff1xflag == 1
analysis time _t: reoff1xfreetime
cf: linear, kn: lognormal, model: mixture
cf_initial_coef: 0.3506 pi: 0.3506
Fitting constant-only model:
Iteration 0: log likelihood = -828933.25 (not concave)
Iteration 1: log likelihood = -277200.84
Iteration 2: log likelihood = -269109.38
Iteration 3: log likelihood = -266528.91
Iteration 4: log likelihood = -266363.71
Iteration 5: log likelihood = -266360.44
Iteration 6: log likelihood = -266360.44
Fitting full model:
Iteration 0: log likelihood = -266360.44 (not concave)
Iteration 1: log likelihood = -265145.47
Iteration 2: log likelihood = -264766.41
Iteration 3: log likelihood = -264620.63
Iteration 4: log likelihood = -264616.74
Iteration 5: log likelihood = -264616.73
No. of subjects = 60919 Number of obs = 60,919
LR chi2(18) = 3487.41
Log likelihood = -264616.73 Prob > chi2 = 0.0000
Coef. Std. Err. z P>z [95% Conf. Interval]
cure_frac
agegroup
20- .0978393 .01061 9.22 0.000 .0770442 .1186345
25- .1417434 .0111299 12.74 0.000 .1199291 .1635577
30- .1664177 .0094989 17.52 0.000 .1478002 .1850353
40- .2424493 .0114263 21.22 0.000 .2200541 .2648444
50- .4224677 .0167158 25.27 0.000 .3897054 .45523
sex -.1218376 .0090675 -13.44 0.000 -.1396096 -.1040656
disadvantage
advantaged -.0394597 .0124852 -3.16 0.002 -.0639302 -.0149892
disadvantaged -.0385665 .012088 -3.19 0.001 -.0622585 -.0148745
highly disadvantaged -.0793836 .0118008 -6.73 0.000 -.1025128 -.0562545
_cons .3399919 .0211807 16.05 0.000 .2984785 .3815054
scale
agegroup
20- -.4246738 .0476752 -8.91 0.000 -.5181154 -.3312321
25- -.4220895 .0502865 -8.39 0.000 -.5206493 -.3235298
30- -.4657804 .0445832 -10.45 0.000 -.5531618 -.3783989
40- -.6488177 .0526931 -12.31 0.000 -.7520942 -.5455412
50- -1.093875 .0808464 -13.53 0.000 -1.252331 -.9354194
sex -.0100778 .0424117 -0.24 0.812 -.0932033 .0730477
disadvantage
advantaged .2256552 .0543107 4.15 0.000 .1192083 .3321022
disadvantaged .1756349 .0527449 3.33 0.001 .0722568 .2790129
highly disadvantaged .2866025 .0513186 5.58 0.000 .1860198 .3871851
_cons -6.705231 .0989532 -67.76 0.000 -6.899176 -6.511286
shape
_cons -.7465485 .0069688 -107.13 0.000 -.7602071 -.73289
. estat ic
Akaike's information criterion and Bayesian information criterion
Model N ll(null) ll(model) df AIC BIC
. 60,919 -266360.4 -264616.7 21 529275.5 529464.8
Note: BIC uses N = number of observations. See [R] BIC note.
. predict double cs, csnell
varlist not allowed
r(101);
end of do-file
r(101);
.
Comment