Hi everyone,
I'm very new to stata and wanted to run a cubic spline. Ive read a few forums already but can't really wrap my head around it.
Im aiming to run a cubic spline with HR from stcox on the y axis and a continuous variable (z_cvltscore_12) on the x .
This is what I've got so far: [INDENT=2]kspline spcvlt = z_cvltscore_12, cubic nknots(3)
stset fail_19, failure (dead_19=1) origin (drdob_00) enter (drdate_12) exit (fail_19) scale (365.25)
stcox z_cvltscore_12 i.drsex_12 i.cob_gp4 i.educatio i.partnercat_12 alcohol_12 i.smokstat_12new i.exercise_12 i.diabcat_12 i.CVDcat_12 i.depression_12 waist_12 systolic_12 cholhdl_12[/INDENT]
If anyone could help me out this would be great - I want to end up with a figure that shows my HR and confidence intervals.
Thank you!
I'm very new to stata and wanted to run a cubic spline. Ive read a few forums already but can't really wrap my head around it.
Im aiming to run a cubic spline with HR from stcox on the y axis and a continuous variable (z_cvltscore_12) on the x .
This is what I've got so far: [INDENT=2]kspline spcvlt = z_cvltscore_12, cubic nknots(3)
stset fail_19, failure (dead_19=1) origin (drdob_00) enter (drdate_12) exit (fail_19) scale (365.25)
stcox z_cvltscore_12 i.drsex_12 i.cob_gp4 i.educatio i.partnercat_12 alcohol_12 i.smokstat_12new i.exercise_12 i.diabcat_12 i.CVDcat_12 i.depression_12 waist_12 systolic_12 cholhdl_12[/INDENT]
If anyone could help me out this would be great - I want to end up with a figure that shows my HR and confidence intervals.
Thank you!

Comment