Announcement

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

  • Interactions with a 2x2 matrix

    Dear all,

    I am trying to test the interaction between individuals with low qualifications and training and measure the impact of those variables on wages. Essentially, I want to create a 2x2 matrix that has 4 coefficients showing the impact on wages of those with high/low qualifications and those with high/low training. Then, I would be able to see which group benefits from education/training more. However, when I run a simple interaction command, " xtreg wages low_edu##training", not only does it omit the interaction itself, but also I am not sure if I have done it correctly - it certainly is not what I want to achieve (please see the image attached). Could someone please advice how I can execute interaction between 4 groups properly and create a 2x2 matrix with (high/low edu and high/low training)? Thank you very much in advance!
    Click image for larger version

Name:	interactions.png
Views:	2
Size:	168.0 KB
ID:	1651386

  • #2
    Guest:
    1) omission due to collinearity is simpe a matter of fact.
    That said, it's my habit (that however cannot change the situation you're experiencing) to code up as follows:
    Code:
    xtreg wages i.low_edu##i.training
    2) with >250,000 observations, -vce(cluster panelid)- (or -robust-) is almost mandatory;
    3) you have a very low between R-sq, that in all likelihood implies the misspecification of your regression;
    4) what does -xtttest0- outcome tell you about the evidence of a panel-wise effect?;
    5) more substantively, in all likelihood your regression suffer from latent variable-led endogeneity, as individual ability is not included in the right hand-side of your regression equation: on average, other things being equal, smarter persons make the most of out of training (and education) and are able to negotiate higher wages.
    Last edited by sladmin; 25 Apr 2022, 08:30. Reason: anonymize original poster
    Kind regards,
    Carlo
    (StataNow 18.5)

    Comment


    • #3
      Thank you Carlo Lazzaro for this! Is there any way I can fix it? The Understanding Society longitudinal panel data does not have information on individual ability, nor parental background. So I am not sure what to do

      Comment


      • #4
        Also, let's say I want to test the interaction between gender and education or gender and training, STATA only gives me one coefficient. Is it possible to break it down further to male vs female and training vs no training, such that 2x2 matrix can be created using the interaction coefficients? Carlo Lazzaro Thank you in advance!

        Comment


        • #5
          Guest:
          I try to reply to both your questions here:
          1) in thei valuable textbook
          https://www.stata.com/bookstore/microeconometrics-stata, authors used proximity to college as in instrument to deal with latent variable-led endogeneity (pages 177-9).

          2) you should go (with the usual complextity that a three-way interaction brings about):
          Code:
          xtreg wages i.low_edu##i.training##i.gender, vce(cluster panelid)
          Last edited by sladmin; 25 Apr 2022, 08:30. Reason: anonymize original poster
          Kind regards,
          Carlo
          (StataNow 18.5)

          Comment


          • #6
            thank you very much for your time and valuable advice! Carlo Lazzaro

            Comment


            • #7
              Dear Carlo Lazzaro, when I use the code
              i.training##i.gender I only get the results for females, but not males, although my sample includes both. Is there any reason/remedy to this issue?

              Comment


              • #8
                Guest:
                imposing the -allbaselevels- (as in the following toy-example) option may make things clearer:
                Code:
                . use "https://www.stata-press.com/data/r17/nlswork.dta"
                (National Longitudinal Survey of Young Women, 14-24 years old in 1968)
                
                . xtreg ln_wage i.race##i.collgrad, re vce(cluster idcode) allbaselevels
                
                Random-effects GLS regression                   Number of obs     =     28,534
                Group variable: idcode                          Number of groups  =      4,711
                
                R-squared:                                      Obs per group:
                     Within  = 0.0000                                         min =          1
                     Between = 0.2134                                         avg =        6.1
                     Overall = 0.1339                                         max =         15
                
                                                                Wald chi2(5)      =    1313.85
                corr(u_i, X) = 0 (assumed)                      Prob > chi2       =     0.0000
                
                                              (Std. err. adjusted for 4,711 clusters in idcode)
                -------------------------------------------------------------------------------
                              |               Robust
                      ln_wage | Coefficient  std. err.      z    P>|z|     [95% conf. interval]
                --------------+----------------------------------------------------------------
                         race |
                       White  |          0  (base)
                       Black  |  -.1105697   .0125092    -8.84   0.000    -.1350873   -.0860521
                       Other  |   .0694423    .069099     1.00   0.315    -.0659893    .2048739
                              |
                     collgrad |
                           0  |          0  (base)
                           1  |   .4222334    .015344    27.52   0.000     .3921598    .4523071
                              |
                race#collgrad |
                     White#0  |          0  (base)
                     White#1  |          0  (base)
                     Black#0  |          0  (base)
                     Black#1  |   .1682684   .0324927     5.18   0.000     .1045838     .231953
                     Other#0  |          0  (base)
                     Other#1  |   .0708036   .1332873     0.53   0.595    -.1904347    .3320419
                              |
                        _cons |   1.596917    .007005   227.97   0.000     1.583188    1.610647
                --------------+----------------------------------------------------------------
                      sigma_u |  .33326304
                      sigma_e |  .32028665
                          rho |  .51984742   (fraction of variance due to u_i)
                -------------------------------------------------------------------------------
                
                .
                The issue is that a reference category is needed (and the -nocons- option is not supported by -xtreg-).
                Last edited by sladmin; 25 Apr 2022, 08:31. Reason: anonymize original poster
                Kind regards,
                Carlo
                (StataNow 18.5)

                Comment


                • #9
                  thank you very much, Carlo Lazzaro, for all your help! It is truly invaluable

                  Comment

                  Working...
                  X