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
generate retirement ageHey all, I am using panel data and have a full population dataset. I can observe an individuel over…
generate cumulative IRF after -xtvar-Hi Statalists, I'm estimating panel VAR with -xtvar- (a user-contributed code by Cagala(2014)?). I'…
Is meglm support for poisson mean difference?In the Multilevel model, meglm is responsible for many linkage functions and families, but not for t…
Difference in Fixed Effect and Random EffectsHello! I am trying to understand the different Panel Data models and I am getting confused by the di…
svy: logit goodness-of-fit tests (subpopulation)Hi, how can I use stat gof if I need to keep subpop to keep the correct estimation of variances and …
Subscribe to:
Post Comments (Atom)
0 Response to How to calculate days and hours between two dates
Post a Comment