<> tag dd_include failed to find file {bf:G:/Mi unidad/Alvacast/SISTRAT 2019 (git... r(601); <> tag dd_include failed to find file {bf:G:\Mi unidad\Alvacast\SISTRAT 2019 (git... r(601); <> tag dd_include failed to find file {bf:C:\Users\CISS Fondecyt\Mi unidad\Alvaca... r(601);

Database (step 4)

Date created: 19:41:43 26 Jul 2021.

Install commands that are unavailable or out of date.

. *<< dd_do : noout > >
. clear all

. 
. cap noi which predictms
c:\ado\plus\p\predictms.ado
*! version 4.3.0 14mar2021 MJC

. if _rc==111 {
.         cap noi net install multistate, from("https://www.mjcrowther.co.uk/code/multistate") 
.         }

. cap noi which merlin
c:\ado\plus\m\merlin.ado
*! version 2.0.2 19mar2021 MJC

. if _rc==111 {
.         cap noi net install merlin, from("https://www.mjcrowther.co.uk/code/merlin/") 
.         }

. cap noi which sumat
c:\ado\plus\s\sumat.ado
*! Part of package matrixtools v. 0.28
*! Support: Niels Henrik Bruun, niels.henrik.bruun@gmail.com
*! 2021-01-03 toxl added

. if _rc==111 {
.         cap noi scc install matrixtools
.         }

. cap noi which estwrite
c:\ado\plus\e\estwrite.ado
*! version 1.2.4 04sep2009
*! version 1.0.1 15may2007 (renamed from -eststo- to -estwrite-; -append- added)
*! version 1.0.0 29apr2005 Ben Jann (ETH Zurich)

. if _rc==111 {
.         cap noi ssc install estwrite
.         }

. cap noi which winsor2
c:\ado\plus\w\winsor2.ado
*! Inspirit of -winsor-(NJ Cox) and -winsorizeJ-(J Caskey)
*! Lian Yujun, arlionn@163.com, 2013-12-25
*! 1.1 2014.12.16

. if _rc==111 {
.         cap noi ssc install winsor2
.         }       

.         

We need to obtain the file and the work folder.

. mata : st_numscalar("OK", direxists("/volumes/sdrive/data//"))

. if scalar(OK) == 1 {
.         cap noi cd "/volumes/sdrive/data//"
.         global pathdata "/volumes/sdrive/data//"
.         di "Location= ${pathdata}; Date: `c(current_date)', considering an OS `c(os)' for the user: `c(username)'"
. }

. else display "This file does not exist"
This file does not exist

. 
. mata : st_numscalar("OK", direxists("E:\Mi unidad\Alvacast\SISTRAT 2019 (github)\_WO vs MG\"))

. if scalar(OK) == 1 {
.         cap noi cd "E:\Mi unidad\Alvacast\SISTRAT 2019 (github)\"
E:\Mi unidad\Alvacast\SISTRAT 2019 (github)
.         global pathdata "E:\Mi unidad\Alvacast\SISTRAT 2019 (github)\_WO vs MG"
.         global pathdata2 "E:/Mi unidad/Alvacast/SISTRAT 2019 (github)/_WO vs MG/"
.         di "Location= ${pathdata}; Date: `c(current_date)', considering an OS `c(os)' for the user: `c(username)'"
Location= E:\Mi unidad\Alvacast\SISTRAT 2019 (github)\_WO vs MG; Date: 26 Jul 2021, considering an OS Windows for the user: andre
. }

. else display "This file does not exist"

.         
. mata : st_numscalar("OK", direxists("C:\Users\CISS Fondecyt\Mi unidad\Alvacast\SISTRAT 2019 (github)\_WO vs MG\"))

. if scalar(OK) == 1 {
.         cap noi cd "C:\Users\CISS Fondecyt\Mi unidad\Alvacast\SISTRAT 2019 (github)"
.         global pathdata "C:\Users\CISS Fondecyt\Mi unidad\Alvacast\SISTRAT 2019 (github)\_WO vs MG"
.         global pathdata2 "C:/Users/CISS Fondecyt/Mi unidad/Alvacast/SISTRAT 2019 (github)/_WO vs MG/"
.         di "Location= ${pathdata}; Date: `c(current_date)', considering an OS `c(os)' for the user: `c(username)'"
. }

. else display "This file does not exist"
This file does not exist

. 
. mata : st_numscalar("OK", direxists("C:\Users\andre\Desktop\_WO vs MG\"))

. if scalar(OK) == 1 {
.         cap noi cd "C:\Users\andre\Desktop\_WO vs MG"
.         global pathdata "C:\Users\andre\Desktop\_mult_state_ags"
.         global pathdata2 "C:/Users/andre/Desktop/_mult_state_ags/"
.         di "Location= ${pathdata}; Date: `c(current_date)', considering an OS `c(os)' for the user: `c(username)'"
. }

. else display "This file does not exist"
This file does not exist

. 
. mata : st_numscalar("OK", direxists("C:\Users\CISS Fondecyt\OneDrive\Documentos\"))

. if scalar(OK) == 1 {
.         cap noi cd "C:\Users\CISS Fondecyt\Mi unidad\Alvacast\SISTRAT 2019 (github)\"
.         global pathdata "C:\Users\CISS Fondecyt\Mi unidad\Alvacast\SISTRAT 2019 (github)\_WO vs MG"
.         global pathdata2 "C:/Users/CISS Fondecyt/Mi unidad/Alvacast/SISTRAT 2019 (github)/_WO vs MG/"
.         di "Location= ${pathdata}; Date: `c(current_date)', considering an OS `c(os)' for the user: `c(username)'"
. }

. else display "This file does not exist"
This file does not exist

. 
. mata : st_numscalar("OK", direxists("G:\Mi unidad\Alvacast\SISTRAT 2019 (github)\_WO vs MG\"))

. if scalar(OK) == 1 {
.         cap noi cd "G:\Mi unidad\Alvacast\SISTRAT 2019 (github)\"
.         global pathdata "G:\Mi unidad\Alvacast\SISTRAT 2019 (github)\_WO vs MG"
.         global pathdata2 "G:/Mi unidad/Alvacast/SISTRAT 2019 (github)/_WO vs MG/"
.         di "Location= ${pathdata}; Date: `c(current_date)', considering an OS `c(os)' for the user: `c(username)'"
. }

. else display "This file does not exist"
This file does not exist

Path data= E:\Mi unidad\Alvacast\SISTRAT 2019 (github)_WO vs MG;

Timestamp: 26 Jul 2021, considering that is a Windows OS for the username: andre

First we open the files and drop the variables that would mistakenly amplify the sample, and define labels.

The file is located and named as: E:/Mi unidad/Alvacast/SISTRAT 2019 (github)/_WO vs MG/archivo_multiestado0_ago_c.dta

=============================================================================

Parametric models of differences & ratios- At 0 days

=============================================================================

. estread "${pathdata2}parmodels_m2_ago_c.sters"

-----------------------------------------------------------------------------
        name | command      depvar       npar  title 
-------------+---------------------------------------------------------------
    m2_1_exp | merlin       no depvar      11  Fixed effects regression model
   m2_1_weib | merlin       no depvar      12  Fixed effects regression model
    m2_1_gom | merlin       no depvar      12  Fixed effects regression model
   m2_1_logl | merlin       no depvar      12  Fixed effects regression model
   m2_1_logn | merlin       no depvar      12  Fixed effects regression model
   m2_1_ggam | merlin       no depvar      13  Fixed effects regression model
    m2_1_rp2 | merlin       no depvar      13  Fixed effects regression model
    m2_1_rp3 | merlin       no depvar      14  Fixed effects regression model
    m2_1_rp4 | merlin       no depvar      15  Fixed effects regression model
    m2_1_rp5 | merlin       no depvar      16  Fixed effects regression model
    m2_1_rp6 | merlin       no depvar      17  Fixed effects regression model
    m2_1_rp7 | merlin       no depvar      18  Fixed effects regression model
    m2_1_rp8 | merlin       no depvar      19  Fixed effects regression model
    m2_1_rp9 | merlin       no depvar      20  Fixed effects regression model
   m2_1_rp10 | merlin       no depvar      21  Fixed effects regression model
    m2_2_exp | merlin       no depvar      11  Fixed effects regression model
   m2_2_weib | merlin       no depvar      12  Fixed effects regression model
    m2_2_gom | merlin       no depvar      12  Fixed effects regression model
   m2_2_logl | merlin       no depvar      12  Fixed effects regression model
   m2_2_logn | merlin       no depvar      12  Fixed effects regression model
   m2_2_ggam | merlin       no depvar      13  Fixed effects regression model
    m2_2_rp2 | merlin       no depvar      13  Fixed effects regression model
    m2_2_rp3 | merlin       no depvar      14  Fixed effects regression model
    m2_2_rp4 | merlin       no depvar      15  Fixed effects regression model
    m2_2_rp5 | merlin       no depvar      16  Fixed effects regression model
    m2_2_rp6 | merlin       no depvar      17  Fixed effects regression model
    m2_2_rp7 | merlin       no depvar      18  Fixed effects regression model
    m2_2_rp8 | merlin       no depvar      19  Fixed effects regression model
    m2_2_rp9 | merlin       no depvar      20  Fixed effects regression model
   m2_2_rp10 | merlin       no depvar      21  Fixed effects regression model
    m2_3_exp | merlin       no depvar      11  Fixed effects regression model
   m2_3_weib | merlin       no depvar      12  Fixed effects regression model
    m2_3_gom | merlin       no depvar      12  Fixed effects regression model
   m2_3_logl | merlin       no depvar      12  Fixed effects regression model
   m2_3_logn | merlin       no depvar      12  Fixed effects regression model
   m2_3_ggam | merlin       no depvar      13  Fixed effects regression model
    m2_3_rp2 | merlin       no depvar      13  Fixed effects regression model
    m2_3_rp3 | merlin       no depvar      14  Fixed effects regression model
    m2_3_rp4 | merlin       no depvar      15  Fixed effects regression model
    m2_3_rp5 | merlin       no depvar      16  Fixed effects regression model
    m2_3_rp6 | merlin       no depvar      17  Fixed effects regression model
    m2_3_rp7 | merlin       no depvar      18  Fixed effects regression model
    m2_3_rp8 | merlin       no depvar      19  Fixed effects regression model
    m2_3_rp9 | merlin       no depvar      20  Fixed effects regression model
   m2_3_rp10 | merlin       no depvar      21  Fixed effects regression model
    m2_4_exp | merlin       no depvar      12  Fixed effects regression model
   m2_4_weib | merlin       no depvar      13  Fixed effects regression model
    m2_4_gom | merlin       no depvar      13  Fixed effects regression model
   m2_4_logl | merlin       no depvar      13  Fixed effects regression model
   m2_4_logn | merlin       no depvar      13  Fixed effects regression model
   m2_4_ggam | merlin       no depvar      14  Fixed effects regression model
    m2_4_rp2 | merlin       no depvar      14  Fixed effects regression model
    m2_4_rp3 | merlin       no depvar      15  Fixed effects regression model
    m2_4_rp4 | merlin       no depvar      16  Fixed effects regression model
    m2_4_rp5 | merlin       no depvar      17  Fixed effects regression model
    m2_4_rp6 | merlin       no depvar      18  Fixed effects regression model
    m2_4_rp7 | merlin       no depvar      19  Fixed effects regression model
    m2_4_rp8 | merlin       no depvar      20  Fixed effects regression model
    m2_4_rp9 | merlin       no depvar      21  Fixed effects regression model
   m2_4_rp10 | merlin       no depvar      22  Fixed effects regression model
    m2_5_exp | merlin       no depvar      12  Fixed effects regression model
   m2_5_weib | merlin       no depvar      13  Fixed effects regression model
    m2_5_gom | merlin       no depvar      13  Fixed effects regression model
   m2_5_logl | merlin       no depvar      13  Fixed effects regression model
   m2_5_logn | merlin       no depvar      13  Fixed effects regression model
   m2_5_ggam | merlin       no depvar      14  Fixed effects regression model
    m2_5_rp2 | merlin       no depvar      14  Fixed effects regression model
    m2_5_rp3 | merlin       no depvar      15  Fixed effects regression model
    m2_5_rp4 | merlin       no depvar      16  Fixed effects regression model
    m2_5_rp5 | merlin       no depvar      17  Fixed effects regression model
    m2_5_rp6 | merlin       no depvar      18  Fixed effects regression model
    m2_5_rp7 | merlin       no depvar      19  Fixed effects regression model
    m2_5_rp8 | merlin       no depvar      20  Fixed effects regression model
    m2_5_rp9 | merlin       no depvar      21  Fixed effects regression model
   m2_5_rp10 | merlin       no depvar      22  Fixed effects regression model
-----------------------------------------------------------------------------

. predictms, transmatrix(mat_four_states) models(m2_1_ggam m2_2_ggam m2_3_ggam m2_4_logl m2_5_ggam) ///
>          timevar(timevar0) /// mint(0) maxt(1096) timevar() cannot be specified with mint()/maxt()/obs()
>          seed(2125) n(100000) prob diff ratio /// * si agrego bootstrap, at#() limit reached, or unrecognised option
>          from(1) ci reset bootstrap m(250)   /// * es una forma de hacer bootstrap 
>                 at1(tipo_de_programa_2 1 edad_al_ing_grupos 2 escolaridad_rec 2 sus_principal_mod 1 freq_cons_sus_prin 5 compromiso_biopsicosocial 2 ten
> encia_de_la_vivienda_mod 5 num_otras_sus_mod 2 numero_de_hijos_mod_rec 2 tipo_de_plan_res 2 _start 0) /// 
>                 at2(tipo_de_programa_2 2 edad_al_ing_grupos 2 escolaridad_rec 2 sus_principal_mod 1 freq_cons_sus_prin 5 compromiso_biopsicosocial 2 ten
> encia_de_la_vivienda_mod 5 num_otras_sus_mod 2 numero_de_hijos_mod_rec 2 tipo_de_plan_res 2 _start 0) 

Calculating CIs via parametric bootstrap for at1() (250)
----+--- 1 ---+--- 2 ---+--- 3 ---+--- 4 ---+--- 5 
..................................................    50
..................................................   100
..................................................   150
..................................................   200
..................................................   250

Calculating CIs via parametric bootstrap for at2() (250)
----+--- 1 ---+--- 2 ---+--- 3 ---+--- 4 ---+--- 5 
..................................................    50
..................................................   100
..................................................   150
..................................................   200
..................................................   250

.                                  
. drop _prob_at1_1_*_lci _prob_at1_1_*_uci _prob_at2_1_*_lci _prob_at2_1_*_uci

. drop _prob_at1_1_* _prob_at2_1_* 

. rename (_ratio_prob_at2_1_*_lci) (fratio_from1_*_lci_0)

. rename (_ratio_prob_at2_1_*_uci) (fratio_from1_*_uci_0)

. rename (_ratio_prob_at2_1_*) (fratio_from1_*_0)

. rename (_diff_prob_at2_1_*_lci) (fdiff_prob_from1_*_lci_0)

. rename (_diff_prob_at2_1_*_uci) (fdiff_prob_from1_*_uci_0)

. rename (_diff_prob_at2_1_*) (fdiff_prob_from1_*_0)  

. 

=============================================================================

(RP) Parametric models of differences & ratios

=============================================================================

. estread "${pathdata2}parmodels_m2_ago_c.sters"

-----------------------------------------------------------------------------
        name | command      depvar       npar  title 
-------------+---------------------------------------------------------------
    m2_1_exp | merlin       no depvar      11  Fixed effects regression model
   m2_1_weib | merlin       no depvar      12  Fixed effects regression model
    m2_1_gom | merlin       no depvar      12  Fixed effects regression model
   m2_1_logl | merlin       no depvar      12  Fixed effects regression model
   m2_1_logn | merlin       no depvar      12  Fixed effects regression model
   m2_1_ggam | merlin       no depvar      13  Fixed effects regression model
    m2_1_rp2 | merlin       no depvar      13  Fixed effects regression model
    m2_1_rp3 | merlin       no depvar      14  Fixed effects regression model
    m2_1_rp4 | merlin       no depvar      15  Fixed effects regression model
    m2_1_rp5 | merlin       no depvar      16  Fixed effects regression model
    m2_1_rp6 | merlin       no depvar      17  Fixed effects regression model
    m2_1_rp7 | merlin       no depvar      18  Fixed effects regression model
    m2_1_rp8 | merlin       no depvar      19  Fixed effects regression model
    m2_1_rp9 | merlin       no depvar      20  Fixed effects regression model
   m2_1_rp10 | merlin       no depvar      21  Fixed effects regression model
    m2_2_exp | merlin       no depvar      11  Fixed effects regression model
   m2_2_weib | merlin       no depvar      12  Fixed effects regression model
    m2_2_gom | merlin       no depvar      12  Fixed effects regression model
   m2_2_logl | merlin       no depvar      12  Fixed effects regression model
   m2_2_logn | merlin       no depvar      12  Fixed effects regression model
   m2_2_ggam | merlin       no depvar      13  Fixed effects regression model
    m2_2_rp2 | merlin       no depvar      13  Fixed effects regression model
    m2_2_rp3 | merlin       no depvar      14  Fixed effects regression model
    m2_2_rp4 | merlin       no depvar      15  Fixed effects regression model
    m2_2_rp5 | merlin       no depvar      16  Fixed effects regression model
    m2_2_rp6 | merlin       no depvar      17  Fixed effects regression model
    m2_2_rp7 | merlin       no depvar      18  Fixed effects regression model
    m2_2_rp8 | merlin       no depvar      19  Fixed effects regression model
    m2_2_rp9 | merlin       no depvar      20  Fixed effects regression model
   m2_2_rp10 | merlin       no depvar      21  Fixed effects regression model
    m2_3_exp | merlin       no depvar      11  Fixed effects regression model
   m2_3_weib | merlin       no depvar      12  Fixed effects regression model
    m2_3_gom | merlin       no depvar      12  Fixed effects regression model
   m2_3_logl | merlin       no depvar      12  Fixed effects regression model
   m2_3_logn | merlin       no depvar      12  Fixed effects regression model
   m2_3_ggam | merlin       no depvar      13  Fixed effects regression model
    m2_3_rp2 | merlin       no depvar      13  Fixed effects regression model
    m2_3_rp3 | merlin       no depvar      14  Fixed effects regression model
    m2_3_rp4 | merlin       no depvar      15  Fixed effects regression model
    m2_3_rp5 | merlin       no depvar      16  Fixed effects regression model
    m2_3_rp6 | merlin       no depvar      17  Fixed effects regression model
    m2_3_rp7 | merlin       no depvar      18  Fixed effects regression model
    m2_3_rp8 | merlin       no depvar      19  Fixed effects regression model
    m2_3_rp9 | merlin       no depvar      20  Fixed effects regression model
   m2_3_rp10 | merlin       no depvar      21  Fixed effects regression model
    m2_4_exp | merlin       no depvar      12  Fixed effects regression model
   m2_4_weib | merlin       no depvar      13  Fixed effects regression model
    m2_4_gom | merlin       no depvar      13  Fixed effects regression model
   m2_4_logl | merlin       no depvar      13  Fixed effects regression model
   m2_4_logn | merlin       no depvar      13  Fixed effects regression model
   m2_4_ggam | merlin       no depvar      14  Fixed effects regression model
    m2_4_rp2 | merlin       no depvar      14  Fixed effects regression model
    m2_4_rp3 | merlin       no depvar      15  Fixed effects regression model
    m2_4_rp4 | merlin       no depvar      16  Fixed effects regression model
    m2_4_rp5 | merlin       no depvar      17  Fixed effects regression model
    m2_4_rp6 | merlin       no depvar      18  Fixed effects regression model
    m2_4_rp7 | merlin       no depvar      19  Fixed effects regression model
    m2_4_rp8 | merlin       no depvar      20  Fixed effects regression model
    m2_4_rp9 | merlin       no depvar      21  Fixed effects regression model
   m2_4_rp10 | merlin       no depvar      22  Fixed effects regression model
    m2_5_exp | merlin       no depvar      12  Fixed effects regression model
   m2_5_weib | merlin       no depvar      13  Fixed effects regression model
    m2_5_gom | merlin       no depvar      13  Fixed effects regression model
   m2_5_logl | merlin       no depvar      13  Fixed effects regression model
   m2_5_logn | merlin       no depvar      13  Fixed effects regression model
   m2_5_ggam | merlin       no depvar      14  Fixed effects regression model
    m2_5_rp2 | merlin       no depvar      14  Fixed effects regression model
    m2_5_rp3 | merlin       no depvar      15  Fixed effects regression model
    m2_5_rp4 | merlin       no depvar      16  Fixed effects regression model
    m2_5_rp5 | merlin       no depvar      17  Fixed effects regression model
    m2_5_rp6 | merlin       no depvar      18  Fixed effects regression model
    m2_5_rp7 | merlin       no depvar      19  Fixed effects regression model
    m2_5_rp8 | merlin       no depvar      20  Fixed effects regression model
    m2_5_rp9 | merlin       no depvar      21  Fixed effects regression model
   m2_5_rp10 | merlin       no depvar      22  Fixed effects regression model
-----------------------------------------------------------------------------

. predictms, transmatrix(mat_four_states) models(m2_1_rp6 m2_2_rp5 m2_3_rp4 m2_4_rp7 m2_5_rp3) ///
>          timevar(timevar0) /// mint(0) maxt(1096) timevar() cannot be specified with mint()/maxt()/obs()
>          seed(2125) n(100000) prob diff ratio /// * si agrego bootstrap, at#() limit reached, or unrecognised option
>          from(1) reset    /// * es una forma de hacer bootstrap bootstrap m(10) ci
>                 at1(tipo_de_programa_2 1 edad_al_ing_grupos 2 escolaridad_rec 2 sus_principal_mod 1 freq_cons_sus_prin 5 compromiso_biopsicosocial 2 ten
> encia_de_la_vivienda_mod 5 num_otras_sus_mod 2 numero_de_hijos_mod_rec 2 tipo_de_plan_res 2 _start 0) /// 
>                 at2(tipo_de_programa_2 2 edad_al_ing_grupos 2 escolaridad_rec 2 sus_principal_mod 1 freq_cons_sus_prin 5 compromiso_biopsicosocial 2 ten
> encia_de_la_vivienda_mod 5 num_otras_sus_mod 2 numero_de_hijos_mod_rec 2 tipo_de_plan_res 2 _start 0) 

.                                  
. cap drop _prob_at1_1_*_lci _prob_at1_1_*_uci _prob_at2_1_*_lci _prob_at2_1_*_uci

. cap drop _prob_at1_1_* _prob_at2_1_* 

. cap rename (_ratio_prob_at2_1_*_lci) (fratio_from1_*_lci_rp_0)

. cap rename (_ratio_prob_at2_1_*_uci) (fratio_from1_*_uci_rp_0)

. cap rename (_ratio_prob_at2_1_*) (fratio_from1_*_rp_0)

. cap rename (_diff_prob_at2_1_*_lci) (fdiff_prob_from1_*_lci_rp_0)

. cap rename (_diff_prob_at2_1_*_uci) (fdiff_prob_from1_*_uci_rp_0)

. cap rename (_diff_prob_at2_1_*) (fdiff_prob_from1_*_rp_0)  

. 

=============================================================================

Figures of Differences

=============================================================================

. *Assessing and relaxing the Markov assumption in the illness-death model
. *Jonathan Broomfield1, Caroline E. Weibull2, and Michael J. Crowther
. *fratio_from1_2_lci_0)(fratio_from1_2_uci_0)(fratio_from1_2_0)(fdiff_prob_from1_2_lci_0)(fdiff_prob_from1_2_uci_0)(fdiff_prob_from1_2_0)  
. tw      (rarea fdiff_prob_from1_2_lci_0 fdiff_prob_from1_2_uci_0 timevar01, sort connect(stairstep stairstep) lcolor(gs8) color(gs8%65)) ///
>         (line fdiff_prob_from1_2_0 timevar01, sort connect(stairstep stairstep) lcolor(black)), ///
>         yline(0, lcolor(navy)) ///
>  xtitle(Time (years)) ytitle(Difference in Probabilities) xlab(0(.3)5,labsize(small)) ylab(-.25(.05).25, /// *730
>  angle(h) format(%4.2f)) legend(order(1 "CI95%" 2 "Difference") pos(11) ring(0) c(1)) ///
>  title("Difference in Probabilities") name(diff_mod12, replace) ///
>  subtitle("from Admission to Treatment Completion (250 bs)")  /// * text(0.2 4 "Outpatient", size(small)) /// * text(0.29 4 "Residential", size(small)) 
> ///
>  graphregion(col(white)) 

. *graph export prob_trans_12.gph, replace

. tw      (rarea fdiff_prob_from1_3_lci_0 fdiff_prob_from1_3_uci_0 timevar01, sort connect(stairstep stairstep) lcolor(gs8) color(gs8%65)) ///
>         (line fdiff_prob_from1_3_0 timevar01, sort connect(stairstep stairstep) lcolor(black)), ///
>         yline(0, lcolor(navy)) ///
>  xtitle(Time (years)) ytitle(Difference in Probabilities) xlab(0(.3)5,labsize(small)) ylab(-.25(.05).25, /// *730
>  angle(h) format(%4.2f)) legend(order(1 "CI95%" 2 "Difference") pos(11) ring(0) c(1)) ///
>  title("Difference in Probabilities") name(diff_mod13, replace) ///
>  subtitle("from Admission to Discharge w/o Completion (250 bs)")  /// * text(0.2 4 "Outpatient", size(small)) /// * text(0.29 4 "Residential", size(smal
> l)) ///
>  graphregion(col(white)) 

. *graph export prob_trans_23.gph, replace

. tw      (rarea fdiff_prob_from1_4_lci_0 fdiff_prob_from1_4_uci_0 timevar01, sort connect(stairstep stairstep) lcolor(gs8) color(gs8%65)) ///
>         (line fdiff_prob_from1_4_0 timevar01, sort connect(stairstep stairstep) lcolor(black)), ///
>         yline(0, lcolor(navy)) ///
>  xtitle(Time (years)) ytitle(Difference in Probabilities) xlab(0(.3)5,labsize(small)) ylab(-.25(.05).25, /// *730
>  angle(h) format(%4.2f)) legend(order(1 "CI95%" 2 "Difference") pos(11) ring(0) c(1)) ///
>  title("Difference in Probabilities") name(diff_mod14, replace) ///
>  subtitle("from Admission to Readmission (250 bs)")  /// * text(0.2 4 "Outpatient", size(small)) /// * text(0.29 4 "Residential", size(small)) ///
>  graphregion(col(white)) 

. *graph export prob_trans_34.gph, replace

. tw      (rarea fdiff_prob_from2_4_lci_0 fdiff_prob_from2_4_uci_0 timevar01, sort connect(stairstep stairstep) lcolor(gs8) color(gs8%65)) ///
>         (line fdiff_prob_from2_4_0 timevar01, sort connect(stairstep stairstep) lcolor(black)), ///
>         yline(0, lcolor(navy)) ///
>  xtitle(Time (years)) ytitle(Difference in Probabilities) xlab(0(.3)5,labsize(small)) ylab(-.25(.05).25, /// *730
>  angle(h) format(%4.2f)) legend(order(1 "CI95%" 2 "Difference") pos(11) ring(0) c(1)) ///
>  title("Difference in Probabilities") name(diff_mod24, replace) ///
>  subtitle("from Treatment Completion to Readmission")  /// * text(0.2 4 "Outpatient", size(small)) /// * text(0.29 4 "Residential", size(small)) ///
>  graphregion(col(white))

. *graph export prob_trans_45.gph, replace

. tw      (rarea fdiff_prob_from3_4_lci_0 fdiff_prob_from3_4_uci_0 timevar01, sort connect(stairstep stairstep) lcolor(gs8) color(gs8%65)) ///
>         (line fdiff_prob_from3_4_0 timevar01, sort connect(stairstep stairstep) lcolor(black)), ///
>         yline(0, lcolor(navy)) ///
>  xtitle(Time (years)) ytitle(Difference in Probabilities) xlab(0(.3)5,labsize(small)) ylab(-.25(.05).25, /// *730
>  angle(h) format(%4.2f)) legend(order(1 "CI95%" 2 "Difference") pos(11) ring(0) c(1)) ///
>  title("Difference in Probabilities") name(diff_mod34, replace) ///
>  subtitle("from Discharge w/o Completion to Readmission")  /// * text(0.2 4 "Outpatient", size(small)) /// * text(0.29 4 "Residential", size(small)) ///
>  graphregion(col(white))

. *graph export prob_trans_45.gph, replace

=============================================================================

Figures of Differences (RP)

=============================================================================

. * fdiff_prob_from3_4_lci_rp_0 fratio_from3_4_rp_0
. *Assessing and relaxing the Markov assumption in the illness-death model
. *Jonathan Broomfield1, Caroline E. Weibull2, and Michael J. Crowther
. *fratio_from1_2_lci_0)(fratio_from1_2_uci_0)(fratio_from1_2_0)(fdiff_prob_from1_2_lci_0)(fdiff_prob_from1_2_uci_0)(fdiff_prob_from1_2_0)  
. tw      (line fdiff_prob_from1_2_rp_0 timevar01, sort connect(stairstep stairstep) lcolor(black)), ///
>         yline(0, lcolor(navy)) ///
>  xtitle(Time (years)) ytitle(Difference in Probabilities) xlab(0(.3)5,labsize(small)) ylab(-.25(.05).25, /// *730
>  angle(h) format(%4.2f)) legend(order(1 "CI95%" 2 "Difference") pos(11) ring(0) c(1)) ///
>  title("Difference in Probabilities") name(diff_mod12_rp, replace) ///
>  subtitle("from Admission to Treatment Completion (0 bs) (RP)")  /// * text(0.2 4 "Outpatient", size(small)) /// * text(0.29 4 "Residential", size(small
> )) ///
>  graphregion(col(white)) 

. *graph export prob_trans_12.gph, replace

. tw      (line fdiff_prob_from1_3_rp_0 timevar01, sort connect(stairstep stairstep) lcolor(black)), ///
>         yline(0, lcolor(navy)) ///
>  xtitle(Time (years)) ytitle(Difference in Probabilities) xlab(0(.3)5,labsize(small)) ylab(-.25(.05).25, /// *730
>  angle(h) format(%4.2f)) legend(order(1 "CI95%" 2 "Difference") pos(11) ring(0) c(1)) ///
>  title("Difference in Probabilities") name(diff_mod13_rp, replace) ///
>  subtitle("from Admission to Discharge w/o Completion (0 bs) (RP)")  /// * text(0.2 4 "Outpatient", size(small)) /// * text(0.29 4 "Residential", size(s
> mall)) ///
>  graphregion(col(white)) 

. *graph export prob_trans_23.gph, replace

. tw      (line fdiff_prob_from1_4_rp_0 timevar01, sort connect(stairstep stairstep) lcolor(black)), ///
>         yline(0, lcolor(navy)) ///
>  xtitle(Time (years)) ytitle(Difference in Probabilities) xlab(0(.3)5,labsize(small)) ylab(-.25(.05).25, /// *730
>  angle(h) format(%4.2f)) legend(order(1 "CI95%" 2 "Difference") pos(11) ring(0) c(1)) ///
>  title("Difference in Probabilities") name(diff_mod14_rp, replace) ///
>  subtitle("from Admission to Readmission (0 bs) (RP)")  /// * text(0.2 4 "Outpatient", size(small)) /// * text(0.29 4 "Residential", size(small)) ///
>  graphregion(col(white)) 

. *graph export prob_trans_34.gph, replace

. tw      (rarea fdiff_prob_from2_4_lci_rp_0 fdiff_prob_from2_4_uci_rp_0 timevar01, sort connect(stairstep stairstep) lcolor(gs8) color(gs8%65)) ///
>         (line fdiff_prob_from2_4_rp_0 timevar01, sort connect(stairstep stairstep) lcolor(black)), ///
>         yline(0, lcolor(navy)) ///
>  xtitle(Time (years)) ytitle(Difference in Probabilities) xlab(0(.3)5,labsize(small)) ylab(-.25(.05).25, /// *730
>  angle(h) format(%4.2f)) legend(order(1 "CI95%" 2 "Difference") pos(11) ring(0) c(1)) ///
>  title("Difference in Probabilities") name(diff_mod24_rp, replace) ///
>  subtitle("from Treatment Completion to Readmission (RP)")  /// * text(0.2 4 "Outpatient", size(small)) /// * text(0.29 4 "Residential", size(small)) //
> /
>  graphregion(col(white))

. *graph export prob_trans_45.gph, replace

. tw      (rarea fdiff_prob_from3_4_lci_rp_0 fdiff_prob_from3_4_uci_rp_0 timevar01, sort connect(stairstep stairstep) lcolor(gs8) color(gs8%65)) ///
>         (line fdiff_prob_from3_4_rp_0 timevar01, sort connect(stairstep stairstep) lcolor(black)), ///
>         yline(0, lcolor(navy)) ///
>  xtitle(Time (years)) ytitle(Difference in Probabilities) xlab(0(.3)5,labsize(small)) ylab(-.25(.05).25,  /// *730
>  angle(h) format(%4.2f)) legend(order(1 "CI95%" 2 "Difference") pos(11) ring(0) c(1)) ///
>  title("Difference in Probabilities") name(diff_mod34_rp, replace) ///
>  subtitle("from Discharge w/o Completion to Readmission (RP)")  /// * text(0.2 4 "Outpatient", size(small)) /// * text(0.29 4 "Residential", size(small)
> ) ///
>  graphregion(col(white))

. *graph export prob_trans_45.gph, replace

=============================================================================

Figures of Ratios

=============================================================================

. tw      (rarea fratio_from1_2_lci_0 fratio_from1_2_uci_0 timevar01, sort connect(stairstep stairstep) lcolor(gs8) color(gs8%65)) ///
>         (line fratio_from1_2_0 timevar01, sort connect(stairstep stairstep) lcolor(black)), ///
>         yline(1, lcolor(navy)) ///
>  xtitle(Time (years)) ytitle(Ratio in Probabilities) xlab(0(.3)5,labsize(small)) ylab(0(.5)2, /// *730
>  angle(h) format(%4.2f)) legend(order(1 "CI95%" 2 "Difference") pos(11) ring(0) c(1)) ///
>  title("Ratio in Probabilities") name(ratio_models12, replace) ///
>  subtitle("from Admission to Treatment Completion")  /// * text(0.2 4 "Outpatient", size(small)) /// * text(0.29 4 "Residential", size(small)) ///
>  graphregion(col(white))  

. tw      (rarea fratio_from1_3_lci_0 fratio_from1_3_uci_0 timevar01, sort connect(stairstep stairstep) lcolor(gs8) color(gs8%65)) ///
>         (line fratio_from1_3_0 timevar01, sort connect(stairstep stairstep) lcolor(black)), ///
>         yline(1, lcolor(navy)) ///
>  xtitle(Time (years)) ytitle(Ratio in Probabilities) xlab(0(.3)5,labsize(small)) ylab(0(.5)2, /// *730
>  angle(h) format(%4.2f)) legend(order(1 "CI95%" 2 "Difference") pos(11) ring(0) c(1)) ///
>  title("Ratio in Probabilities") name(ratio_models13, replace) ///
>  subtitle("from Admission to Discharge w/o Completion")  /// * text(0.2 4 "Outpatient", size(small)) /// * text(0.29 4 "Residential", size(small)) ///
>  graphregion(col(white))  

. tw      (rarea fratio_from1_4_lci_0 fratio_from1_4_uci_0 timevar01, sort connect(stairstep stairstep) lcolor(gs8) color(gs8%65)) ///
>         (line fratio_from1_4_0 timevar01, sort connect(stairstep stairstep) lcolor(black)), ///
>         yline(1, lcolor(navy)) ///
>  xtitle(Time (years)) ytitle(Ratio in Probabilities) xlab(0(.3)5,labsize(small)) ylab(0(.5)2, /// *730
>  angle(h) format(%4.2f)) legend(order(1 "CI95%" 2 "Difference") pos(11) ring(0) c(1)) ///
>  title("Ratio in Probabilities") name(ratio_models14, replace) ///
>  subtitle("from Admission to Readmission")  /// * text(0.2 4 "Outpatient", size(small)) /// * text(0.29 4 "Residential", size(small)) ///
>  graphregion(col(white))  

. tw      (rarea fratio_from2_4_lci_0 fratio_from2_4_uci_0 timevar01, sort connect(stairstep stairstep) lcolor(gs8) color(gs8%65)) ///
>         (line fratio_from2_4_0 timevar01, sort connect(stairstep stairstep) lcolor(black)), ///
>         yline(1, lcolor(navy)) ///
>  xtitle(Time (years)) ytitle(Ratio in Probabilities) xlab(0(.3)5,labsize(small)) ylab(0(.5)2, /// *730
>  angle(h) format(%4.2f)) legend(order(1 "CI95%" 2 "Difference") pos(11) ring(0) c(1)) ///
>  title("Ratio in Probabilities") name(ratio_models24, replace) ///
>  subtitle("from Treatment Completion to Readmission")  /// * text(0.2 4 "Outpatient", size(small)) /// * text(0.29 4 "Residential", size(small)) ///
>  graphregion(col(white))  

. tw      (rarea fratio_from3_4_lci_0 fratio_from3_4_uci_0 timevar01, sort connect(stairstep stairstep) lcolor(gs8) color(gs8%65)) ///
>         (line fratio_from3_4_0 timevar01, sort connect(stairstep stairstep) lcolor(black)), ///
>         yline(1, lcolor(navy)) ///
>  xtitle(Time (years)) ytitle(Ratio in Probabilities) xlab(0(.3)5,labsize(small)) ylab(0(.5)2, /// *730
>  angle(h) format(%4.2f)) legend(order(1 "CI95%" 2 "Difference") pos(11) ring(0) c(1)) ///
>  title("Ratio in Probabilities") name(ratio_models34, replace) ///
>  subtitle("from Discharge w/o Completion to Readmission")  /// * text(0.2 4 "Outpatient", size(small)) /// * text(0.29 4 "Residential", size(small)) ///
>  graphregion(col(white))  

=============================================================================

Figures of Ratios (RP)

=============================================================================

. tw      (line fratio_from1_2_rp_0 timevar01, sort connect(stairstep stairstep) lcolor(black)), ///
>         yline(1, lcolor(navy)) ///
>  xtitle(Time (years)) ytitle(Ratio in Probabilities) xlab(0(.3)5,labsize(small)) ylab(0(.5)2, /// *730
>  angle(h) format(%4.2f)) legend(order(1 "CI95%" 2 "Difference") pos(11) ring(0) c(1)) ///
>  title("Ratio in Probabilities") name(ratio_models12rp, replace) ///
>  subtitle("from Admission to Treatment Completion (0bs) (RP)")  /// * text(0.2 4 "Outpatient", size(small)) /// * text(0.29 4 "Residential", size(small)
> ) ///
>  graphregion(col(white))  

. tw      (line fratio_from1_3_rp_0 timevar01, sort connect(stairstep stairstep) lcolor(black)), ///
>         yline(1, lcolor(navy)) ///
>  xtitle(Time (years)) ytitle(Ratio in Probabilities) xlab(0(.3)5,labsize(small)) ylab(0(.5)2, /// *730
>  angle(h) format(%4.2f)) legend(order(1 "CI95%" 2 "Difference") pos(11) ring(0) c(1)) ///
>  title("Ratio in Probabilities") name(ratio_models13rp, replace) ///
>  subtitle("from Admission to Discharge w/o Completion (0bs) (RP)")  /// * text(0.2 4 "Outpatient", size(small)) /// * text(0.29 4 "Residential", size(sm
> all)) ///
>  graphregion(col(white))  

. tw      (line fratio_from1_4_rp_0 timevar01, sort connect(stairstep stairstep) lcolor(black)), ///
>         yline(1, lcolor(navy)) ///
>  xtitle(Time (years)) ytitle(Ratio in Probabilities) xlab(0(.3)5,labsize(small)) ylab(0(.5)2, /// *730
>  angle(h) format(%4.2f)) legend(order(1 "CI95%" 2 "Difference") pos(11) ring(0) c(1)) ///
>  title("Ratio in Probabilities") name(ratio_models14rp, replace) ///
>  subtitle("from Admission to Readmission (0bs) (RP)")  /// * text(0.2 4 "Outpatient", size(small)) /// * text(0.29 4 "Residential", size(small)) ///
>  graphregion(col(white))  

. tw      (rarea fratio_from2_4_lci_rp_0 fratio_from2_4_uci_rp_0 timevar01, sort connect(stairstep stairstep) lcolor(gs8) color(gs8%65)) ///
>         (line fratio_from2_4_rp_0 timevar01, sort connect(stairstep stairstep) lcolor(black)), ///
>         yline(1, lcolor(navy)) ///
>  xtitle(Time (years)) ytitle(Ratio in Probabilities) xlab(0(.3)5,labsize(small)) ylab(0(.5)2, /// *730
>  angle(h) format(%4.2f)) legend(order(1 "CI95%" 2 "Difference") pos(11) ring(0) c(1)) ///
>  title("Ratio in Probabilities") name(ratio_models24rp, replace) ///
>  subtitle("from Treatment Completion to Readmission (RP)")  /// * text(0.2 4 "Outpatient", size(small)) /// * text(0.29 4 "Residential", size(small)) //
> /
>  graphregion(col(white))  

. tw      (rarea fratio_from3_4_lci_rp_0 fratio_from3_4_uci_rp_0 timevar01, sort connect(stairstep stairstep) lcolor(gs8) color(gs8%65)) ///
>         (line fratio_from3_4_rp_0 timevar01, sort connect(stairstep stairstep) lcolor(black)), ///
>         yline(1, lcolor(navy)) ///
>  xtitle(Time (years)) ytitle(Ratio in Probabilities) xlab(0(.3)5,labsize(small)) ylab(0(.5)2, /// *730
>  angle(h) format(%4.2f)) legend(order(1 "CI95%" 2 "Difference") pos(11) ring(0) c(1)) ///
>  title("Ratio in Probabilities") name(ratio_models34rp, replace) ///
>  subtitle("from Discharge w/o Completion to Readmission (RP)")  /// * text(0.2 4 "Outpatient", size(small)) /// * text(0.29 4 "Residential", size(small)
> ) ///
>  graphregion(col(white))  

=============================================================================

Saved at= 20:22:46 26 Jul 2021