Announcement

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

  • Comparison of predicted values after OLS regression

    Dear all,

    I am interested in predicted values after an OLS regression. Moreover, I am curious how these vary across groups (number of groups varies from 2-3, depending on the dimension). I would like to perform this via a significance test. The intuition is that,

    H0: yhat_1 = yhat_2 v.s. H1: yhat_1 uneq yhat_2

    t (or z) = (yhat_1 - yhat_2) /(sqrt(var_1 + var_2)

    And now three questions:

    1. Is this intuition right?
    2. If yes, is there a pre build option to omplement this test.
    3. And how do I perform the joint hypothesis that all three predictions are equal?

    Below a minimal working example.

    Thank you very much.

    Daniel

    ******************************************* MWE ************************************************** *******

    sysuse auto, clear

    xtile price_cat = price, nquantiles(3)

    reg displacement mpg if price_cat == 1
    lincom _cons + mpg*20
    reg displacement mpg if price_cat == 2
    lincom _cons + mpg*20
    reg displacement mpg if price_cat == 3
    lincom _cons + mpg*20

    **** Significance of difference between groups

    * e.g. via test

  • #2
    Daniel:
    you may want to take a look at: https://stats.idre.ucla.edu/stata/co...s-using-suest/
    Kind regards,
    Carlo
    (Stata 19.0)

    Comment


    • #3
      Dear Carlo,

      thank you for your suggestion. II was already familiar with that. But I did not know about the possibility of testing more involved hypotheses.

      My approach now looks as follows:

      sysuse auto, clear

      xtile price_cat = price, nquantiles(3)

      reg displacement mpg if price_cat == 1
      est store cat1
      reg displacement mpg if price_cat == 2
      est store cat2
      reg displacement mpg if price_cat == 3
      est store cat3

      **** Significance of difference between groups

      suest cat1 cat2 cat3
      test ([cat1_mean]_cons + [cat1_mean]mpg*20) = ([cat2_mean]_cons + [cat2_mean]mpg*20)
      test ([cat3_mean]_cons + [cat3_mean]mpg*20) = ([cat2_mean]_cons + [cat2_mean]mpg*20), accum



      ************************************************** **********

      Thanks so far

      Daniel


      Comment


      • #4
        Daniel:
        your approach makes sense.
        What else are you after?
        Kind regards,
        Carlo
        (Stata 19.0)

        Comment


        • #5
          Dear Carlo,

          I am okay. I just wanted to double check. Thank you very much.

          Best

          Daniel

          Comment

          Working...
          X