Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Support Needed for Time Use Data Analysis

    Dear All,

    I hope everyone is doing well.

    I am working with Time Use Data categorized by Gender, Activity, and the Total Time (in minutes) spent within each time zone. When I run my command, the results appear correct, but when summing up the total minutes spent, the total does not equal 24 hours based on the reported activities, gender, and time spent.

    I need your support in identifying and resolving this issue.

    Below is a sample dataset for each couple (Head and Spouse) pair for reference.

    Looking forward to your guidance.

    Best regards,



    clear
    input byte Activity_Cat int duration_of_Activity float(TimeZone gender) str36 _submission__uuid
    3 60 1 1 "00440ad1-9918-40c8-bf2a-2ee37468e9bb"
    3 29 1 1 "00440ad1-9918-40c8-bf2a-2ee37468e9bb"
    3 31 1 1 "00440ad1-9918-40c8-bf2a-2ee37468e9bb"
    3 120 2 1 "00440ad1-9918-40c8-bf2a-2ee37468e9bb"
    3 149 3 1 "00440ad1-9918-40c8-bf2a-2ee37468e9bb"
    3 29 3 1 "00440ad1-9918-40c8-bf2a-2ee37468e9bb"
    3 31 3 1 "00440ad1-9918-40c8-bf2a-2ee37468e9bb"
    1 271 3 1 "00440ad1-9918-40c8-bf2a-2ee37468e9bb"
    3 29 4 1 "00440ad1-9918-40c8-bf2a-2ee37468e9bb"
    3 151 4 1 "00440ad1-9918-40c8-bf2a-2ee37468e9bb"
    3 31 5 1 "00440ad1-9918-40c8-bf2a-2ee37468e9bb"
    3 60 5 1 "00440ad1-9918-40c8-bf2a-2ee37468e9bb"
    3 29 5 1 "00440ad1-9918-40c8-bf2a-2ee37468e9bb"
    3 420 5 1 "00440ad1-9918-40c8-bf2a-2ee37468e9bb"
    3 31 1 2 "00440ad1-9918-40c8-bf2a-2ee37468e9bb"
    3 29 1 2 "00440ad1-9918-40c8-bf2a-2ee37468e9bb"
    3 60 1 2 "00440ad1-9918-40c8-bf2a-2ee37468e9bb"
    2 120 2 2 "00440ad1-9918-40c8-bf2a-2ee37468e9bb"
    3 31 3 2 "00440ad1-9918-40c8-bf2a-2ee37468e9bb"
    2 120 3 2 "00440ad1-9918-40c8-bf2a-2ee37468e9bb"
    2 300 3 2 "00440ad1-9918-40c8-bf2a-2ee37468e9bb"
    3 29 3 2 "00440ad1-9918-40c8-bf2a-2ee37468e9bb"
    2 120 4 2 "00440ad1-9918-40c8-bf2a-2ee37468e9bb"
    3 60 4 2 "00440ad1-9918-40c8-bf2a-2ee37468e9bb"
    3 29 5 2 "00440ad1-9918-40c8-bf2a-2ee37468e9bb"
    3 420 5 2 "00440ad1-9918-40c8-bf2a-2ee37468e9bb"
    3 31 5 2 "00440ad1-9918-40c8-bf2a-2ee37468e9bb"
    3 29 5 2 "00440ad1-9918-40c8-bf2a-2ee37468e9bb"
    2 31 5 2 "00440ad1-9918-40c8-bf2a-2ee37468e9bb"
    2 60 1 1 "00769122-8180-4dc7-9bde-3c1e0e078649"
    3 15 1 1 "00769122-8180-4dc7-9bde-3c1e0e078649"
    3 45 1 1 "00769122-8180-4dc7-9bde-3c1e0e078649"
    3 45 2 1 "00769122-8180-4dc7-9bde-3c1e0e078649"
    2 75 2 1 "00769122-8180-4dc7-9bde-3c1e0e078649"
    4 45 3 1 "00769122-8180-4dc7-9bde-3c1e0e078649"
    3 15 3 1 "00769122-8180-4dc7-9bde-3c1e0e078649"
    3 165 3 1 "00769122-8180-4dc7-9bde-3c1e0e078649"
    1 180 3 1 "00769122-8180-4dc7-9bde-3c1e0e078649"
    3 15 3 1 "00769122-8180-4dc7-9bde-3c1e0e078649"
    4 15 3 1 "00769122-8180-4dc7-9bde-3c1e0e078649"
    3 45 3 1 "00769122-8180-4dc7-9bde-3c1e0e078649"
    3 45 4 1 "00769122-8180-4dc7-9bde-3c1e0e078649"
    3 120 4 1 "00769122-8180-4dc7-9bde-3c1e0e078649"
    2 15 4 1 "00769122-8180-4dc7-9bde-3c1e0e078649"
    3 45 5 1 "00769122-8180-4dc7-9bde-3c1e0e078649"
    3 360 5 1 "00769122-8180-4dc7-9bde-3c1e0e078649"
    3 135 5 1 "00769122-8180-4dc7-9bde-3c1e0e078649"
    2 60 1 2 "00769122-8180-4dc7-9bde-3c1e0e078649"
    3 30 1 2 "00769122-8180-4dc7-9bde-3c1e0e078649"
    3 30 1 2 "00769122-8180-4dc7-9bde-3c1e0e078649"
    2 60 2 2 "00769122-8180-4dc7-9bde-3c1e0e078649"
    2 60 2 2 "00769122-8180-4dc7-9bde-3c1e0e078649"
    2 45 3 2 "00769122-8180-4dc7-9bde-3c1e0e078649"
    3 15 3 2 "00769122-8180-4dc7-9bde-3c1e0e078649"
    4 45 3 2 "00769122-8180-4dc7-9bde-3c1e0e078649"
    4 45 3 2 "00769122-8180-4dc7-9bde-3c1e0e078649"
    1 255 3 2 "00769122-8180-4dc7-9bde-3c1e0e078649"
    2 60 3 2 "00769122-8180-4dc7-9bde-3c1e0e078649"
    3 15 3 2 "00769122-8180-4dc7-9bde-3c1e0e078649"
    3 45 4 2 "00769122-8180-4dc7-9bde-3c1e0e078649"
    2 45 4 2 "00769122-8180-4dc7-9bde-3c1e0e078649"
    2 15 4 2 "00769122-8180-4dc7-9bde-3c1e0e078649"
    2 60 4 2 "00769122-8180-4dc7-9bde-3c1e0e078649"
    3 15 4 2 "00769122-8180-4dc7-9bde-3c1e0e078649"
    3 165 5 2 "00769122-8180-4dc7-9bde-3c1e0e078649"
    3 360 5 2 "00769122-8180-4dc7-9bde-3c1e0e078649"
    3 15 5 2 "00769122-8180-4dc7-9bde-3c1e0e078649"
    end
    label values Activity_Cat Activity_Cat
    label def Activity_Cat 1 "Productive", modify
    label def Activity_Cat 2 "Reproductive", modify
    label def Activity_Cat 3 "Leisure", modify
    label def Activity_Cat 4 "Other", modify


    Below is the Command I used to run

    collapse(sum) duration_of_Activity, by(Activity_Cat gender)

  • #2
    Shamsudini:
    1) if you type before collapsing:
    Code:
    . total duration_of_Activity
    
    Total estimation                                    Number of obs = 67
    
    ----------------------------------------------------------------------
                         |      Total   Std. err.     [95% conf. interval]
    ---------------------+------------------------------------------------
    duration_of_Activity |       5760   811.5354      4139.717    7380.283
    ----------------------------------------------------------------------
    2) if you type the same after collapsing according to the code you provided, you get the same sample estimate:
    Code:
    . collapse(sum) duration_of_Activity, by(Activity_Cat gender)
    
    . total duration_of_Activity
    
    Total estimation                                     Number of obs = 8
    
    ----------------------------------------------------------------------
                         |      Total   Std. err.     [95% conf. interval]
    ---------------------+------------------------------------------------
    duration_of_Activity |       5760   2230.009      486.8658    11033.13
    ----------------------------------------------------------------------
    
    .
    Kind regards,
    Carlo
    (Stata 19.0)

    Comment


    • #3
      Dear Carlo,
      Thank you very much for the swift response.
      What I wanted is





      Click image for larger version

