Announcement

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

  • Covariate-adjusted Kaplan Meier curve- unable to perform log-rank or add risk table!

    Hello,

    As the title suggests, I've created a lovely KM curve adjusted for by an interaction term of 2 covariates, but I'm unable to add a risk table to the generated graph, or perform a subsequent log-rank test.

    For the unadjusted KM with a risk table, I use:
    Code:
    sts graph, by(Calcification) risktable
    and the following for the log rank:
    Code:
    sts test Calcification, logrank
    The adjusted KM curve is generated with the following:
    Code:
    sts graph, strata(Calcification) adjustfor(lengthgrade#calcgrade)
    However, when I input the following code:
    Code:
    sts graph, strata(Calcification) adjustfor(lengthgrade#calcgrade) risktable
    I am returned with this error:
    options adjustfor() and risktable may not be combined r(198)
    And
    Code:
    sts test Calcification adjustfor(lengthgrade#calcgrade), logrank
    returns
    factor-variable and time-series operators not allowed r(101)
    Any help would be appreciated! I've been searching around with no luck, so it may be possible that these functions are not doable at all, however if there are ways around these errors then I'd be really grateful to hear!

  • #2
    Ashar:
    you may want to create the interaction by hand to replace the factor variables notation within brackets.
    Kind regards,
    Carlo
    (Stata 19.0)

    Comment

    Working...
    X