Announcement

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

  • Regression issues

    Dear all,

    I'm sorry for my elementary question, but if I have a regression with some dummies, how do I know which is the reference category (because it seems senseless to set all the time, e.g., if female==0).

    reg lwage educ exper expersq occupa union indus female black

    Many thanks.

  • #2
    Rodrigo:
    in a previous today's post William Lisowski wisely pointed you out to the FAQ to increase the effectiveness of your postings. Please take a look. Thanks.
    That said, if you set female=0, you're limiting the effect of that predictor to one of its level only.
    If you want to choose the reference category of your categorical variable(s), please take a look at -fvvarlist- notation helpfile.
    As you can see in the following toy-example, switching the reference category is easy and invoking the -allbaselevels- option gives you the exact perception of what Stata is doing behind the curtain:
    Code:
    . sysuse auto.dta
    (1978 automobile data)
    
    . regress price i.foreign, allbaselevels
    
          Source |       SS           df       MS      Number of obs   =        74
    -------------+----------------------------------   F(1, 72)        =      0.17
           Model |  1507382.66         1  1507382.66   Prob > F        =    0.6802
        Residual |   633558013        72  8799416.85   R-squared       =    0.0024
    -------------+----------------------------------   Adj R-squared   =   -0.0115
           Total |   635065396        73  8699525.97   Root MSE        =    2966.4
    
    ------------------------------------------------------------------------------
           price | Coefficient  Std. err.      t    P>|t|     [95% conf. interval]
    -------------+----------------------------------------------------------------
         foreign |
       Domestic  |          0  (base)
        Foreign  |   312.2587   754.4488     0.41   0.680    -1191.708    1816.225
                 |
           _cons |   6072.423    411.363    14.76   0.000     5252.386     6892.46
    ------------------------------------------------------------------------------
    
    . regress price ib1.foreign, allbaselevels
    
          Source |       SS           df       MS      Number of obs   =        74
    -------------+----------------------------------   F(1, 72)        =      0.17
           Model |  1507382.66         1  1507382.66   Prob > F        =    0.6802
        Residual |   633558013        72  8799416.85   R-squared       =    0.0024
    -------------+----------------------------------   Adj R-squared   =   -0.0115
           Total |   635065396        73  8699525.97   Root MSE        =    2966.4
    
    ------------------------------------------------------------------------------
           price | Coefficient  Std. err.      t    P>|t|     [95% conf. interval]
    -------------+----------------------------------------------------------------
         foreign |
       Domestic  |  -312.2587   754.4488    -0.41   0.680    -1816.225    1191.708
        Foreign  |          0  (base)
                 |
           _cons |   6384.682   632.4346    10.10   0.000     5123.947    7645.417
    ------------------------------------------------------------------------------
    
    .
    In addition, getting yourself familiar with -fvvarlist- notation avoids creating interaction by hand, as in your code above:
    Code:
    exper expersq
    Please note that when you ignore -fvvarlist- notation you cannot exploit the wonderful capabiities of -margins- and -marginsplot-, because Stata consider -exper- and -expersq- as two different variables.
    The most convenient notation for interactions is:
    Code:
    c.exper##c.exper
    Kind regards,
    Carlo
    (StataNow 18.5)

    Comment

    Working...
    X