Dear all, i was hoping someone might be able to help me set up my data correctly so i can use it in a survival analysis.
My dataset is persons, who have become unemployed and want to make a survival analysis where it measures the time from they become unemployed until they reach employment. I have set the maximum time to 24 months (so if they havent reach employment after 24 months, they dont succeed). There are some observations in my data, which are right-censored, meaning that from the time they are unemployed they at some point die/move/retire, for these observations time is measured from unemployment until they ''leave''. Persons can enter several times, as they can enter as soon as they have reach employment (then they will enter if they again reach unemployment).
pnr= ID variable
suc =reach succes(employment)
tid=time for reaching employment/are being right-censored
An example of my data:
PNR SUC(reach employment) right-censored TID(measured in months)
1 0 0 24
1 0 0 24
2 1 0 5
2 0 1 7
3 1 0 0
etc.
i tried the following command, but get this:
Array
how do i edit my data so all records are included and why do i get the two messages:
''multiple records at same instant'' and ''observations begin on or after (first failure)''
the message ''observation end on or before enter()'' - i understand is because i have person who reach employment (suc=1) but at time =0. I read a solution would be to just edit these time to fx tid=0.1 - would that be dangerous?
I hope somebody can help.
Best regards Julia
Related Posts with Setup data correctly for survival analysis - stset - without losing observations
ordered logit sorted by a binary variable including weightsi am trying to run an ordered logit model with wealth status (categorical) as dependent variable plu…
Averaging observations within a column having missing valuesHello there ! I am hoping to get a reply for this since I am struggling with it for quite some time …
Heterogeneous treatment effects with ivregressDear Statalist, I want to calculate treatment heterogeneity in a two-stage-least-square (TSLS) sett…
Marginal effects in Stochastic Frontier AnalysisDear all: I am estimating a panel data SFA using the model proposed by Battese and Coelli (1995). I …
Missing Standard ErrorsHi Everyone, I am doing a Poisson regression (ppmlhdfe) with a specification using the Zipcode-spec…
Subscribe to:
Post Comments (Atom)
0 Response to Setup data correctly for survival analysis - stset - without losing observations
Post a Comment