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