Announcement

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

  • Descriptive Statistics at Baseline

    Hi,
    Suppose I have two waves of a survey. I make use of a DID.


    The treatment is whether a particular HH_member passed away by wave 2.
    I restricted the sample to those respondents living with that hh member in wave 1.
    The treatment dummy takes the value 0 if HH-member is alive and 1 if the HH member died.
    Post takes value 0 if the observation is in wave 1 and takes value 1 if in wave 2.

    The regression I run to get DID output is
    Code:
    reg outcome i.HH_member_died##i.post $controls $FE , cl(var)

    I try to look at the descriptive statistics of two groups at the baseline to see if any statistical difference exists at the baseline between them.
    1) respondents for whom the hh_member was alive in wave1 but passed away by wave2
    2) respondents for whom the hh_member was alive in wave 1 and remained alive even in wave 2.

    I run the following command
    Code:
    keep post==0
    ttest outcome, by(HH_memeber_died)
    But this shows the difference between groups for whom the HH_member was died and alive in wave 1. Not the difference between these two groups in wave 1 for whom the HH_member passed away in wave2 and the other did not.

    How can I get that?


    Code:
    Code:
    * Example generated by -dataex-. To install: ssc install dataex
    clear
    input double BMI_survey float(HH_member_died post)
    25.4386425018 0 0
    16.9948692322 0 0
    30.0425415039 0 0
    29.6986141205 1 1
    26.7642993927 1 1
    20.6010570526 0 1
    25.5052757263 1 1
    23.8579883576 0 1
    22.4769897461 0 0
    21.7111110687 0 0
    20.8466835022 0 0
    25.7420845032 0 0
    17.8782272339 0 0
    25.3662319183 1 1
    22.0370044708 0 1
    19.8885383606 0 0
    21.9642086029 0 1
    29.1248645783 1 1
                . 1 1
    20.7804164887 1 1
     19.079946518 0 0
    29.4948539734 0 0
     21.731502533 0 0
    24.1133422852 0 0
    14.3230552673 1 1
    23.4682006836 0 1
     21.426651001 1 1
    19.5180568695 0 1
      22.80884552 1 1
    27.1408443451 1 1
    33.8613395691 0 0
     21.102804184 0 0
    21.5114250183 0 0
    21.3299102783 1 1
     23.688167572 1 0
    31.5484447479 1 1
    26.3711357117 1 1
    28.5294895172 0 0
    22.6051673889 1 1
    22.8827972412 1 0
    18.0570392609 1 0
      21.54296875 0 1
    17.9458408356 0 1
    29.5692863465 0 1
     20.625705719 1 1
    22.8537845612 1 0
    20.0530490875 1 1
    25.8380050659 1 1
    24.6478939057 0 1
    21.3943805695 0 0
    28.6160259247 0 0
    25.1688022614 0 0
    17.9838981629 0 0
    26.0739994049 1 1
    21.6328411102 1 1
    21.1121730805 1 1
    26.4681358338 0 1
     24.112241745 0 1
    24.8491153717 0 0
    20.7447032929 0 0
    21.5888004303 1 0
    25.0364208222 0 0
    24.9698143005 0 1
    24.6674957276 0 1
    18.8573570252 1 1
    17.0916538239 1 1
    18.9992809296 1 1
    13.7701473236 1 1
    30.8436298371 0 0
    23.0513725281 1 0
    24.9562129974 1 1
    23.4150829315 1 1
    23.6802539826 1 1
    39.5971870423 0 0
    24.2142925263 1 0
    28.9832057953 1 1
        25.234375 1 0
    34.2484893799 1 1
    21.8441505432 0 1
    34.4006996155 0 0
    21.1394233704 0 0
    32.6331367493 0 0
    26.7796020508 1 1
    25.7466068268 1 1
    21.3556995392 0 1
    29.2932777405 1 1
    23.8346385956 0 0
    30.2977848053 0 0
    24.3925933838 0 1
    30.3410663605 1 0
    22.2304401398 1 0
    20.5079307556 0 0
    23.6710567474 1 0
    24.0117797852 1 0
    20.9045200348 1 1
     26.642944336 0 1
    21.9777774811 0 0
    17.3138198853 0 0
    25.1688022614 1 0
    23.3634643555 0 0
    end
    ------------------ copy up to and including the previous line ------------------

  • #2
    Categorize each id into two longitudinal patterns: 1) those with hh_member_died = 0, 0; 2) those with hh_member_died = 0, 1. There are perhaps many methods, I'd just show one:

    Code:
    egen will_die = max(hh_member_died), by(id)
    The proceed to keep only first wave and use "will_die" as the group variable.

    Comment


    • #3
      Thank You for your help.

      Comment


      • #4
        However, there is an issue.

        HH_member_died is a dummy indicating if hh_member is dead(1 for dead;0 for alive), but doesnt mention which period they died.

        Since its a consolidated dataset the HH-member could have been dead in wave 1 also. So the max value will be one even if I restrict the sample to wave 1( will_die will be 1 if they had died in wave 1 also).
        Here the 1 doesn't indicate that they were alive in wave 0 but died in wave 2.

        see highlighted example for whta I mean.

        What I need is two groups
        1)alive in wave 1, but died in wave 2
        2) alive in wave one, remained alive in wave2


        Code:
        Code:
        * Example generated by -dataex-. To install: ssc install dataex
        clear
        input double idperson float(HH_member_died post will_die)
        101020102009 1 1 1
        101020103002 1 1 1
        101020105003 1 1 1
        101020116004 0 0 0
        101020120004 0 1 0
        101020206004 0 1 0
        101020207004 0 0 0
        101020214002 0 0 0
        101020215002 0 0 0
        101020216002 1 1 1
        101020217002 0 0 0
        101020220002 1 1 1
        101020310004 0 1 0
        101020305002 1 1 1
        101020306009 0 1 0
        101020314004 0 0 0
        101020316002 1 1 1
        101020319004 1 1 1
        101020404002 1 1 1
        101020408004 0 0 0
        101020409002 1 0 1
        101020417011 0 0 0
        101020504004 0 1 0
        101020507004 0 0 0
        101020512003 1 0 1
        101020515002 1 0 1
        101020603002 1 1 1
        101020604002 1 1 1
        101020606002 0 0 0
        101020611002 1 1 1
        101020612004 0 0 0
        101020615004 0 1 0
        101020701002 0 1 0
        101020702002 0 0 0
        101020706004 0 0 0
        101020707002 1 1 1
        101020710002 1 1 1
        101020712002 1 1 1
        101020803003 1 0 1
        101020806002 1 1 1
        101020807002 1 1 1
        101020812002 0 0 0
        101030101004 0 1 0
        101030102002 1 0 1
        101030104002 1 1 1
        101030105003 0 1 0
        101030109004 0 0 0
        101030202002 1 1 1
        101030205004 0 0 0
        101030207002 1 1 1
        101030214002 0 0 0
        101030311004 0 1 0
        101030315004 1 0 1
        101030411002 1 0 1
        101030412002 1 1 1
        101030414002 0 0 0
        101030501004 0 0 0
        101030502008 0 0 0
        101030506003 1 1 1
        101030507002 1 1 1
        101030508002 1 1 1
        101030513002 1 1 1
        101030609004 0 0 0
        101030713002 1 0 1
        101030801004 0 1 0
        101030802004 0 0 0
        101030807004 0 0 0
        101030815002 1 1 1
        101030908002 0 0 0
        101030911002 0 1 0
        101030913002 1 1 1
        101050101004 0 1 0
        101050102002 0 0 0
        101050103002 1 1 1
        101050105002 1 1 1
        101050109002 1 1 1
        101050111004 0 1 0
        101050114002 1 1 1
        101050116002 1 0 1
        101050117002 1 0 1
        101050118002 0 0 0
        101050202002 0 1 0
        101050203009 0 1 0
        101050205002 0 1 0
        101050206010 0 1 0
        101050208002 1 1 1
        101050211003 1 1 1
        101050212002 0 0 0
        101050216002 0 1 0
        101050218004 0 1 0
        101050409002 0 0 0
        101050413011 0 1 0
        101050415003 1 0 1
        101050418002 1 1 1
        101050501002 1 1 1
        101050505002 1 1 1
        101050508002 0 0 0
        101050509004 0 0 0
        101050510002 1 1 1
        101050610002 0 1 0
        end

        Comment

        Working...
        X