Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

st: St: graphing the HR and tvc in STATA

From   "Sudhinaraset, May" <>
To   "" <>
Subject   st: St: graphing the HR and tvc in STATA
Date   Fri, 22 Apr 2011 16:00:45 -0400


I have a question regarding how to make a graph of the hazard ratios with tvc for each age group using the following command:

xi: stcox ruralnative ruraltourban urbantourban female i.wlthind3 i.schooljob i.famstruc, tvc(ruralnative ruraltourban) texp((_t))  cluster(psu_shang)

What I have done is modeled the HR at EACH age of sexual initiation using texp(_t-agex) and then plotted the hazard ratios using excel. I am trying to make a graph of the hazard ratio function, but can only do it manually. Is there a way to do this using the predict command? Based on my code, I have a reference category and ruralnative and rural to urban variables varies with time by a certain function.

Any assistance you had would be appreciated!


May Sudhinaraset
Ph.D. Candidate
Department of Population, Family, and Reproductive Health
Bloomberg School of Public Health
Johns Hopkins University

*   For searches and help try:

© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index