Announcement

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

  • Interpreting output for 'test' command in logistic regression.

    I am using Stata14 to run logic regression on a number of variables including some that are categorical. Having used the i. prefix in front of the categorical variables, logit returned the following results. I used 'test' to determine the overall effect of the variable and noticed the out sometimes include a 'b' or 'o' after the numbers denoting the levels. I also, found that in the case of the variable 'EducationBase', test indicates that certain levels are missing. I have no idea what the 'b' and 'o' means and why the levels could not be found. Can anyone help?


    Code:
    logit WTPPer i.EducationBase
    
    Iteration 0:   log likelihood =  -138.6917  
    Iteration 1:   log likelihood = -136.84168  
    Iteration 2:   log likelihood = -136.82816  
    Iteration 3:   log likelihood = -136.82814  
    Iteration 4:   log likelihood = -136.82814  
    
    Logistic regression                             Number of obs     =        225
                                                    LR chi2(3)        =       3.73
                                                    Prob > chi2       =     0.2925
    Log likelihood = -136.82814                     Pseudo R2         =     0.0134
    
    --------------------------------------------------------------------------------------------------
                              WTPPer |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
    ---------------------------------+----------------------------------------------------------------
                       EducationBase |
                          secondary  |   .4054651   .3006964     1.35   0.178    -.1838891    .9948193
    post secondayr/associate degree  |  -.2617066   .9338802    -0.28   0.779    -2.092078    1.568665
                         university  |  -1.360319   1.240483    -1.10   0.273    -3.791622    1.070984
                                     |
                               _cons |   .6671717   .1969744     3.39   0.001     .2811089    1.053234
    --------------------------------------------------------------------------------------------------
    
    . test 2.EducationBase 3.EducationBase 4.EducationBase
    
     ( 1)  [WTPPer]2b.EducationBase = 0
     ( 2)  [WTPPer]3.EducationBase = 0
     ( 3)  [WTPPer]4.EducationBase = 0
           Constraint 1 dropped
    
               chi2(  2) =    2.04
             Prob > chi2 =    0.3606
    
    . logit WTPPer i.LandingSite1
    
    note: 4.LandingSite1 != 0 predicts success perfectly
          4.LandingSite1 dropped and 9 obs not used
    
    note: 23.LandingSite1 != 0 predicts failure perfectly
          23.LandingSite1 dropped and 1 obs not used
    
    note: 26.LandingSite1 != 0 predicts success perfectly
          26.LandingSite1 dropped and 1 obs not used
    
    note: 34.LandingSite1 != 0 predicts success perfectly
          34.LandingSite1 dropped and 2 obs not used
    
    Iteration 0:   log likelihood = -133.40231  
    Iteration 1:   log likelihood = -125.71118  
    Iteration 2:   log likelihood = -125.52778  
    Iteration 3:   log likelihood = -125.52714  
    Iteration 4:   log likelihood = -125.52714  
    
    Logistic regression                             Number of obs     =        213
                                                    LR chi2(8)        =      15.75
                                                    Prob > chi2       =     0.0461
    Log likelihood = -125.52714                     Pseudo R2         =     0.0590
    
    --------------------------------------------------------------------------------
            WTPPer |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
    ---------------+----------------------------------------------------------------
      LandingSite1 |
    Orange valley  |   .0760461   .4790023     0.16   0.874    -.8627811    1.014873
          Maracas  |   1.096494   .4826467     2.27   0.023     .1505234    2.042464
         Balandra  |          0  (empty)
      Gran Chemin  |  -.1603427   .5765129    -0.28   0.781    -1.290287    .9696019
           Mayaro  |  -1.141172   .6250604    -1.83   0.068    -2.366268    .0839239
     Morne Diablo  |  -.3834862   .5978019    -0.64   0.521    -1.555156    .7881841
           Moruga  |    .427444   .6316912     0.68   0.499    -.8106481    1.665536
      Lance Mitan  |   .0219789    1.25128     0.02   0.986    -2.430484    2.474442
          La Brea  |          0  (empty)
           Otoire  |          0  (empty)
        La Raffin  |  -.9588503   .8056264    -1.19   0.234    -2.537849    .6201483
    River of Hope  |          0  (empty)
                   |
             _cons |   .6711683   .2563211     2.62   0.009     .1687882    1.173548
    --------------------------------------------------------------------------------
    
    . test 2.LandingSite1 3.LandingSite1 4.LandingSite1 5.LandingSite1 6.LandingSite1 7.LandingSite1 8.LandingSite1 9.LandingSite1 10.LandingSi
    > te1 11.LandingSite1 12.LandingSite1
    9.LandingSite1 not found
    r(111);
    
    . 
    . test 2.LandingSite1 3.LandingSite1 4.LandingSite1 5.LandingSite1 6.LandingSite1 7.LandingSite1 8.LandingSite1 10.LandingSite1 11.LandingS
    > ite1 12.LandingSite1
    11.LandingSite1 not found
    r(111);
    
    . test 2.LandingSite1 3.LandingSite1 4.LandingSite1 5.LandingSite1 6.LandingSite1 7.LandingSite1 8.LandingSite1 10.LandingSite1  12.Landing
    > Site1
    12.LandingSite1 not found
    r(111);
    
    . test 2.LandingSite1 3.LandingSite1 4.LandingSite1 5.LandingSite1 6.LandingSite1 7.LandingSite1 8.LandingSite1 10.LandingSite1  
    
     ( 1)  [WTPPer]2.LandingSite1 = 0
     ( 2)  [WTPPer]3.LandingSite1 = 0
     ( 3)  [WTPPer]4o.LandingSite1 = 0
     ( 4)  [WTPPer]5.LandingSite1 = 0
     ( 5)  [WTPPer]6.LandingSite1 = 0
     ( 6)  [WTPPer]7.LandingSite1 = 0
     ( 7)  [WTPPer]8.LandingSite1 = 0
     ( 8)  [WTPPer]10.LandingSite1 = 0
           Constraint 3 dropped
    
               chi2(  7) =   12.18
             Prob > chi2 =    0.0949
    
    .
    Dar

  • #2
    The b means that that particular level was the base level for the variable. So, as I'm sure you know, if your variable has n levels, if you try to include all n 0/1 indicators for the levels, there is colinearity. Consequently one level is always omitted, and that one is called the base level. Omitting a variable, from a regression perspective, is exactly the same thing as constraining its coefficient to be zero, and so, -test- treats it as having a zero coefficient.

    The o situations are different. This refers to the warning message shown at the top of the regression output where it says "

    note: 4.LandingSite1 != 0 predicts success perfectly
    4.LandingSite1 dropped and 9 obs not used

    The variable 4.LandingSite1 is an indicator which has value 0 when LandingSite1 != 4, and value 1 when LandingSite1 == 4. Now it turns out that in your data, whenever LandingSite1 == 4, WTPPer is always non-zero. That is, for every observation with LandingSite1 == 4, WTPPer always has a positive outcome. This is called perfect prediction. While perfect prediction might sound like a good thing in principle, it's a serious problem for logistic regression. The problem arises because in this circumstance the maximum likelihood estimate for the coefficient of 4.LandingSite1 would be infinite. Which implies that the estimation could never converge. So, before going down that rabbit hole, Stata looks for perfect prediction, and when it finds it, it eliminates the offending variable and the corresponding observations from the estimation. Consequently the proper interpretation of your logistic regression model has two parts: if LandingSite1 == 4 (or 23, 26, or 34) the predicted probability of WTPPer is 1, for all other situations use the logistic regression equation with the fitted coefficients shown. The o that appears in association with the reporting of 4.LandingSite1 in the -test- output is just Stata's way of reminding you that LandingSite1 is not actually in the regression--it was omitted (in this case, omitted because of perfect prediction.)

    Comment


    • #3
      Thanks, Clyde for that detailed response. However, I have some questions based on your response. In relation to the variable EducationBase, there were actually 5 levels to that variable but because the first level had no observations, Stata, I thought, treated the second level (the next level up from the first level) as the base level. As a result, the 'test' command should have reported on the last three levels [which it did!] in relation to the 'new' base level. Yet, the 'b' was shown against the third level as the base level. I am a bit confused...or have I not understood what you were saying?

      Regarding the variable LandingSite1, based on your explanation I checked the data and sure enough when LandingSite1==4, 26 and 34 the responses were 1 [perfect prediction] and when LandingSite1==23 the response was 0 [perfect failure] and so all those observations were dropped. My question is if the 'o' appears next to 4.LandingSite1, should it not also appear next to 10.LandingSite1 [La Brea]? Also, why has 9.LandingSite1 [Lance Mitan] and 12.LandingSite1 [La Raffin] not been found or omitted, especially when they both have valid observations of 1s and 0s?
      Dar

      Comment


      • #4
        In relation to the variable EducationBase, there were actually 5 levels to that variable but because the first level had no observations, Stata, I thought, treated the second level (the next level up from the first level) as the base level. As a result, the 'test' command should have reported on the last three levels [which it did!] in relation to the 'new' base level. Yet, the 'b' was shown against the third level as the base level. I am a bit confused...or have I not understood what you were saying?
        I'm not sure I understand what your question is. In any case, nothing in either #1 or #3 indicates which level is "first" and which level is "second" so I can't really comment on it. Perhaps it suffices to say that if one of your intended levels for that variable is unattested in the data set, Stata has no way to read your mind, and it just thinks that the variable has four levels, and, by default, it picks the lowest numbered of those levels as the base. Assuming that, as most investigators do, you have chosen your numerical coding of this variable to correspond to increasing amount of educational achievement, it seems that this is what Stata has done. Perhaps if you exhibit the numeric coding of this variable, I would better understand your question.

        My question is if the 'o' appears next to 4.LandingSite1, should it not also appear next to 10.LandingSite1 [La Brea]?Also, why has 9.LandingSite1 [Lance Mitan] and 12.LandingSite1 [La Raffin] not been found or omitted, especially when they both have valid observations of 1s and 0s?
        What I observe is that the attested values of LandingSite1 in your data are not consecutive numbers. So I can't make a correspondence between the labels that appear in the regression output and the numbers referring to them in the -test- commands. Listing the value label that is attached to LandingSite1 would be minimum necessary information for me to proceed. I probably also would be helpd by having an excerpt of your data to explore, posted using the -dataex- command. If you are running version 16 or a fully updated version 15.1 or 14.2, -dataex- is already part of your official Stata installation. If not, run -ssc install dataex- to get it. Either way, run -help dataex- to read the simple instructions for using it. -dataex- will save you time; it is easier and quicker than typing out tables. It includes complete information about aspects of the data that are often critical to answering your question but cannot be seen from tabular displays or screenshots. It also makes it possible for those who want to help you to create a faithful representation of your example to try out their code, which in turn makes it more likely that their answer will actually work in your data.

        Comment


        • #5
          This is a sub-set of my data for the variables concerned. Following is the command to draw the sub-set:

          Code:
           dataex WTPPer EducationBase LandingSite1,  c(50)
          Which generated the following:

          Code:
          * Example generated by -dataex-. To install: ssc install dataex
          clear
          input double(WTPPer EducationBase LandingSite1)
           0 2 1
           1 2 1
           0 3 1
           1 3 1
           1 2 1
           0 2 1
           1 3 1
           1 2 1
           0 2 1
           1 2 1
           0 2 1
           1 3 1
           1 3 1
           1 2 1
           0 2 1
           1 2 1
           1 2 1
           1 2 1
           1 3 1
           0 2 1
           0 2 1
           1 3 1
           1 3 1
          .b 3 1
           1 3 1
           1 2 1
           1 3 1
           1 3 1
           1 2 1
           1 3 1
           1 2 1
           0 2 1
           1 2 1
           1 3 1
           0 4 1
           1 2 1
           0 3 1
           1 2 1
           0 3 1
           1 2 1
           0 2 1
           0 2 1
           1 3 1
           1 2 1
           1 2 1
           1 3 1
           1 2 1
           0 2 1
           1 2 1
           1 2 1
          end
          label values WTPPer q57
          label def q57 0 "no", modify
          label def q57 1 "yes", modify
          label def q57 .b "No response", modify
          label values EducationBase q68
          label def q68 2 "primary", modify
          label def q68 3 "secondary", modify
          label def q68 4 "post secondayr/associate degree", modify
          label values LandingSite1 q1
          label def q1 1 "Othatite", modify

          I hope this helps you to understand what I'm trying to say.
          Dar

          Comment


          • #6
            Thank you, but unfortunately, the example data you sent contains only observations with LandigSite1 == 1. So it does not replicate the problem you are asking about. To understand what is going on I will need to see an example that is more representative of the data set as a whole.

            Comment


            • #7
              I'm sorry. Here is the full dataset for the variables:

              Code:
              * Example generated by -dataex-. To install: ssc install dataex
              clear
              input double(WTPPer EducationBase LandingSite1)
               0  2  1
               1  2  1
               0  3  1
               1  3  1
               1  2  1
               0  2  1
               1  3  1
               1  2  1
               0  2  1
               1  2  1
               0  2  1
               1  3  1
               1  3  1
               1  2  1
               0  2  1
               1  2  1
               1  2  1
               1  2  1
               1  3  1
               0  2  1
               0  2  1
               1  3  1
               1  3  1
              .b  3  1
               1  3  1
               1  2  1
               1  3  1
               1  3  1
               1  2  1
               1  3  1
               1  2  1
               0  2  1
               1  2  1
               1  3  1
               0  4  1
               1  2  1
               0  3  1
               1  2  1
               0  3  1
               1  2  1
               0  2  1
               0  2  1
               1  3  1
               1  2  1
               1  2  1
               1  3  1
               1  2  1
               0  2  1
               1  2  1
               1  2  1
               1  5  1
               1  2  1
               1  2  1
               1  3  1
               1  3  1
               0  2  1
               0  2  1
               1  3  1
               1  2  1
               1  2  1
               0  3  1
               0  3  1
               0  2  1
               0  3  1
               0  3  1
               0  3  1
               1  2  1
               1  2  1
               1  2  1
               0  2  2
               1  3  2
               1  3  2
               1  3  2
               1  3  2
               1  2  2
               0  2  2
               1  2  2
               1  3  2
               0  3  2
               1  4  2
               1  2  2
               1  3  2
               1  3  2
               1  3  2
               1  3  2
               0  3  2
               0  3  2
               1 .b  2
               0  2  2
               0  2  2
               1  3  2
               0  3  2
               1  2  2
               0  2  2
               1  3  2
               1  3  2
               1  2  2
               1  2  3
               1  2  3
               1  2  3
               1  2  3
               0  2  3
               1  3  3
               1  3  3
               1  3  3
               1  3  3
               1  3  3
               1  2  3
               1  3  3
               1  3  3
               1  2  3
               1  2  3
               1  2  3
               1  2  3
               1  2  3
               1  3  3
               1  4  3
               0  2  3
               1  3  3
               1  3  3
               1  3  3
               1  3  3
               0  2  3
               1  3  3
               1  3  3
               1  2  3
               1  3  3
               1  2  3
               0  2  3
               0  2  3
               1  2  3
               1  2  3
               1  2  3
               1  2  3
               1  2  3
               1  2  3
               1  3  3
               1  3  3
               1  3  3
               0  2  3
               0  2  3
               1  2  3
               1  2  3
               1  3  3
               1  3  3
               1  2  4
               1  2  4
               1  2  4
               1  3  4
               1  2  4
               1  2  4
               1  2  4
               1  3  4
               1  3  4
               0  2  5
               1  3  5
               0  3  5
               1  3  5
               1  3  5
               1  2  5
               0  2  5
               1  2  5
               1  3  5
               0  3  5
               0  2  5
               1  3  5
               1  2  5
               1  2  5
               1  2  5
               0  2  5
               1  3  6
               0  2  6
               0  5  6
               1  2  6
               0  2  6
               0  3  6
               0  3  6
               1  3  6
               0  2  6
               1  3  6
               1  3  6
               0  3  6
               0  3  6
               1  2  7
               1  2  7
               1  3  7
               1  3  7
               1  2  7
               0  3  7
               0  2  7
               1  2  7
               0  2  7
               1  2  7
               0  3  7
               0  3  7
               1  3  7
               0  2  7
               1  3  8
               1  3  8
               0  2  8
               1  3  8
               1  2  8
               1  3  8
               1  3  8
               1  2  8
               0  3  8
               0  3  8
               1  4  8
               0  3  8
               1  3  8
               1  3  8
               1  2  8
               1  3  8
               0  2 10
               1  3 10
               1  3 10
               0  4 23
               1  2 26
               1  2 29
               1  3 29
               0  3 29
               0  3 29
               1  3 29
              .b  3 29
               0  2 29
               0  5 29
               1  2 34
               1  2 34
              end
              label values WTPPer q57
              label def q57 0 "no", modify
              label def q57 1 "yes", modify
              label def q57 .b "No response", modify
              label values EducationBase q68
              label def q68 2 "primary", modify
              label def q68 3 "secondary", modify
              label def q68 4 "post secondayr/associate degree", modify
              label def q68 5 "university", modify
              label values LandingSite1 q1
              label def q1 1 "Othatite", modify
              label def q1 2 "Orange valley", modify
              label def q1 3 "Maracas", modify
              label def q1 4 "Balandra", modify
              label def q1 5 "Gran Chemin", modify
              label def q1 6 "Mayaro", modify
              label def q1 7 "Morne Diablo", modify
              label def q1 8 "Moruga", modify
              label def q1 10 "Lance Mitan", modify
              label def q1 23 "La Brea", modify
              label def q1 26 "Otoire", modify
              label def q1 29 "La Raffin", modify
              label def q1 34 "River of Hope", modify
              ------------------ copy up to and including the previous line ------------------

              Listed 228 out of 228 observations
              Dar

              Comment


              • #8
                Thank you, this is much better. After running your regression on the data, I ran the following:

                Code:
                . tab LandingSite1 in_sample
                
                              |       in_sample
                 LandingSite1 |         0          1 |     Total
                --------------+----------------------+----------
                     Othatite |         1         68 |        69 
                Orange valley |         0         28 |        28 
                      Maracas |         0         48 |        48 
                     Balandra |         9          0 |         9 
                  Gran Chemin |         0         16 |        16 
                       Mayaro |         0         13 |        13 
                 Morne Diablo |         0         14 |        14 
                       Moruga |         0         16 |        16 
                  Lance Mitan |         0          3 |         3 
                      La Brea |         1          0 |         1 
                       Otoire |         1          0 |         1 
                    La Raffin |         1          7 |         8 
                River of Hope |         2          0 |         2 
                --------------+----------------------+----------
                        Total |        15        213 |       228 
                
                . tab LandingSite1 in_sample, nolabel
                
                LandingSit |       in_sample
                        e1 |         0          1 |     Total
                -----------+----------------------+----------
                         1 |         1         68 |        69 
                         2 |         0         28 |        28 
                         3 |         0         48 |        48 
                         4 |         9          0 |         9 
                         5 |         0         16 |        16 
                         6 |         0         13 |        13 
                         7 |         0         14 |        14 
                         8 |         0         16 |        16 
                        10 |         0          3 |         3 
                        23 |         1          0 |         1 
                        26 |         1          0 |         1 
                        29 |         1          7 |         8 
                        34 |         2          0 |         2 
                -----------+----------------------+----------
                     Total |        15        213 |       228
                Now, if a given landing site shows a zero count in the 1 column of this output, it means that that landing site does not appear at all in the regression's estimation sample. There are precisely four such sites: 4, 23, 26, and 34. These are precisely the four that Stata gives you warnings about at the top of the regression:
                Code:
                . logit WTPPer i.LandingSite1
                
                note: 4.LandingSite1 != 0 predicts success perfectly
                      4.LandingSite1 dropped and 9 obs not used
                
                note: 23.LandingSite1 != 0 predicts failure perfectly
                      23.LandingSite1 dropped and 1 obs not used
                
                note: 26.LandingSite1 != 0 predicts success perfectly
                      26.LandingSite1 dropped and 1 obs not used
                
                note: 34.LandingSite1 != 0 predicts success perfectly
                      34.LandingSite1 dropped and 2 obs not used
                [rest of output omitted]
                Of these, only 4.LandingSite1 appears in your -test- command:
                Code:
                test 2.LandingSite1 3.LandingSite1 4.LandingSite1 5.LandingSite1 ///
                    6.LandingSite1 7.LandingSite1 8.LandingSite1 10.LandingSite1
                So only 4.LandingSite1 gets an o added in the -test- output. If you modify the test command to include one of the others, it, too receives an o:
                Code:
                . test 2.LandingSite1 3.LandingSite1 4.LandingSite1 5.LandingSite1 ///
                >     6.LandingSite1 7.LandingSite1 8.LandingSite1 10.LandingSite1 ///
                >     34.LandingSite1
                
                 ( 1)  [WTPPer]2.LandingSite1 = 0
                 ( 2)  [WTPPer]3.LandingSite1 = 0
                 ( 3)  [WTPPer]4o.LandingSite1 = 0
                 ( 4)  [WTPPer]5.LandingSite1 = 0
                 ( 5)  [WTPPer]6.LandingSite1 = 0
                 ( 6)  [WTPPer]7.LandingSite1 = 0
                 ( 7)  [WTPPer]8.LandingSite1 = 0
                 ( 8)  [WTPPer]10.LandingSite1 = 0
                 ( 9)  [WTPPer]34o.LandingSite1 = 0
                       Constraint 3 dropped
                       Constraint 9 dropped
                
                           chi2(  7) =   12.18
                         Prob > chi2 =    0.0949
                Finally, let's look at one of your other -test- commands that produced a (different) error message:
                Code:
                . test 2.LandingSite1 3.LandingSite1 4.LandingSite1 5.LandingSite1 ///
                >     6.LandingSite1 7.LandingSite1 8.LandingSite1 9.LandingSite1 ///
                >     10.LandingSite1 11.LandingSite1 12.LandingSite1
                9.LandingSite1 not found
                r(111);
                Refer again to the cross tab of landing site with in_sample (the one without the labels) near the top of this response. Note that landing site 9 does not appear in this table at all. That's because there are no observations in the data with LandingSite1 == 9. So 9 is different from 4: 4 is in the data, but is tossed out of the regression by Stata due to perfect prediction. But 9 doesn't even exist in the data: that is why it is "not found," as opposed to omitted.

                So everything is working exactly in accord with the principles set out in #2.

                Comment


                • #9
                  Clyde, thank you for this! Your response is crystal clear! This topic is closed.
                  Dar

                  Comment


                  • #10
                    I haven't been following this thread closely, but unless you've got some reason for only testing some of the terms of the factor variable, it is usually easier and less error-prone to use testparm instead of test:

                    Code:
                    . testparm i.LandingSite1
                    
                     ( 1)  [WTPPer]2.LandingSite1 = 0
                     ( 2)  [WTPPer]3.LandingSite1 = 0
                     ( 3)  [WTPPer]5.LandingSite1 = 0
                     ( 4)  [WTPPer]6.LandingSite1 = 0
                     ( 5)  [WTPPer]7.LandingSite1 = 0
                     ( 6)  [WTPPer]8.LandingSite1 = 0
                     ( 7)  [WTPPer]10.LandingSite1 = 0
                     ( 8)  [WTPPer]29.LandingSite1 = 0
                    
                               chi2(  8) =   13.92
                             Prob > chi2 =    0.0839
                    This way you don't have to list all the terms individually. Also you don't run the risk of missing a term you should have included or of getting an error for including a term that does not exist.
                    -------------------------------------------
                    Richard Williams, Notre Dame Dept of Sociology
                    StataNow Version: 19.5 MP (2 processor)

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

                    Comment


                    • #11
                      Using the coeflegend option is also sometimes handy for keeping parameter names right:

                      Code:
                      . logit WTPPer i.LandingSite1, coeflegend nolog
                      
                      note: 4.LandingSite1 != 0 predicts success perfectly
                            4.LandingSite1 dropped and 9 obs not used
                      
                      note: 23.LandingSite1 != 0 predicts failure perfectly
                            23.LandingSite1 dropped and 1 obs not used
                      
                      note: 26.LandingSite1 != 0 predicts success perfectly
                            26.LandingSite1 dropped and 1 obs not used
                      
                      note: 34.LandingSite1 != 0 predicts success perfectly
                            34.LandingSite1 dropped and 2 obs not used
                      
                      Logistic regression                             Number of obs     =        213
                                                                      LR chi2(8)        =      15.75
                                                                      Prob > chi2       =     0.0461
                      Log likelihood = -125.52714                     Pseudo R2         =     0.0590
                      
                      --------------------------------------------------------------------------------
                              WTPPer |      Coef.  Legend
                      ---------------+----------------------------------------------------------------
                        LandingSite1 |
                      Orange valley  |   .0760461  _b[2.LandingSite1]
                            Maracas  |   1.096494  _b[3.LandingSite1]
                           Balandra  |          0  _b[4o.LandingSite1]
                        Gran Chemin  |  -.1603427  _b[5.LandingSite1]
                             Mayaro  |  -1.141172  _b[6.LandingSite1]
                       Morne Diablo  |  -.3834862  _b[7.LandingSite1]
                             Moruga  |    .427444  _b[8.LandingSite1]
                        Lance Mitan  |   .0219789  _b[10.LandingSite1]
                            La Brea  |          0  _b[23o.LandingSite1]
                             Otoire  |          0  _b[26o.LandingSite1]
                          La Raffin  |  -.9588503  _b[29.LandingSite1]
                      River of Hope  |          0  _b[34o.LandingSite1]
                                     |
                               _cons |   .6711683  _b[_cons]
                      --------------------------------------------------------------------------------
                      So, you can easily see the numbers of which coefficients made it into the model. Or, you can use nofvlabel:

                      Code:
                      . logit WTPPer i.LandingSite1, nofvlabel nolog
                      note: 4.LandingSite1 != 0 predicts success perfectly
                            4.LandingSite1 dropped and 9 obs not used
                      
                      note: 23.LandingSite1 != 0 predicts failure perfectly
                            23.LandingSite1 dropped and 1 obs not used
                      
                      note: 26.LandingSite1 != 0 predicts success perfectly
                            26.LandingSite1 dropped and 1 obs not used
                      
                      note: 34.LandingSite1 != 0 predicts success perfectly
                            34.LandingSite1 dropped and 2 obs not used
                      
                      
                      Logistic regression                             Number of obs     =        213
                                                                      LR chi2(8)        =      15.75
                                                                      Prob > chi2       =     0.0461
                      Log likelihood = -125.52714                     Pseudo R2         =     0.0590
                      
                      ------------------------------------------------------------------------------
                            WTPPer |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
                      -------------+----------------------------------------------------------------
                      LandingSite1 |
                                2  |   .0760461   .4790023     0.16   0.874    -.8627811    1.014873
                                3  |   1.096494   .4826467     2.27   0.023     .1505234    2.042464
                                4  |          0  (empty)
                                5  |  -.1603427   .5765129    -0.28   0.781    -1.290287    .9696019
                                6  |  -1.141172   .6250604    -1.83   0.068    -2.366268    .0839239
                                7  |  -.3834862   .5978019    -0.64   0.521    -1.555156    .7881841
                                8  |    .427444   .6316912     0.68   0.499    -.8106481    1.665536
                               10  |   .0219789    1.25128     0.02   0.986    -2.430484    2.474442
                               23  |          0  (empty)
                               26  |          0  (empty)
                               29  |  -.9588503   .8056264    -1.19   0.234    -2.537849    .6201483
                               34  |          0  (empty)
                                   |
                             _cons |   .6711683   .2563211     2.62   0.009     .1687882    1.173548
                      ------------------------------------------------------------------------------
                      testparm is usually sufficient but these approaches may be helpful if you have a mad desire to test more esoteric hypotheses, e,g.

                      Code:
                      . test 3.LandingSite1 = -6.LandingSite1
                      
                       ( 1)  [WTPPer]3.LandingSite1 + [WTPPer]6.LandingSite1 = 0
                      
                                 chi2(  1) =    0.00
                               Prob > chi2 =    0.9590
                      -------------------------------------------
                      Richard Williams, Notre Dame Dept of Sociology
                      StataNow Version: 19.5 MP (2 processor)

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

                      Comment


                      • #12
                        Thank you Richard for adding to this topic and enriching my knowledge of Stata. The commands you have suggested would be quite useful and time-saving. Thanks again!


                        Dar

                        Comment

                        Working...
                        X