Hi everyone,
I want to create a variable that is a count of days between two events. In my study, there are two potential starting events (Procedure A and Procedure B) and two potential ending dates (Outcome or Study End). For Procedure A, there is one index date from which I want to start counting time. For procedure B, there is an index date, but this event may be followed by another event of the same type ('last procedure date'). For Procedure B, I want to start counting time from the latest of either the index date or the last procedure date. For both procedures, I want to count time to the date of either the Outcome or the Study End. Once I have this count in days, I want to convert it to weeks, months, and years (but that's a second step problem).
My thinking so far is I need code in the logic for the start date and then follow that up with code for the end date. The example code I have for this in SAS and uses the INTCK function, which offers limited value in Stata, and I'm struggling to figure out quite how to get started. I'd welcome any suggestions of resources to read or code to look at to help me construct this variable.
Thank you!
Related Posts with Constructing a Time-to-Event Variable (days) with Multiple Potential Start Dates and a Two Potential End Dates
Metan questionHi, I have a database containing data from pubmed articles (OAD, species, strains, initial number, …
Multinomial logistic regression - RRR is too bigHi, I am running a regression where a firm performance measure ( a categorical variable) is regress…
How to make a point estimate in mixed model: the effect of group at a certain point of the slopeDear Stata users, I have a mixed model (see the syntax below) with main effects of group (two dicho…
Can I combine feature selection and feature creation method?Hello, I am working on my thesis, with the topic "Factors determining life satisfaction in the USA".…
odksplit for ODK and SurveyCTODear all, I am happy to announce that odksplit is now available in ssc. odksplit is a module to spl…
Subscribe to:
Post Comments (Atom)
0 Response to Constructing a Time-to-Event Variable (days) with Multiple Potential Start Dates and a Two Potential End Dates
Post a Comment