Hi,
I am studying union formation and dissolution of first and second-generation immigrants in the host country and compare to natives. I use the Cox proportional hazard model and competing risk model using stcrreg, I have both time constant and time-varying variables. I split the data for time-varying variables at the time point for instance each respondent graduate from primary school, lower secondary, upper secondary and finally tertiary. Covariates are as follows;
Time constants: migration status(3 categories), sex(two categories), birth cohort(3 categories)
Time-varying : education(4 categories), pregnancy(2 categories), parity(3 categories)
1st question
Since proportionality assumption for both the Cox model and competing risk model using stcrreg doesn't hold, I try the piece-wise constant exponential model. After stset and split my data for time-varying variables. I first tried this
xi: stpiece i.cohort i.preg i.numkid, tp(0,60,84,108,132,180,204) tv( i.migstatus i.sex_gen i.eductv) ( I put nonproportional covariates after tv option), but it doesn't give results in tv option as categorical)
So I tried this without using tv option, it works, but I am not sure if this is what I suppose to do?
xi: stpiece i.migstatus i.sex_gen i.cohort i.eductv i.preg i.numkid, tp(0,60,84,108,132,180,204)
2nd question
How to incorporate competing risk model with the piecewise constant exponential model? Do I have to stset my data for competing events separately than use stpiece as below or any other suggestion?
stset beg, failure(typeb=1) origin(origin14) id(id)
split data for timevarying variables
xi: stpiece i.migstatus i.sex_gen i.cohort i.eductv i.preg i.numkid, tp(0,60,84,108,132,180,204)
stset beg, failure(typeb=2) origin(origin14) id(id)
split data for timevarying variables
xi: stpiece i.migstatus i.sex_gen i.cohort i.eductv i.preg i.numkid, tp(0,60,84,108,132,180,204)
Thank you in advance,
Muserref Erdogan
Related Posts with Non proportionality of Cox model, using piece-wise constant exponential model instead
Reshape data to long - no stub, time in long formatDear all, I have a dataset in a bit oddly shaped. The time (the data is hourly for 30 years) is alr…
Fixed effect or first differencegen gr_rate = D.lnuclms reg lnunclms ez y1982-y1988 Given this model, either the within transformati…
Removing middle of a string between certain charactersHello Statalist, I have a string variable which is interspersed with HTML tags (e.g. "<br>" o…
multicollinearity check for logistic regression including binary and categorical variablesHey everyone, i have to analyse panel data for my thesis. I use Stata version 15.1. I chose the log…
-margins- . *(not estimable)Hi folks, I could not get outputs after -margins. Following are estimations followed by -margins- o…
Subscribe to:
Post Comments (Atom)
0 Response to Non proportionality of Cox model, using piece-wise constant exponential model instead
Post a Comment