Dear Stata Specialists,
I'm trying to use flexible parametric model to estimate Hazard ratio over time (at 1 year, 5 years and 10 years after start of follow up) and visualize HR change over time using survival data. Because of violation of proportional hazard assumption, I didn't use Cox.
Some brief info about my data:
outcome: development of CVD (0/1)
main exposure: RA (0/1)
covariates: age (continuous), sex (0/1), region (categorical noted by 0-20)
censoring: death during follow-up, emigration during follow-up or end of study (0/1)
follow-up time: in years (from diagnosis of RA to development of CVD or censoring)
*As this is a matched cohort, so I assum the HRs for the 3 covariates are constant over follow-up time.
I used the following coding to draw HR change over time:
stset pyears, failure(outcome)
destring ra, replace
stpm2 ra sex1 age i.region1, scale(h) df(5) eform tvc(ssc) dftvc(3)
range temptime 0 14 101
predict hr, hrnumerator(ra 1) ci timevar(temptime)
twoway (rarea hr_lci hr_uci temptime, color(red%25)) ///
(line hr temptime, sort lcolor(red)) ///
, legend(off) ysize(8) xsize(11) ///
ytitle("Hazard ratio (SSc patients/comparator)") name("hr", replace) ///
xtitle("Years since cohort entry")
So, My first question is that how should I decide the value of df(), dftvc() and the last number following -range-? And how to interpret the exp(b) of variable ra?
The following coding was for generating HRs at 1, 5 and 10 years:
generate t1=1
generate t5=5
generate t10=10
predict hr1, hrnumerator(ra 1) timevar(t1) ci
predict hr5, hrnumerator(ra 1) timevar(t5) ci
predict hr10, hrnumerator(ra 1) timevar(t10) ci
I'm not sure that did these coding make sense in terms of my purpose? Could the results be displayed in form of table?
Thank you in advance!
Best,
Z.
Related Posts with Questions about using -stpm2- and flexible proportional model
McDonald's omega for measurement modelWith a view to SEM, I want to evaluate a measurement model with six items (expressing behaviour freq…
How to interact a variable with Fixed Effect. Help!Hi! I am working on my final paper and could need som help. What i'm trying to do is to investigate …
Stacked chartsHi, I am trying to represent my data in a stacked chart. I have data on export and import. What I am…
set n(#) in a kdensity loop with different sample sizesHi Statalist, I am new here but this forum is been helpful several times. I am using stata15, and t…
How to prevent incorrect (Windows) file time attribute of graphic files produced with graph exportsaving a graph using graph export for the first time under a name such as graphtime.wmf saves the gr…
Subscribe to:
Post Comments (Atom)
0 Response to Questions about using -stpm2- and flexible proportional model
Post a Comment