Hi,
I am calculating days and hours between two dates (admission date/time and discharge date/time), thanks for any suggestions.
Example attached:
clear
input str9 admi_date str9 admi_time str9 dischage_date str9 dischage_time
1 11jan2019 1154 12jan2019 0716
2 15feb2019 0217 08oct2018 0934
3 01dec2019 2314 09feb2020 0817
end
The final results should have two new variables, one denotes the total days between two dates, and another one indicates the total hours between two dates.
Best,
Zichun
Related Posts with How to calculate days and hours between two dates
Using random instead of fixed effects in ordered probit model, and dummy variablesDear all, I am reaching out because I would need some clarifications for my regression model for my…
Probability weights in random effects modelsHello, I am trying to estimate the effects of several time invariant variables on my outcome using …
creating a percentage graph barDear Statalist I would like to make a graph bar but with percentages instead of the count. However,…
eregress / etregress and margins + interpretationHello everyone, I have insurance claims data (health insurance) from which I'm trying to figure out…
Plot with text not exporting to PDFDear all. What I am about to describe, happens happens in both Stata 15 and Stata 16, running on Wi…
Subscribe to:
Post Comments (Atom)
0 Response to How to calculate days and hours between two dates
Post a Comment