Hello I would like to plot the cumulative hazard for a continuous variable - score -
One of my colleagues advised me to look into -stpm3-
Originally I fitted the following model into -stcox-
And I am not keen on categorising either... so a colleague recommended me to use -stpm3 -
Questions:
May I confirm that if my finalised model from cox model had age as a predictor included in the model.
q1. Why do the authors of the code add centre(50) to their original code? : stpm3 @ns(age, df(4) center(50)) year8594, scale(lncumhazard) df(5) eform
q2. Should my code appear in this way - with age into the code as an additional predictor:
--- I have not used center as I don't know what this is for so therefore not used
q3. Should I set my covariates eg in my case age at the average level in order to work with the predict function?
q4. And finally the code produces 4 natural spline variables
- Am I correct to say I can infer conclusions from the c_ns_f1_score* (with score*=score 1 score 2 score 3 score 4) depedning on the p -value
Many thanks
One of my colleagues advised me to look into -stpm3-
Originally I fitted the following model into -stcox-
Code:
mkspline scoregrp1 44 scoregrp2=score ///Final model - after backward selection and choice of covariates (I know many people don't fancy backward selection, however I used this and clinical judgement to keep my variables, my finalised model is : stcox c.scoregrp* age##age, hr As -scoregrp- is a linear spline continuous variable I am unable to graph the hazard using sts graph, hazard by(catvar) kernel(epan) name(h, replace)
Code:
stpm3 @ns(score, df(4)) scale(lncumhazard) df(5)eform predict lnhr, xbnotime ci
May I confirm that if my finalised model from cox model had age as a predictor included in the model.
q1. Why do the authors of the code add centre(50) to their original code? : stpm3 @ns(age, df(4) center(50)) year8594, scale(lncumhazard) df(5) eform
q2. Should my code appear in this way - with age into the code as an additional predictor:
Code:
stpm3 @ns(score, df(4) age), scale(lncumhazard) df(5)eform
q3. Should I set my covariates eg in my case age at the average level in order to work with the predict function?
Code:
stpm3 @ns(score, df(4)) scale(lncumhazard) df(5)eform predict lnhr, xbnotime at(age 68.9, obsvalues) ci ////here my average of age was 68.9 ///Finally plotting the graph were score is the continous variable vs cumulative hazard twoway (rarea lnhr_lci lnhr_uci score, sort) /// (line lnhr score, sort lpattern(solid)) /// , legend(off) ytitle("log relative hazard") name(two, replace)
- Am I correct to say I can infer conclusions from the c_ns_f1_score* (with score*=score 1 score 2 score 3 score 4) depedning on the p -value
Many thanks
Comment