Announcement

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

  • Cubic Spline with HR

    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!

  • #2
    spline 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[

    Comment


    • #3
      while I'm glad to see that people are still using my (very) old program -spline-, you would generally be better off using the official -mkspline-; see
      Code:
      h mkspline
      and look at the third syntax

      on the other hand, I don't understand your question and thus don't know whether this will solve your problem

      Comment

      Working...
      X