Hi all, thanks for reading! I'm running discrete-time survival analysis and trying to plot the step-shaped cumulative survival functions (s) after a logit model.
xtlogit event duration, i(ID)
I basically followed what online resources told me to do and run the following commands:
predict hazard, pu0
bysort ID duration: gen hazard_cumulative = sum(1-hazard)
gen s = 1 - hazard_cumulative
twoway line s duration, sort ylab(0(0.1)1) xlab(1(1)5) connect(J)
Somehow there occurs 2 problems:
(1) At each point of connecting the values, the data points of individual observations occur on the x axis, no matter if I specify line/connect. Array
(2) Even if the values of cumulative survival functions are descending across duration(which I checked with tabulate and browse), somehow the shape is not always descending.
Would anyone know the solutions to these problems? Many, many thanks indeed!
Related Posts with Abnormality when plotting discrete-time survival functions
Tobit Model Decomposition (Probability of adoption for non-adopter group and Intensity of Participation for adopter group)I am working on adoption study with non-adopter category and non-adopter category. How can I decompo…
Obtain coefficients for cross-sectional regression by id monthlyDear Statalists, I like to run this cross-sectional regression for my panel data and obtain only th…
Regarding GMMHi, There are multiple commands (xtabond , xtabond2, xtdpdsys) for GMM in Stata. What is less clear…
Tobit Model Decomposition (Marginal effects for probability of adoption and marginal effects for Intensity of adoption)I am working on adoption study with non-adopter category and non-adopter category. How can I decompo…
regexmHi STATALIS I want to select patients with "IAM" in the studydescription_all variable . The "studyd…
Subscribe to:
Post Comments (Atom)
0 Response to Abnormality when plotting discrete-time survival functions
Post a Comment