Announcement

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

  • Reason of error occurrence : omitted because of collinearity?

    Hello, I am modelling ordered logit or ordered probit.
    Result is like as following. y is the dependent variable, and x1~x5 are independent variables which are all categorial.
    Click image for larger version

Name:	캡처 2022-12-18 021032.png
Views:	1
Size:	45.3 KB
ID:	1693951


    I don't have any idea why this 'omitted because of collinearity' comes out...
    For now, I just think that my code is wrong, rather than the data because it is so small that I can check if there is any doubtful value.
    Actually I've searched about this but even still don't know so with which that variable(x5) has collinearity.
    I attached the data I used to calibrate the model. I would be very appreciate if you give me a hand...
    Attached Files
    Last edited by Park Hwanggyu; 17 Dec 2022, 10:21.

  • #2
    Park:
    is this issue related to the so called "dummy trap" (https://en.wikipedia.org/wiki/Dummy_...(statistics))?
    Kind regards,
    Carlo
    (Stata 19.0)

    Comment


    • #3
      Carlo Lazzaro Hmm...I don't know. Definately some materials explaning 'dummy trap' are pointing out why I must not encode categorical variable into 0,1,2, but I am not sure if this problem is because of that.
      I am about to do one-hot encode, but currently I don't know so how to do that practically.

      Comment


      • #4
        Park:
        1) dummy trap is something related to regression machinery. Therefore, we cannot avoid to take the reference category (or whatever other level of our categorical variable) out;
        2) -fvvarlist- notation does it for you automatically;
        3) if you have a => three-level categotical variable and you do not use the -fvvarlist- -i.- prefix, Stata considers it as a continuos predictor (this is the possible reason why Stata does not return any message about collinearity if you do not ho -fvvarlist' notation.
        Kind regards,
        Carlo
        (Stata 19.0)

        Comment


        • #5
          Carlo Lazzaro Well, I got what you're saying. So I am trying to search about usage of 'fvvarlist', but no material tells about it so far...Isn't it a command?
          I'm sorry but If my original code(which outputs above message) is

          oprobit y i.(x1 x2 x3 x4 x5)

          could you tell me how I can add it in here?

          Comment


          • #6
            Park:
            1) see -help fvvarlist-;
            2) your code adopts a possible way of including -fvvarlist- notation, that is equivalent to -i.x1- and so on, as you can see from the following toy-example (please also note that Stata automatically omits one level of the predictor to protect the regression from the so-called dummy trap):
            Code:
            . use https://www.stata-press.com/data/r17/fullauto.dta
            (Automobile models)
            
            . oprobit rep78 i.(foreign), allbase
            
            Iteration 0:   log likelihood = -93.692061  
            Iteration 1:   log likelihood = -79.126404  
            Iteration 2:   log likelihood =  -78.99278  
            Iteration 3:   log likelihood = -78.992642  
            Iteration 4:   log likelihood = -78.992642  
            
            Ordered probit regression                               Number of obs =     69
                                                                    LR chi2(1)    =  29.40
                                                                    Prob > chi2   = 0.0000
            Log likelihood = -78.992642                             Pseudo R2     = 0.1569
            
            ------------------------------------------------------------------------------
                   rep78 | Coefficient  Std. err.      z    P>|z|     [95% conf. interval]
            -------------+----------------------------------------------------------------
                 foreign |
               Domestic  |          0  (base)
                Foreign  |   1.721234   .3311954     5.20   0.000     1.072103    2.370365
            -------------+----------------------------------------------------------------
                   /cut1 |  -1.741284   .3225549                      -2.37348   -1.109088
                   /cut2 |  -.8271202   .2027111                     -1.224427   -.4298138
                   /cut3 |   .7298698    .196289                      .3451504    1.114589
                   /cut4 |   1.847476   .2781064                      1.302397    2.392554
            ------------------------------------------------------------------------------
            
            . oprobit rep78 i.foreign, allbase
            
            Iteration 0:   log likelihood = -93.692061  
            Iteration 1:   log likelihood = -79.126404  
            Iteration 2:   log likelihood =  -78.99278  
            Iteration 3:   log likelihood = -78.992642  
            Iteration 4:   log likelihood = -78.992642  
            
            Ordered probit regression                               Number of obs =     69
                                                                    LR chi2(1)    =  29.40
                                                                    Prob > chi2   = 0.0000
            Log likelihood = -78.992642                             Pseudo R2     = 0.1569
            
            ------------------------------------------------------------------------------
                   rep78 | Coefficient  Std. err.      z    P>|z|     [95% conf. interval]
            -------------+----------------------------------------------------------------
                 foreign |
               Domestic  |          0  (base)
                Foreign  |   1.721234   .3311954     5.20   0.000     1.072103    2.370365
            -------------+----------------------------------------------------------------
                   /cut1 |  -1.741284   .3225549                      -2.37348   -1.109088
                   /cut2 |  -.8271202   .2027111                     -1.224427   -.4298138
                   /cut3 |   .7298698    .196289                      .3451504    1.114589
                   /cut4 |   1.847476   .2781064                      1.302397    2.392554
            ------------------------------------------------------------------------------
            
            .
            Kind regards,
            Carlo
            (Stata 19.0)

            Comment


            • #7
              Carlo Lazzaro Thank you! I'll check it

              Comment

              Working...
              X