Announcement

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

  • Difference in the estimate between subsample and interaction model

    Hi all

    This question might be stupid but I am really curious.

    Suppose I want to run the following two models. The first is the interaction model with full dataset. The second is the subsample when foreign = 0.


    Code:
    .
    sysuse auto
    reg weight  c.price##i.foreign turn length
    
          Source |       SS           df       MS      Number of obs   =        74
    -------------+----------------------------------   F(5, 68)        =    208.98
           Model |  41400010.4         5  8280002.08   Prob > F        =    0.0000
        Residual |  2694167.97        68  39620.1172   R-squared       =    0.9389
    -------------+----------------------------------   Adj R-squared   =    0.9344
           Total |  44094178.4        73  604029.841   Root MSE        =    199.05
    
    ---------------------------------------------------------------------------------
             weight | Coefficient  Std. err.      t    P>|t|     [95% conf. interval]
    ----------------+----------------------------------------------------------------
              price |    .064213   .0103255     6.22   0.000     .0436088    .0848173
                    |
            foreign |
           Foreign  |  -99.87397   140.4027    -0.71   0.479    -380.0432    180.2953
                    |
    foreign#c.price |
           Foreign  |     -.0246   .0193774    -1.27   0.209    -.0632669     .014067
                    |
               turn |   20.14046   11.44118     1.76   0.083    -2.690055    42.97098
             length |   23.29932   2.314677    10.07   0.000     18.68046    27.91819
              _cons |  -2477.284   308.2764    -8.04   0.000     -3092.44   -1862.128
    ---------------------------------------------------------------------------------
    
    . reg weight  c.price##i.foreign turn length if foreign == 0
    note: 0.foreign omitted because of collinearity.
    note: 0.foreign#c.price omitted because of collinearity.
    
          Source |       SS           df       MS      Number of obs   =        52
    -------------+----------------------------------   F(3, 48)        =    163.81
           Model |  22465799.4         3  7488599.81   Prob > F        =    0.0000
        Residual |  2194267.87        48  45713.9139   R-squared       =    0.9110
    -------------+----------------------------------   Adj R-squared   =    0.9055
           Total |  24660067.3        51  483530.732   Root MSE        =    213.81
    
    ---------------------------------------------------------------------------------
             weight | Coefficient  Std. err.      t    P>|t|     [95% conf. interval]
    ----------------+----------------------------------------------------------------
              price |   .0625345   .0111822     5.59   0.000     .0400512    .0850179
                    |
            foreign |
          Domestic  |          0  (omitted)
                    |
    foreign#c.price |
          Domestic  |          0  (omitted)
                    |
               turn |   17.54976   13.18924     1.33   0.190     -8.96897     44.0685
             length |   24.26179   2.716546     8.93   0.000     18.79981    29.72377
              _cons |  -2548.501   338.2455    -7.53   0.000    -3228.589   -1868.413
    ---------------------------------------------------------------------------------
    Could anyone explain why the coefficient of "Price" is different between the interaction model and subsample analysis? Given the coefficient estimate of "Price" is equal to the slope when foreign = 0. Why this value is different from the one estimated using the subsample?
    Last edited by Jeffery Xu; 24 Oct 2021, 21:47.

  • #2
    That is only true if "turn" and "length" are associated with "weight" in ways that are completely independent by "foreign." Once a sub-sample is created, the confounding relationship among the variables are no longer the same. Perhaps looking at this pair of command may help. In order to recreate the stratified model in an interaction model, everything needs the same interaction term:

    Code:
    sysuse auto, clear
    
    reg weight c.price##i.foreign c.turn##i.foreign c.length##i.foreign
    
    reg weight price turn length if foreign == 0

    Comment

    Working...
    X