{smcl} {* *! version 1.0.1 14Oct2011}{...} {hline} {cmd:help stjmgraph} {right:also see: {help stjm}, {help stjm postestimation}} {hline} {title:Title} {p2colset 5 18 20 2}{...} {p2col :{cmd:stjmgraph} {hline 2}}Joint longitudinal and survival graph{p_end} {p2colreset}{...} {title:Syntax} {phang2} {cmd: stjmgraph} {it:long_depvar} {ifin} [{cmd:,} {it:options}] {marker options}{...} {synoptset 29 tabbed}{...} {synopthdr} {synoptline} {synopt:{opt p:anel(varname)}}panel identification variable{p_end} {synopt:{opt censg:raphopts(string)}}options to pass to the twoway plot for censored observations{p_end} {synopt:{opt eventg:raphopts(string)}}options to pass to the twoway plot for observations with the event{p_end} {synopt:{opt combine:opts(string)}}options to pass to the final graph combine{p_end} {synopt:{opt draw}}displays all graphs used to create the final combined graph{p_end} {synoptline} {p2colreset}{...} {title:Description} {pstd} {cmd:stjmgraph} creates a longitudinal trajectory plot, whereby the timescale is adjusted by taking away each patient's event/censoring time. This form of graph can be useful to display joint longitudinal and survival data, giving an indication of any association between the two processes. A separate plot is created for patients who were censored and for patients who experienced the event of interest. They are then combined using {cmd:graph combine}.{p_end} {pstd} The dataset must be {cmd:stset} correctly into enter and exit times, using the enter option; see {manhelp stset ST}. {cmd:stjmgraph} uses {cmd:_t0} to denote measurement times. For example, below we have 3 patients with 2, 5 and 3 measurements each, respectively.{p_end} {hline 33} id _t0 _t _d long_resp {hline 33} 1 0 0.2 0 0.93 1 0.2 0.7 0 1.32 2 0 0.5 0 1.15 2 0.5 1.2 0 1.67 2 1.2 1.6 0 1.92 2 1.6 1.9 0 2.65 2 1.9 2.6 1 3.15 3 0 2 0 0.25 3 2 2.3 0 0.21 3 2.3 2.4 1 0.31 {hline 33} {pstd}See {help stjm} for more details.{p_end} {title:Options} {phang} {opt panel(varname)} defines the panel identification variable. {phang} {opt censgraphopts(string)} pass options to the twoway graph of censored observations. See {help twoway_options}. {phang} {opt eventgraphopts(string)} pass options to the twoway graph of observations who experienced the event of interest. See {help twoway_options}. {phang} {opt combineopts(string)} pass options to the final graph combine. See {help graph combine}. {phang} {opt draw} displays the intermediate twoway plots used to create the final graph. {title:Example} {pstd}Load simulated example dataset:{p_end} {phang}{stata "use http://fmwww.bc.edu/repec/bocode/s/stjm_example":. use http://fmwww.bc.edu/repec/bocode/s/stjm_example}{p_end} {pstd}stset the data:{p_end} {phang}{stata "stset stop, enter(start) f(event=1) id(id)":. stset stop, enter(start) f(event=1) id(id)}{p_end} {pstd}Create joint plot:{p_end} {phang}{stata "stjmgraph long_response, panel(id)":. stjmgraph long_response, panel(id)}{p_end} {title:Author} {pstd}Michael J. Crowther, University of Leicester, UK. E-mail: {browse "mailto:mjc76@le.ac.uk":mjc76@le.ac.uk}.{p_end} {phang} Please report any errors you may find.{p_end} {title:References} {phang} Crowther, M. J. & Abrams, K. R. & Lambert, P. C. {browse "http://repec.org/usug2011/UK11_crowther.pdf":Flexible parametric joint modelling of longitudinal and survival data}. 2011. {it:Submitted}.{p_end} {phang} Wulfsohn, M. S. & Tsiatis, A. A. A joint model for survival and longitudinal data measured with error. Biometrics, 1997, 53, 330-339.{p_end} {title:Also see} {psee} Online: {helpb stjm}, {helpb stjm postestimation} {p_end}