Name:	Results_support.jpg
Views:	2
Size:	25.9 KB
ID:	1774126


      So ideally if you sum up the duration for the activities per gender it should sum up to 1440(24hrs) but that is not the case here and that is exactly my problem

      Comment


      • #4
        Shamsudini:
        could you please share what you typed and what Stata gave you back (as per FAQ) when running your command? Thanks.
        Kind regards,
        Carlo
        (Stata 19.0)

        Comment


        • #5
          Thank you Carlo.
          This is the command I used

          collapse(sum) duration_of_Activity, by(Activity_Cat gender)

          Comment


          • #6
            Shamsudini:
            sorry for the confusion that my previous reply might have caused.
            I meant what you ran when
            ... the results appear correct,
            Kind regards,
            Carlo
            (Stata 19.0)

            Comment


            • #7
              Awww No worries .
              I want to run the total number of minutes/hours spend per an activity within the 24 hours by Gender just as what I indicated in the attached Image.
              I used the command below:

              collapse(sum) duration_of_Activity, by(Activity_Cat gender)

              and got this results.
              Click image for larger version

Name:	Results_support.jpg
Views:	2
Size:	25.9 KB
ID:	1774150

              I expect that the total number of minutes spent on all activities performed by each gender should add up to 1,440 minutes (24 hours). However, this is not the case in my results
              I need support to streamline this.

              Comment


              • #8
                Shamsudini:
                I would try:
                Code:
                . encode _submission__uuid, g(id)
                
                . total duration_of_Activity, over( id gender )
                
                Total estimation                                                       Number of obs = 67
                
                -----------------------------------------------------------------------------------------
                                                        |      Total   Std. err.     [95% conf. interval]
                ----------------------------------------+------------------------------------------------
                       c.duration_of_Activity@id#gender |
                00440ad1-9918-40c8-bf2a-2ee37468e9bb#1  |       1440    433.595      574.2997      2305.7
                00440ad1-9918-40c8-bf2a-2ee37468e9bb#2  |       1440   446.1358      549.2612    2330.739
                00769122-8180-4dc7-9bde-3c1e0e078649#1  |       1440   369.7933      701.6839    2178.316
                00769122-8180-4dc7-9bde-3c1e0e078649#2  |       1440   396.3252      648.7112    2231.289
                -----------------------------------------------------------------------------------------
                
                .
                Kind regards,
                Carlo
                (Stata 19.0)

                Comment


                • #9
                  Dear Carlo,
                  I apologize for the late reply; I was temporarily offline.

                  Thank you for your great support.

                  However, this is the format I was expecting.
                  Click image for larger version

Name:	Stata Analysis.jpg
Views:	1
Size:	21.8 KB
ID:	1774728



                  Thank once again.

                  Comment


                  • #10
                    Shamsudini:
                    how did you obtain the figures reported in the table you shared?
                    Kind regards,
                    Carlo
                    (Stata 19.0)

                    Comment

                    Working...
                    X