Hi I have a question that I am struggling with: I have three variables of interest that I would like help with. I would like to create a variable that captures the time from when the patient was first transfered to discharge for Med/Surgical unit. Something like:
transfer_datetime transfer_type unit_type
01/15/19 03:05 transfer other
01/17/19 01:20 discharge
01/20/19 12:25 transfer other
admit Med/Surg
transfer Med/Surg
transfer Med/surg
discharge
What I would like is a variable that shows the time between the first transfer and the discharge, for med/surgical unit type only (the discharge has no unit_type because it is discharge), and not for the "other". May you please assist with this?
Related Posts with Subtracting date
Creating "total number of births by sex", using dummies for sexDear All, I would like to create a variable for total number of male birth and total number of fema…
'var' invalid name even though it is in my codeHello! I am trying to test for interaction terms in my propensity model however I get the error mess…
Control for age in Diff-in-diff regressionHi, I´m doing a difference-in-difference regression on the causal relationship between income tax a…
Question about data synchronizationDear all, Good morning. I have a question about the data synchronization. Please see the picture bel…
margins, dydx(x) at only certain values of xDear Statalisters, I am running a logit Code: svy, subpop(if marital==1&age>17&age<…
Subscribe to:
Post Comments (Atom)
0 Response to Subtracting date
Post a Comment