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
New package: Relogitplot - predictive margins plots after relogit regressionsIf you use the relogit package (Tomz, King, and Zeng), you may be interested in an addon I wrote whi…
Testing the equality of the regression coefficientsThe main regression model reghdfe y x controls, absorb (ind fyear) vce(cluster gvkey) Now I want t…
Multiple sheets export excelHello, I want to export the "auto" file in several Excel's sheets (one per brand). Code: sysuse aut…
How do I regress by month?My panel of data looks like the sample below. I am trying to regress 'subs' with the remaining varia…
an error occurred when svy executed mlogit: option baseoutcome() is required with prefix svy bootstrapHi, Using the code below, I am trying to obtain and save marginal estimates for each iteration of my…
Subscribe to:
Post Comments (Atom)
0 Response to How to calculate days and hours between two dates
Post a Comment