Announcement

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

  • Observed time interval in stset

    This is my first post on this forum and I am happy to join this community. First, I wish to apologise if any of the previous content in this forum could have been of help. I have actually searched for a solution and read many replies, but I was not able to find one applicable to my need.

    In my dataset, I have two observations for each subject. Each observation represents a clinical visit. Data on vital status have been obtained by a National Registry.
    For each observation, I have information recorded in these variables:
    • id_patient, which is the subject identificator
    • no_reg, which identifies if present observation is the first (no_reg == 1) or the last one (no_reg == 2)
    • visit_date, which is the date of the visit
    • out_death, and out_death == 1 means that the patient is known to be dead when the dataset has been released
    • time_death, which is the time from the date of that visit to death.
    When I select only one registration for subject, I run
    Code:
     stset time_death, failure(out_death=1) scale(365.25) exit (time 1826.25) id(id_patient)
    This is my first time with multiple records for patient, and my problem is that I need to set the date of the last visit (i.e. last registration) as index date of the analysis, while I obtain:
    Code:
    Observed time interval: (time_death[_n-1], time_death]
    I actually need another interval:

    Code:
    (time_death(_N), time death)
    I tried to specify origin as no_reg ==2, but there are several observations beginning on or after exit, while if I drop the first registration and I use the stset command, I do not have exclusions and everything comes smooth.

    I tried also to modify my data, so that the death status was only valued in the second registration, and time_death was the same in first and second visit, based on the value of the second visit, but none has been successful.

    Thanks in advance for your help.
    Last edited by Daniele Rodolico; 29 Mar 2022, 12:02.

  • #2
    Welcome to the list!

    A data example, using -dataex- would make things easier (at least for me). I understand you may not be able to provide your actual data, but a made up dataset with a small number of observations that illustrate your data structure might suffice. I suggest it would be informative if you could illustrate what you hope to get after stset. That is, show the values of _t0, _t, and _d you hope to get.

    It's not obvious to me what you mean by "(time_death(_N), time death)". In Stata notation, _N is the number of observations in the dataset.

    It seems that there are three relevant dates for each individual, visit1, visit2, and death. It may be easier to restructure your data so all dates are represented by dates (rather than one date and a difference between dates). If you provide an example of your data and more information on what you are trying to achieve then someone here should be able to help.

    If I understand correctly, every patient has two visits. What is unclear is if every patient has died (the existence of the variable out_death suggests not). If not all patients have died, then how is the variable time_death coded for those patients who didn't die.

    This is not a Stata issue, but if you have conditioned on all patients having two visits then the time between visits is immortal time and should be considered in the analysis (look up "immortal time bias").

    Comment

    Working...
    X