Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • stpm2, predictnl and imputed data

    I am fitting a flexible parametric model on my data. Since some of my covariates have missing values, I have imputed 10 datasets. I am planning to get employment rate post injury. I want to predict employment rate for male and female keeping other covariates at population average. How can I achieve this prediction for one covariate keeping other covariates at population average? I am using following model:

    mi estimate, eform cmdok sav(mi_data, replace): stpm2 i.sex i.country i.age_grp i.injury_level, df(4) scale(hazard)

    mi predictnl emp_male= predict(survival(at(sex 1) timevar(_t)) using mi_data
    mi predictnl emp_female=predict(survial(at(sex 2) timevar(_t)) using mi_data

    gen hazard_male= 1- emp_male
    gen hazard_female= 1- emp_female

    twoway///
    (line hazard_male _t, sort)
    (line hazard_female _t, sort)

    The plot is not giving me smooth hazard curve, instead providing me with Zigzag shaped line graph. I think the problem is arising due to not keeping other covariates at population average while predicting employment rate for sex.
Working...
X