Hi STATALIST,
First time poster here. I am hoping someone can assist with my hospital record data calculations of nested episodes length of stay, where my dataset has many separations (rows) per person (ppn), and I need to calculate the length of stay for contiguous separations that create one whole episode of care... however there can possibly many many of these 'whole episodes of care' for one person over the 10- years of data. Here is an example - where the 'ppn' shows same person, being 'admitted' (admitdttm) to hospital on a given date/time, separated (dischdttm) on a given date/time - I have calculated ''cont_stay' where one separation doesn't exceed 1 day between the next admission (using [_n-1 etrc] functions.. the 'obs' variable is a continous count of all separations by ppn over the 10 years of data. The episode_seq_no shows the chronological order of separations within ONE unique whole episode of care. What I want to do but can't figure out how (!!!) - - is sum the 'los_sep_days' (days rounded to 2 dec places) of each separation, but within one whole episode of care (i.e. episode_seq_n starts at 1 and finished when cont_stay no longer == 1. I hope this explains it in words.. or here is a snip of the data:
Array
THANK YOU in advance if you can help!! I have spent hours and hours on this and am going round in circles.
Related Posts with Trying to calculate time length for hospital episodes of multiple consec. rows, but also multiple nested within one 'person'
Is there a way to highlight which obs are being omitted in clogit?Hello, I am trying to run clogit and I get the following note: "1,268 groups (11,377 obs) omitted b…
How to choose a reference category in multinomial logistic regression?Hello, I have 2 questions if anyone can help: 1) I have 2 groups (treatment and control), and the …
Using estout with multiple imputationHi, I am trying to use -estout- (from SSC) in conjunction with -mi- for the first time, and it seems…
Selected variable list using lassoHi All, I have data which resembles the following: * Example generated by -dataex-. To install: …
How to randomly pair Firm A and Firm B in the year of deal announcement?Dear Statalist, I would like to randomly pair one sample of firms with another sample of firms draw…
Subscribe to:
Post Comments (Atom)
0 Response to Trying to calculate time length for hospital episodes of multiple consec. rows, but also multiple nested within one 'person'
Post a Comment