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
Requeasting for the exact command to simpson diversifcation index in stataHello, Dear all, I am new for the stata software. Would you please show me the appropriate command t…
behavior of saved outputDear lister I am using Stata17 I want to save the output from 2 table commands in 2 matrixes. Afte…
dyndoc and css formatingHi all. I run the -dyndoc- command in stata15. I include in my code header and css codes. When I s…
Issue With Quarterly Data FormatHello Stata community, I am having an issue when trying to create a simple "difference" variable, be…
Do Not Rank If ConditionHello, In the sample attached I have ranked var: tfr_lr in var: rank_tfr_lr I would like var: tfr_l…
Subscribe to:
Post Comments (Atom)
0 Response to Adding time variables
Post a Comment