Announcement

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

  • Possible to put interaction terms of X and indictors of Y quintile in a regression?

    Dear Statalist users,

    I am wondering if I would estimate a regression like this:

    Y = X + X * Y_Q2 + X * Y_Q3 + X * Y_Q4 + X * Y_Q5 + Y_Q2 + Y_Q3 +Y_Q4 + Y_Q5

    Y_Q2 is an indicator variable of whether Y is in the 2nd quintile of the sample, and Y_Q3-5 is defined similarly.

    In other words, I want to put interaction terms of X and indictors of Y quintile.

    The reason I want to put interaction terms of X and Y quintile is that I suspect the relationship between Y and X is non-linear and I want to see how the coefficients changes as Y changes.

    The reason I don’t flip Y and X (that is, making Y the independent variable and X the dependent variable) is that it is the convention in the literature that Y is the dependent variable.

    Technically I can run the regression. But I am wondering if there is any problem econometrics-wise.

    I would appreciate any comments/advices. Thank you so much!

  • #2
    Jessica, your model suffers from the issue of endogeneity. There are at least two alternatives.

    First, you may pick an exogenous and major predictor of Y, and interact X with this predictor.

    Second, you may directly estimate quantile regressions.

    Code:
    sqreg y x, q(0.2 0.4 0.6 0.8 0.99)

    Comment


    • #3
      Thank you so much, Fei, for your reply.

      However, I think that quantile regression is different from what I want.

      Taking this example that I found on the Web:

      "What is the relationship between total household income and the proportion of income that is spent on food? Engel's law is an observation in economics stating that as income rises, the proportion of income spent on food falls, even if absolute expenditure on food rises. Applying quantile regression to these data, you can determine which food expense can cover 90% of families (for 100 families with a given income) when not interested in the mean food expense."

      So my understanding is that quantile regression gives us the equation for the n-th quantile of Y conditional on X.

      However, what I want is to see how the coefficient changes as Y changes (in other words, I want the quantile of Y unconditional on X - that is, the sample quantile of Y).

      I would appreciate any advice/suggestion.

      Comment


      • #4
        Jessica, I'll show, with the example below, that quantile regressions may essentially be consistent with what you are looking for. The example estimates the effects of years of education on different quantiles of wage.

        Code:
        . sysuse nlsw88, clear
        (NLSW, 1988 extract)
        
        . 
        . sqreg wage grade, q(0.2 0.4 0.6 0.8)
        (fitting base model)
        
        Bootstrap replications (20)
        ----+--- 1 ---+--- 2 ---+--- 3 ---+--- 4 ---+--- 5 
        ....................
        
        Simultaneous quantile regression                    Number of obs =      2,244
          bootstrap(20) SEs                                 .20 Pseudo R2 =     0.0532
                                                            .40 Pseudo R2 =     0.0944
                                                            .60 Pseudo R2 =     0.1197
                                                            .80 Pseudo R2 =     0.0977
        
        ------------------------------------------------------------------------------
                     |              Bootstrap
                wage |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
        -------------+----------------------------------------------------------------
        q20          |
               grade |   .4025764   .0337389    11.93   0.000     .3364137    .4687392
               _cons |  -.8051524   .4091921    -1.97   0.049    -1.607587   -.0027175
        -------------+----------------------------------------------------------------
        q40          |
               grade |   .5999937    .033391    17.97   0.000     .5345133    .6654741
               _cons |  -1.974172   .4104244    -4.81   0.000    -2.779024   -1.169321
        -------------+----------------------------------------------------------------
        q60          |
               grade |   .7497983   .0264552    28.34   0.000      .697919    .8016776
               _cons |  -2.318838   .3365347    -6.89   0.000     -2.97879   -1.658886
        -------------+----------------------------------------------------------------
        q80          |
               grade |   .8776171   .0680925    12.89   0.000     .7440861    1.011148
               _cons |  -1.755242    .839942    -2.09   0.037    -3.402388   -.1080971
        ------------------------------------------------------------------------------
        The results show that an additional year of education is associated with a $0.40 increase in hourly wage for those whose wage is at the bottom 20%. Similarly, one more year of education is associated with a $0.88 wage increase for those whose wage is at the top 20%. Therefore, the effects of education on wage differ by the quantile of wage -- In this case, the returns to education are greater for those with higher wage. Wouldn't that be what you're looking for?

        Comment


        • #5
          Thanks so much again, Fei. I really appreciated it.

          Let me explain what I mean.

          Take this example:

          Click image for larger version

Name:	download.png
Views:	1
Size:	5.4 KB
ID:	1671850

          My understanding is that quantile regression gives us the equation for the n-th quantile of Y conditional on X. Even at the lower end of X (and Y), there are quantiles 0.1, 0.5 and 0.9. However, those data points are all lower quantiles (maybe just quantile 0.1) if we consider the overall sample.

          What I want to show is that at the lower quantiles of Y, X and Y are positively correlated; and at the higher quantiles of Y, they become negatively correlated.

          Comment

          Working...
          X