Hi everyone. I am a STATA beginner trying to calculate a time span. I have one variable “in” with date and time for example: 1/1/2021 10:00 (format %tcnn/dd/ccYY_hh:MM). I also have a variable “out” for example: 2/2/2021 12:00. I would like to calculate how many days it is between “in” and “out”. I tried datediff(in, out, day[,1mar]) but it does not work.
Any suggestions?
All the best!
Related Posts with Timespan
combining datasets where want to replace incorrect values of one variableIn my master dataset I have incorrect values of l for the years 1997-2000. I want to replace these v…
Making systematic changes to set of do-filesI have a large number of do-files that I would like to run by systematically changing parts of the c…
Reproducing a graphicHi Statlist, I have the following mini dataset Code: * Example generated by -dataex-. To install:…
Scatter PlotWhat command can I use to create a Scatter plot with regression line and line of perfect correlation…
Store coefficients/SEs for factor variables, maybe using statsbyI'm regressing something on a factor variable with many levels. I would like to save the coefficient…
Subscribe to:
Post Comments (Atom)
0 Response to Timespan
Post a Comment