Announcement

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

  • Mata error when running stcrprep

    Hello Statalist

    I get an error when trying to run the command stcrprep. I attached the log-file with the trace set on. The initial stset code is also included. Unfortunately the data exist on an external server, thus it is not possible to attach the entire dataset.

    My code is:

    . stset a_timevar, failure(event==1,2) id(id) enter(a_entrydate)

    id: id
    failure event: event == 1 2
    obs. time interval: (a_timevar[_n-1], a_timevar]
    enter on or after: time a_entrydate
    exit on or before: failure

    ------------------------------------------------------------------------------
    1,122,929 total observations
    0 exclusions
    ------------------------------------------------------------------------------
    1,122,929 observations remaining, representing
    1,122,929 subjects
    173,850 failures in single-failure-per-subject data
    3,286,722 total analysis time at risk and under observation
    at risk from t = 0
    earliest observed entry t = 1.333333
    last observed exit t = 5

    . set trace on

    . stcrprep, events(event) trans(1)

    And the error message is the following:

    - mata H_to_t()
    H_to_t(): 3301 subscript invalid
    <istmt>: - function returned error

    Does anyone know a way to prevent this error from occurring? It is not obvious to me why a subscript (row or column) would be out of bounds.

    Thank you in advance

    Respectfully,
    Andreas Jensen
    Attached Files
    Last edited by Andreas Jensen; 06 Jul 2018, 01:42.

  • #2
    You didn't get a quick answer. You'll increase your chances of a useful answer by following the FAQ on asking questions - provide Stata code in code delimiters, readable Stata output, and sample data using dataex. We are also unlikely to open files.

    For user-written routines, sometimes one of us uses the routine and has seen a problem. But, for less commonly used routines, the only real solution is to contact the author (or see if there is an equivalent routine in Stata 15).

    Comment

    Working...
    X