Announcement

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

  • How to tell which dummy is for which region if I create region dummies using i.region?

    My code goes like this: reg occ wage i.region

  • #2
    this would be easier to answer if you followed the advice in the FAQ and showed the results within CODE blocks (see the FAQ); you can make things easier on yourself by (1) ensuring that you label the categories and (2) using the allbase option

    Comment


    • #3
      Enlarging on Rich's answer, the code below demonstrates a meaningless regression of automobile price on one continuous variable - weight - and two categorical variables - foreign, which has value labels "Domestic" and "Foreign" - and rep78, which has no value labels. In the regression output you can see that foreign shows the labels and rep78 shows the values.
      Code:
      . sysuse auto, clear
      (1978 Automobile Data)
      
      . codebook foreign rep78
      
      -----------------------------------------------------------------------------------------------
      foreign                                                                                Car type
      -----------------------------------------------------------------------------------------------
      
                        type:  numeric (byte)
                       label:  origin
      
                       range:  [0,1]                        units:  1
               unique values:  2                        missing .:  0/74
      
                  tabulation:  Freq.   Numeric  Label
                                  52         0  Domestic
                                  22         1  Foreign
      
      -----------------------------------------------------------------------------------------------
      rep78                                                                        Repair Record 1978
      -----------------------------------------------------------------------------------------------
      
                        type:  numeric (int)
      
                       range:  [1,5]                        units:  1
               unique values:  5                        missing .:  5/74
      
                  tabulation:  Freq.  Value
                                   2  1
                                   8  2
                                  30  3
                                  18  4
                                  11  5
                                   5  .
      
      . regress price weight i.foreign i.rep78, allbase
      
            Source |       SS           df       MS      Number of obs   =        69
      -------------+----------------------------------   F(6, 62)        =     10.38
             Model |   288985161         6  48164193.5   Prob > F        =    0.0000
          Residual |   287811798        62  4642125.77   R-squared       =    0.5010
      -------------+----------------------------------   Adj R-squared   =    0.4527
             Total |   576796959        68  8482308.22   Root MSE        =    2154.6
      
      ------------------------------------------------------------------------------
             price |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
      -------------+----------------------------------------------------------------
            weight |   3.392021    .436278     7.77   0.000     2.519914    4.264128
                   |
           foreign |
         Domestic  |          0  (base)
          Foreign  |   3530.574   852.8057     4.14   0.000     1825.839    5235.308
                   |
             rep78 |
                1  |          0  (base)
                2  |   542.3997   1706.922     0.32   0.752     -2869.69    3954.489
                3  |   836.6638   1580.637     0.53   0.598    -2322.985    3996.312
                4  |    521.878   1650.986     0.32   0.753    -2778.396    3822.152
                5  |   1096.374   1759.422     0.62   0.535    -2420.661    4613.409
                   |
             _cons |  -5950.765   2037.208    -2.92   0.005    -10023.09   -1878.444
      ------------------------------------------------------------------------------

      Comment


      • #4
        Thank both of you very much!

        Comment


        • #5
          Building off on this question, is it possible to ask stata to exclude a different category in i.region or i.rep78? For example, how would I exclude i.rep78 #2 and use that as a base, instead of its current default which excludes i.rep78 #1?

          Comment


          • #6

            For anyone who faces the same issue, its: regress price weight i.foreign ib2.rep78

            Comment

            Working...
            X