Announcement

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

  • AUC or C-statistic in Cox models with time-varying covariates

    Dear all,

    I have a dataset with time-varying covariates and multiple observations for each subject.
    When I run this code:

    Code:
    stset studytime, failure(event_flag) id(subject_id)
    stcox covariate1 covariate2, nohr
    estat concordance
    Stata issues following error message:

    estat concordance may not be used with late entry or time-varying data
    r(498);

    Is there any workaround for this issue?
    And, in general, is there any possibility to plot the Receiver Operating Curve (ROC) in order to have a visual impression of the Area Under the Curve (AUC)?

    Thank you,
    Maxim

  • #2
    I produced a minimal example:
    Code:
    clear
    input double member_id byte studytime byte event_flag double cvar double tvar
    1664995    1    0    -1.069115    14.91
    1664995    2    0    -1.084301    14.91
    1664995    3    0    -1.076203    14.91
    1664995    4    0    -1.062248    14.91
    1664995    5    0    -1.062364    14.91
    1664995    6    1    -1.072569    14.91
    1907928    1    0    .6467022    19.46
    1907928    2    0    .6442843    19.46
    1907928    3    0    .6418722    19.46
    1907928    4    0    .6500599    19.46
    1907928    5    0    .6614851    19.46
    5547388    1    0    -.3859369    8.43
    5547388    2    0    -.376929    8.43
    5547388    3    0    -.3769699    8.43
    5547388    4    0    -.3747978    8.43
    5547388    5    0    -.3689544    8.43
    5547388    6    0    -.3741    8.43
    5547388    7    0    -.3710158    8.43
    5547388    8    0    -.3706038    8.43
    5547388    9    0    -.3990378    8.43
    5547388    10    0    -.409    8.43
    5547388    11    0    -.4042307    8.43
    5547388    12    0    -.416427    8.43
    5547388    13    0    -.4139442    8.43
    5547388    14    0    -.4012381    8.43
    5547388    15    0    -.3865453    8.43
    5547388    16    0    -.3865453    8.43
    5547388    17    0    -.3889754    8.43
    5547388    18    0    -.3883685    8.43
    5547388    19    0    -.3841093    8.43
    5547388    20    0    -.3800359    8.43
    5547388    21    0    -.3886517    8.43
    5547388    22    0    -.385531    8.43
    5547388    23    0    -.3841093    8.43
    5547388    24    0    -.3841093    8.43
    5547388    25    0    -.3905922    8.43
    5547388    26    1    -.3903902    8.43
    end
    
    stset studytime, failure(event_flag) id(member_id)
    stcox cvar tvar, nohr
    estat concordance

    Comment

    Working...
    X