Hi everyone,
Below is an example from my dataset.
datediag dead dateexit id perdiag agegrp
4429 1 4706 1570110 0 5
4533 1 6754 1570111 0 5
4387 1 4650 1570112 1 5
4669 1 4856 1570113 0 4
4123 1 4236 1570114 0 3
4883 0 4896 1570115 0 2
4324 1 4432 1570116 0 5
I am stuck at a problem.
The exact problem is
“For the first three years since diagnosis, how can I estimate the effect of the age of diagnosis (variable agegroup) on the mortality rate among participants?”
I am doing the following
First, I have to use the stset command
stset dateexit, id(id) failure(dead==1) origin (time datediag) scale(365.25)
Secondly, I have to use stsplit command
stsplit yearsincediag, at (0 (1) 3)
Then, I use
stmh agegrp, by(yearsincediag)
Is this correct????
Should I use
Strate or stmh??
What’s the difference between strate and stmh????
Related Posts with Estimating the Effect of a given variable on mortality rates
Why won't my test for fixed vs random effects models work? The Mundlak approach.I have panel data on women measured across 3 waves. I am unsure as to whether to model them with fix…
How to change string data to numeric data in StataDear Statalist community, I'm currently trying to merge two different datasets. I receive the follo…
Individual tables using esttab/estoutHi, I've now been searching around for quite some time but am just not able to find answers to my sp…
Making the first row become Variable Names and Transposing the dataHello, How can I make the first row of observations become the Variable name? I would also like to…
effect of treatment in a three arm studyDear Statalist. I have a dataset from a three arms study (one of the arms is control, and the other…
Subscribe to:
Post Comments (Atom)
0 Response to Estimating the Effect of a given variable on mortality rates
Post a Comment