Hi,
I am currently working with time data. The following is the time each person spends alone on each activity (25 activities, shown only 7 ), this includes missing values since the person is not alone for the given activity. I would like to see how much time each person spends alone in a day. Essentially I am trying to add the h1+h2+ h3+ h4+ h5 + h6+ .... for each individual (140 individuals). Can someone please help me with the same? Thank you
[CODE]
* Example generated by -dataex-. To install: ssc install dataex
clear
input float(h1 h2 h3 h4 h5 h6 h7)
. . 1800000 . 1800000 . .
. 3600000 3600000 3600000 . 7200000 3600000
. 1.08e+07 1.26e+07 1800000 1.08e+07 3600000 1800000
1.08e+07 1800000 1800000 1800000 1800000 3600000 .
. 1800000 5400000 1800000 1800000 3600000 3600000
1.08e+07 1800000 1800000 1800000 7200000 . 3600000
. . . . . 3600000 7200000
7200000 . . 7200000 . 3600000 .
end
format %tchh:MM:SS h1
format %tchh:MM:SS h2
format %tchh:MM:SS h3
format %tchh:MM:SS h4
format %tchh:MM:SS h5
format %tchh:MM:SS h6
format %tchh:MM:SS h7
Cheers,
Aarushi
Related Posts with Adding time variables
Read Stata file using part of file name onlyHello, I have a large number of datasets that have very long filenames but each have a unique strin…
GMM or FE? Is my model dynamic ?Dear all, I am working with survey panel data covering 32 years and very large amount of individual…
Interaction variables in OLS and FEDear all, I am running OLS and FE estimation. I have difficulties creating the below interactions o…
Cases show up as missing in new varHi! I am trying to generate a new var RWTEL using combinations of two other variables. (ANY and THR…
Effect size of moderation/interaction in fixed effects modelDear list, I wonder how to best calculate the effect size of an interaction term in a fixed effects …
Subscribe to:
Post Comments (Atom)
0 Response to Adding time variables
Post a Comment