Announcement

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

  • Controlling for both level and difference in variables between partners

    Using panel data, I'd like to measure the effect of life satisfaction in couples on generated wealth. To date, I've been using a variable that measures the difference in the level of life satisfaction between partners in which I take the absolute difference
    Code:
    gen byte satdiff = abs(losat1 - losat2)
    Where 'losat' ranges from 0 (completely dissatisfied) to 5 (neither disatisfied/satisfied) to 10 (completely satisfied) and '1' refers to male, '2' refers to female.

    However, the difference variable does not take account of couples in which both parters were completely dissatisfied so I want to take account of the effect of both the level and difference in life satisfaction in couples. I have tried including both the level and difference variables in the regression (c.losat1 c.losat2 and satdiff), but in doing so, the difference variable is no longer significant - potentially due to being correlated with the level variables. Ideas appreciated.

    Code:
    xtreg c.wealth2r i.at3 c.hgage1 c.hgage2 c.satdiff c.lincr
    Data sample:
    Code:
    * Example generated by -dataex-. To install: ssc install dataex
    clear
    input float wealth2r byte at3 int(hgage1 hgage2) byte(losat1 losat2 satdiff) float incr
    1070211.4 0 37 38  6  9 3  100396.3
     877808.4 0 55 41  6  6 0 101745.04
     20581.24 0 22 19  8  8 0 11889.035
    1235545.5 0 57 55  9  7 2  163804.5
     706076.6 0 34 33  8  9 1  20475.56
      43163.8 0 36 34  8  6 2  46235.14
     231907.5 0 52 50  5  7 2  40026.42
    241455.73 0 45 47  7  7 0 154198.14
     428661.8 0 44 50  9  6 3 123117.56
     85898.28 0 35 34  6  5 1  64729.19
     5200.792 0 30 27  8  7 1  50858.65
    137582.56 0 34 33  9  8 1  81638.04
     813474.2 0 57 54  9  6 3  138705.4
     170805.8 0 26 23  8  9 1 121532.36
     567063.4 0 49 44  9  9 0 127381.77
     44696.17 0 37 28  3  5 2  51630.12
      2583231 0 60 53  9  9 0 116248.34
     99077.94 0 37 31  6  7 1  85865.26
    2716578.5 0 40 36  7  8 1  524001.3
    131933.94 0 27 27  8  8 0 123972.26
     98414.79 0 46 39  6  4 2  57595.77
     94433.29 0 32 30  7  9 2  94731.84
     98857.33 0 21 21  8  9 1 16512.549
     415455.7 0 41 35  9 10 1  37384.41
    end

  • #2
    Chris:
    why not considering the issue from the opposite side, that is in additive instead of subtractive terms:
    Code:
     g try_it= losat1 + losat2
    This way, you create a categorical predictor that allows -los1=0- and -los2=0- in the same couple.
    Kind regards,
    Carlo
    (StataNow 18.5)

    Comment


    • #3
      Thank you Carlo Lazzaro. That's a very good idea and removes the need to include 'losat' separately for each partner.

      I believe there is also identifying the effect of differences as it is expected to give rise to conflict in relationships. I tried creating a variable with up to three-levels of difference but Stata advises my syntax is invalid - any suggestions how I can address this?
      Code:
      gen byte satdiff1 = 0 if abs(losat1 - losat2) = 0 // same level  
      replace satdiff1 = 1 if abs(losat1 - losat2) = 1 // 1 level diff
      replace satdiff1 = 2 if abs(losat1 - losat2) = 2 // 2 level diff
      replace satdiff1 = 3 if abs(losat1 - losat2) = 3 // 3 level diff
      Stata v.15.1. Running panel data.
      Last edited by Chris Boulis; 07 Feb 2022, 06:42.

      Comment


      • #4
        Chris:
        it might be an issue of a missing double = sign after the -if- clause:
        Code:
        . use "C:\Program Files\Stata17\ado\base\a\auto.dta"
        (1978 automobile data)
        
        
        . gen price2=1 if (price-mpg)==100
        (74 missing values generated)
        
        . gen price3=1 if (price-mpg)=100
        invalid syntax
        r(198);
        
        .
        Last edited by Carlo Lazzaro; 07 Feb 2022, 08:02.
        Kind regards,
        Carlo
        (StataNow 18.5)

        Comment


        • #5
          Yes, that's it - I can't believe I didn't see that. Thank you Carlo Lazzaro.

          Comment

          Working...
          X