Announcement

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

  • suppress omitted variables

    Is that a way to suppress omitted variables in the regression output?

  • #2
    if you look at the help file for regress you will see that one of the options in "noomitted"

    Comment


    • #3
      There are all sorts of cutesy display options that many people may not know about. From within Stata type

      help estimation options##display_options
      -------------------------------------------
      Richard Williams, Notre Dame Dept of Sociology
      StataNow Version: 19.5 MP (2 processor)

      EMAIL: [email protected]
      WWW: https://www3.nd.edu/~rwilliam

      Comment


      • #4
        As Richard said, there is a lot of ways to do it, I'll just give you one among others, which I find very simple:

        If you use the outreg package (ssc install outreg), it automatically deletes the omitted variables.
        See the example below :

        Code:
        sysuse auto.dta,clear
        gen MPG=mpg
        
        reg price mpg MPG weight length i.foreign
        outreg
        There is two types of omitted variables : MPG (collinear to mpg), and 0.foreign (base case)
        They both don't appear in the outreg table output.

        Comment


        • #5
          Richard, it worked for a linear regression but it's not working for a probit. I checked and it shows as an option on help.
          Do you know what could I do?

          Comment


          • #6
            Originally posted by Charlie Joyez View Post
            As Richard said, there is a lot of ways to do it, I'll just give you one among others, which I find very simple:

            If you use the outreg package (ssc install outreg), it automatically deletes the omitted variables.
            See the example below :

            Code:
            sysuse auto.dta,clear
            gen MPG=mpg
            
            reg price mpg MPG weight length i.foreign
            outreg
            There is two types of omitted variables : MPG (collinear to mpg), and 0.foreign (base case)
            They both don't appear in the outreg table output.


            Charlie, I use outreg2 and is not omitting. With noomit option I was able to suppress the omitted variables in the linear regression, but not in the probit.

            Do you know if the outreg2 should work as you described?

            Comment


            • #7
              Felipe, can you show your code and output? I have no problem with the following:

              Code:
              . webuse nhanes2f, clear
              
              . gen agex = age
              
              . probit diabetes i.race age agex, nolog
              note: agex omitted because of collinearity
              
              Probit regression                               Number of obs     =     10,335
                                                              LR chi2(3)        =     376.66
                                                              Prob > chi2       =     0.0000
              Log likelihood =  -1810.737                     Pseudo R2         =     0.0942
              
              ------------------------------------------------------------------------------
                  diabetes |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
              -------------+----------------------------------------------------------------
                      race |
                    Black  |   .3586926   .0639377     5.61   0.000      .233377    .4840082
                    Other  |   .0702952   .1698809     0.41   0.679    -.2626652    .4032557
                           |
                       age |   .0271569   .0016295    16.67   0.000     .0239631    .0303506
                      agex |          0  (omitted)
                     _cons |  -3.168549    .097815   -32.39   0.000    -3.360263   -2.976835
              ------------------------------------------------------------------------------
              
              . probit, noomitted
              
              note: agex omitted because of collinearity
              
              Probit regression                               Number of obs     =     10,335
                                                              LR chi2(3)        =     376.66
                                                              Prob > chi2       =     0.0000
              Log likelihood =  -1810.737                     Pseudo R2         =     0.0942
              
              ------------------------------------------------------------------------------
                  diabetes |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
              -------------+----------------------------------------------------------------
                      race |
                    Black  |   .3586926   .0639377     5.61   0.000      .233377    .4840082
                    Other  |   .0702952   .1698809     0.41   0.679    -.2626652    .4032557
                           |
                       age |   .0271569   .0016295    16.67   0.000     .0239631    .0303506
                           |
                     _cons |  -3.168549    .097815   -32.39   0.000    -3.360263   -2.976835
              ------------------------------------------------------------------------------
              
              .
              -------------------------------------------
              Richard Williams, Notre Dame Dept of Sociology
              StataNow Version: 19.5 MP (2 processor)

              EMAIL: [email protected]
              WWW: https://www3.nd.edu/~rwilliam

              Comment


              • #8
                Also, using outreg after the above probit command,

                Code:
                . outreg
                
                                                                              -----------------------
                                                                                          diabetes  
                                                                              -----------------------
                                                                               2bn.race     0.359   
                                                                                          (5.61)**  
                                                                               3.race       0.070   
                                                                                           (0.41)   
                                                                               age          0.027   
                                                                                          (16.67)** 
                                                                               _cons       -3.169   
                                                                                          (32.39)** 
                                                                               N           10,335   
                                                                              -----------------------
                                                                                * p<0.05; ** p<0.01
                Make sure both your Stata and outreg are up to date.
                -------------------------------------------
                Richard Williams, Notre Dame Dept of Sociology
                StataNow Version: 19.5 MP (2 processor)

                EMAIL: [email protected]
                WWW: https://www3.nd.edu/~rwilliam

                Comment


                • #9
                  Richard,

                  This is my code:
                  Code:
                  probit pr_ann_mf_b5 neg_abn_ret roe invest bm  i.famafrench,  noomit
                  outreg2 using Results/neg_abn_ret.doc, replace drop(i.famafrench i.year) addtext(famafrench FE, YES, Year FE, NO) label sortvar(neg_EPS dec_EPS neg_abn_ret per_neg_EPS_lag EPS_lag bm roe   invest)
                  and this is my output
                  Code:
                  Probit regression                                 Number of obs   =     116824
                                                                    LR chi2(48)     =   11288.79
                                                                    Prob > chi2     =     0.0000
                  Log likelihood = -32658.562                       Pseudo R2       =     0.1474
                  
                  -----------------------------------------------------------------------------------------------------------
                                               pr_ann_mf_b5 |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
                  ------------------------------------------+----------------------------------------------------------------
                                                neg_abn_ret |   .0957623   .0110479     8.67   0.000     .0741088    .1174158
                                                        roe |  -.0001225   .0004602    -0.27   0.790    -.0010246    .0007796
                                                     invest |  -.4996485   .0482086   -10.36   0.000    -.5941356   -.4051615
                                                         bm |   .0000619   .0000845     0.73   0.464    -.0001037    .0002275
                                                            |
                                                 famafrench |
                                             Food Products  |    .375864    .136024     2.76   0.006     .1092619     .642466
                                              Candy & Soda  |  -.0283262   .1869872    -0.15   0.880    -.3948144    .3381621
                                             Beer & Liquor  |          0  (empty)
                                          Tobacco Products  |          0  (empty)
                                                Recreation  |   .5777728   .1447374     3.99   0.000     .2940926    .8614529
                                             Entertainment  |  -.0610995   .1453499    -0.42   0.674      -.34598    .2237811
                                   Printing and Publishing  |   .9284005   .1429658     6.49   0.000     .6481926    1.208608
                                            Consumer Goods  |    .749213   .1349509     5.55   0.000      .484714    1.013712
                                                   Apparel  |   1.227236   .1332618     9.21   0.000     .9660475    1.488424
                                                Healthcare  |   .3732487    .134991     2.76   0.006     .1086713    .6378262
                                         Medical Equipment  |   .5749243   .1299982     4.42   0.000     .3201326     .829716
                                   Pharmaceutical Products  |  -.1606609   .1299033    -1.24   0.216    -.4152668    .0939449
                                                 Chemicals  |   .5568309   .1322014     4.21   0.000      .297721    .8159408
                               Rubber and Plastic Products  |    .634768   .1448521     4.38   0.000     .3508631    .9186729
                                                  Textiles  |   .1905553   .1822339     1.05   0.296    -.1666166    .5477271
                                    Construction Materials  |   .2655091   .1365862     1.94   0.052     -.002195    .5332132
                                              Construction  |   .3477615   .1382199     2.52   0.012     .0768556    .6186675
                                           Steel Works Etc  |   .6944669   .1359109     5.11   0.000     .4280864    .9608474
                                       Fabricated Products  |  -.3374416   .2580371    -1.31   0.191    -.8431849    .1683018
                                                 Machinery  |   1.016925   .1299521     7.83   0.000     .7622239    1.271627
                                      Electrical Equipment  |   .5314113   .1333215     3.99   0.000     .2701059    .7927167
                                    Automobiles and Trucks  |  -.1376255   .1449173    -0.95   0.342    -.4216582    .1464071
                                                  Aircraft  |   .1751449   .1602928     1.09   0.275    -.1390233     .489313
                          Shipbuilding, Railroad Equipment  |  -.0170481   .2078062    -0.08   0.935    -.4243408    .3902446
                                                   Defense  |   .0628259   .2035048     0.31   0.758    -.3360361    .4616879
                                           Precious Metals  |  -1.171368   .2158286    -5.43   0.000    -1.594385    -.748352
                  Non-Metallic and Industrial Metal Mining  |  -1.237329   .2459552    -5.03   0.000    -1.719393    -.755266
                                                      Coal  |          0  (empty)
                                 Petroleum and Natural Gas  |  -.3317668   .1326192    -2.50   0.012    -.5916957   -.0718379
                                                 Utilities  |  -1.118873   .3332252    -3.36   0.001    -1.771982   -.4657633
                                             Communication  |  -.1630523   .1372409    -1.19   0.235    -.4320395     .105935
                                         Personal Services  |   .8380485   .1346538     6.22   0.000     .5741318    1.101965
                                         Business Services  |   .9633162   .1278313     7.54   0.000     .7127714    1.213861
                                                 Computers  |    1.29461   .1291271    10.03   0.000     1.041526    1.547695
                                      Electronic Equipment  |   1.207361   .1282248     9.42   0.000     .9560446    1.458676
                           Measuring and Control Equipment  |   1.246006   .1304625     9.55   0.000     .9903043    1.501708
                                         Business Supplies  |   .4998725   .1398486     3.57   0.000     .2257743    .7739708
                                       Shipping Containers  |   1.346132   .1597375     8.43   0.000     1.033052    1.659211
                                            Transportation  |   .5324629   .1304966     4.08   0.000     .2766943    .7882314
                                                 Wholesale  |   .5552057   .1305404     4.25   0.000     .2993512    .8110603
                                                    Retail  |    1.19573   .1287813     9.28   0.000     .9433236    1.448137
                               Restaraunts, Hotels, Motels  |    .652968   .1337405     4.88   0.000     .3908414    .9150946
                                                   Banking  |   .0550116   .1390205     0.40   0.692    -.2174635    .3274867
                                                 Insurance  |   .2820601   .1339485     2.11   0.035     .0195258    .5445944
                                               Real Estate  |  -.2168165   .1508831    -1.44   0.151    -.5125419    .0789089
                                                   Trading  |  -.0918848   .1319862    -0.70   0.486    -.3505729    .1668034
                                            Almost Nothing  |  -.0546181   .1355758    -0.40   0.687    -.3203417    .2111055
                                                            |
                                                      _cons |  -1.882865   .1273016   -14.79   0.000    -2.132372   -1.633359
                  -----------------------------------------------------------------------------------------------------------

                  Comment


                  • #10
                    What does it mean to show as empty?
                    Last edited by Felipe Damasceno; 08 Jul 2016, 12:43.

                    Comment


                    • #11
                      I don't know how to display the outreg table here, but it still shows 3 industries. I believe is the ones empty in this output. In the table they show as omitted.

                      Comment


                      • #12
                        I don't have an example I can use to replicate. But try adding the noemptycells option, e.g.

                        Code:
                        probit pr_ann_mf_b5 neg_abn_ret roe invest bm  i.famafrench,  noemptycells noomit
                        -------------------------------------------
                        Richard Williams, Notre Dame Dept of Sociology
                        StataNow Version: 19.5 MP (2 processor)

                        EMAIL: [email protected]
                        WWW: https://www3.nd.edu/~rwilliam

                        Comment


                        • #13
                          I don't know anything about outreg so can't help with that; however, note that "omitted" and "empty" are different things - try the "noempty" option in addition to the noomitted option

                          crossed with RW's response

                          Comment


                          • #14
                            It didn't work. Is that any other way to deal with empty cells?

                            Comment


                            • #15
                              see the FAQ for why "it didn't work" is not helpful to readers

                              Comment

                              Working...
                              X