Announcement

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

  • Need Help Interpreting ibn Factor Variable Coefficients

    Hello,

    Have run a mixed-effects model using ibn. factor-variable operator for the factor variable regime type. My question is: How can I interpret the coefficients as there is no base level? I know this is probably a newbie question, but I cannot find an answer here nor in my searches on the Internet. Any assistance would be greatly appreciated!


    Code:
    Mixed-effects logistic regression               Number of obs     =    294,794
    Group variable: ccodecow                        Number of groups  =         87
    
                                                    Obs per group:
                                                                  min =        372
                                                                  avg =    3,388.4
                                                                  max =     13,995
    
    Integration points =   7                        Wald chi2(16)     =    8115.59
    Log likelihood = -152891.51                     Prob > chi2       =     0.0000
    
    -----------------------------------------------------------------------------------
                fight |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
    ------------------+----------------------------------------------------------------
                 male |   .6496688   .0090942    71.44   0.000     .6318446    .6674931
                  age |   .0108852   .0012953     8.40   0.000     .0083465    .0134239
               age_sq |  -.0001825   .0000139   -13.18   0.000    -.0002097   -.0001554
              married |   .1587568   .0102303    15.52   0.000     .1387058    .1788078
             divorced |   .1030853   .0240524     4.29   0.000     .0559434    .1502272
               income |  -.0035996   .0016448    -2.19   0.029    -.0068234   -.0003757
          college_edu |  -.0589358   .0105463    -5.59   0.000    -.0796061   -.0382654
            gdppc_lag |  -.0000411   1.07e-06   -38.39   0.000    -.0000432    -.000039
                      |
          regime_type |
                   1  |   1.322575    .115204    11.48   0.000      1.09678    1.548371
                   2  |   1.671782    .117655    14.21   0.000     1.441182    1.902382
                   3  |   1.381307    .122293    11.30   0.000     1.141618    1.620997
                   5  |   4.024119   .5040793     7.98   0.000     3.036142    5.012097
                   6  |   1.581661   .1211819    13.05   0.000     1.344148    1.819173
                   7  |   1.192455   .1248406     9.55   0.000     .9477722    1.437138
                   9  |   .8310635   .1340048     6.20   0.000     .5684189    1.093708
                      |
    cap_preponderance |  -.0347508   .0101384    -3.43   0.001    -.0546216   -.0148799
    -----------------------------------------------------------------------------------
    
    ------------------------------------------------------------------------------
      Random-effects Parameters  |   Estimate   Std. Err.     [95% Conf. Interval]
    -----------------------------+------------------------------------------------
    ccodecow: Identity           |
                      var(_cons) |   .9906641    .153608      .7310429    1.342487
    ------------------------------------------------------------------------------
    LR test vs. logistic model: chibar2(01) = 23441.05    Prob >= chibar2 = 0.0000

  • #2
    Ray:
    what's your code?
    Kind regards,
    Carlo
    (Stata 19.0)

    Comment


    • #3
      Hello Carlo,

      Thanks for reaching out. My code is below. Do you need an example of my data?

      Code:
      global country "gdppc_lag ibn.regime_type"    
      global individual "male age age_sq married divorced income college_edu" 
      global military "cap_preponderance"       
      asdoc meqrlogit fight $individual $country $military, noconstant || ccodecow:, cov(un), nested save(H2a Effect of Capability Preponderance With Regime Type Country-Level Predictor) replace setstars(***@.001, **@.01, *@.05) tzok dec(3) cnames(Model 1) title(H2a Effect of Capability Preponderance With Regime Type Country-Level Predictor)
      Kind regards,
      Ray
      (Stata 16.0 SE)

      Comment


      • #4
        here is a simple example using -regress- as I'm assuming you can translate to the logit situation:
        Code:
        . regress weight i.foreign
        
              Source |       SS           df       MS      Number of obs   =        74
        -------------+----------------------------------   F(1, 72)        =     39.02
               Model |  15496779.3         1  15496779.3   Prob > F        =    0.0000
            Residual |  28597399.1        72  397186.099   R-squared       =    0.3514
        -------------+----------------------------------   Adj R-squared   =    0.3424
               Total |  44094178.4        73  604029.841   Root MSE        =    630.23
        
        ------------------------------------------------------------------------------
              weight | Coefficient  Std. err.      t    P>|t|     [95% conf. interval]
        -------------+----------------------------------------------------------------
             foreign |
            Foreign  |  -1001.206   160.2876    -6.25   0.000    -1320.734   -681.6788
               _cons |   3317.115   87.39676    37.95   0.000     3142.893    3491.338
        ------------------------------------------------------------------------------
        r; t=0.26 13:27:42
        
        . regress weight ibn.foreign, hascons
        
              Source |       SS           df       MS      Number of obs   =        74
        -------------+----------------------------------   F(1, 72)        =     39.02
               Model |  15496779.3         1  15496779.3   Prob > F        =    0.0000
            Residual |  28597399.1        72  397186.099   R-squared       =    0.3514
        -------------+----------------------------------   Adj R-squared   =    0.3424
               Total |  44094178.4        73  604029.841   Root MSE        =    630.23
        
        ------------------------------------------------------------------------------
              weight | Coefficient  Std. err.      t    P>|t|     [95% conf. interval]
        -------------+----------------------------------------------------------------
             foreign |
           Domestic  |   3317.115   87.39676    37.95   0.000     3142.893    3491.338
            Foreign  |   2315.909   134.3649    17.24   0.000     2048.058    2583.761
        ------------------------------------------------------------------------------
        r; t=0.03 13:27:58

        Comment


        • #5
          Thank you, Rich.

          When I run the code with hascons instead of noconstant, I get a message that says "hascons is not allowed". Maybe this is because I am running a logit model.

          However, how would I interpret the coefficients? As car changes from foreign to domestic how much does the weight change? Is it the difference between the coefficients? In my case, as "regime type" changes how much change is their in "fight"?

          Again, I apologize. I am not much of a statistician, and I just want to make sure that I am interpreting the chart correctly.

          Best,

          Ray
          (Stata 16 SE)

          Comment


          • #6
            Ray:
            using -predict- can help you out in this respect.
            Other things being equal, switchng from domestic to foreing decreases weight of -1001.206 lbs.

            Code:
            . sysuse auto.dta
            (1978 automobile data)
            
            . regress weight i.foreign
            
                  Source |       SS           df       MS      Number of obs   =        74
            -------------+----------------------------------   F(1, 72)        =     39.02
                   Model |  15496779.3         1  15496779.3   Prob > F        =    0.0000
                Residual |  28597399.1        72  397186.099   R-squared       =    0.3514
            -------------+----------------------------------   Adj R-squared   =    0.3424
                   Total |  44094178.4        73  604029.841   Root MSE        =    630.23
            
            ------------------------------------------------------------------------------
                  weight | Coefficient  Std. err.      t    P>|t|     [95% conf. interval]
            -------------+----------------------------------------------------------------
                 foreign |
                Foreign  |  -1001.206   160.2876    -6.25   0.000    -1320.734   -681.6788
                   _cons |   3317.115   87.39676    37.95   0.000     3142.893    3491.338
            ------------------------------------------------------------------------------
            
            . predict fitted, xb
            
            . list make weight foreign fitted if _n==55
            
                 +----------------------------------------+
                 | make       weight   foreign     fitted |
                 |----------------------------------------|
             55. | BMW 320i    2,650   Foreign   2315.909 |
                 +----------------------------------------+
            
            . di  3317.115+-1001.206
            2315.909
            
            .
            Kind regards,
            Carlo
            (Stata 19.0)

            Comment


            • #7
              Thank you Carlo for your explanation. I do understand, but in your example, "domestic" is treated as the base level.

              However, in my result table, I am using the command ibn which indicates there is no base level for the factor variable "regime_type". My question is how can I interpret those coefficients since there is no base? Do I just compare them by taking the difference from the previous level of the factor variable?

              For example, using the table below, would switching from:

              regime_type 1 to regime_type 2 result in a -35 percentage point difference?
              regime_type 2 to regime_type 3 result in a 29 percentage point difference?
              regime_type 3 to regime_type 5 result in a -264 percentage point difference?
              regime_type 6 to regime_type 7 result in a 39 percentage point difference?
              regime_type 7 to regime_type 9 result in a -36 percentage point difference?


              Code:
              Mixed-effects logistic regression               Number of obs     =    294,794
              Group variable: ccodecow                        Number of groups  =         87
              
                                                              Obs per group:
                                                                            min =        372
                                                                            avg =    3,388.4
                                                                            max =     13,995
              
              Integration points =   7                        Wald chi2(16)     =    8115.59
              Log likelihood = -152891.51                     Prob > chi2       =     0.0000
              
              -----------------------------------------------------------------------------------
                          fight |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
              ------------------+----------------------------------------------------------------
                           male |   .6496689   .0090942    71.44   0.000     .6318446    .6674931
                            age |   .0108852   .0012953     8.40   0.000     .0083465    .0134239
                         age_sq |  -.0001825   .0000139   -13.18   0.000    -.0002097   -.0001554
                        married |   .1587568   .0102303    15.52   0.000     .1387058    .1788078
                       divorced |   .1030852   .0240524     4.29   0.000     .0559433    .1502271
                         income |  -.0035996   .0016448    -2.19   0.029    -.0068234   -.0003757
                    college_edu |  -.0589357   .0105463    -5.59   0.000    -.0796061   -.0382654
                      gdppc_lag |  -.0000411   1.07e-06   -38.39   0.000    -.0000432    -.000039
                                |
                    regime_type |
                             1  |   1.322571   .1152039    11.48   0.000     1.096775    1.548366
                             2  |   1.671777    .117655    14.21   0.000     1.441178    1.902377
                             3  |   1.381302   .1222929    11.30   0.000     1.141613    1.620992
                             5  |   4.024119    .504079     7.98   0.000     3.036142    5.012096
                             6  |   1.581655   .1211819    13.05   0.000     1.344143    1.819167
                             7  |   1.192449   .1248406     9.55   0.000     .9477664    1.437132
                             9  |   .8310584   .1340047     6.20   0.000     .5684139    1.093703
                                |
              cap_preponderance |  -.0347507   .0101384    -3.43   0.001    -.0546216   -.0148799
              -----------------------------------------------------------------------------------
              
              ------------------------------------------------------------------------------
                Random-effects Parameters  |   Estimate   Std. Err.     [95% Conf. Interval]
              -----------------------------+------------------------------------------------
              ccodecow: Identity           |
                                var(_cons) |   .9906631   .1536078      .7310422    1.342485
              ------------------------------------------------------------------------------
              LR test vs. logistic model: chibar2(01) = 23441.05    Prob >= chibar2 = 0.0000
              Thank again!

              Ray
              (Stata 16 SE)
              Last edited by Ray Hartman; 15 Oct 2023, 07:04.

              Comment


              • #8
                Ray:
                I do hope that what follows can be of some help:
                Code:
                . sysuse auto.dta
                . regress weight ibn.rep78
                note: 5.rep78 omitted because of collinearity.
                
                      Source |       SS           df       MS      Number of obs   =        69
                -------------+----------------------------------   F(4, 64)        =      4.26
                       Model |  8982240.26         4  2245560.07   Prob > F        =    0.0041
                    Residual |  33763475.7        64  527554.308   R-squared       =    0.2101
                -------------+----------------------------------   Adj R-squared   =    0.1608
                       Total |  42745715.9        68   628613.47   Root MSE        =    726.33
                
                ------------------------------------------------------------------------------
                      weight | Coefficient  Std. err.      t    P>|t|     [95% conf. interval]
                -------------+----------------------------------------------------------------
                       rep78 |
                          1  |   777.2727   558.3338     1.39   0.169    -338.1273    1892.673
                          2  |   1031.023   337.4963     3.05   0.003     356.7963    1705.249
                          3  |   976.2727   256.0168     3.81   0.000     464.8203    1487.725
                          4  |   547.2727   277.9713     1.97   0.053    -8.038823    1102.584
                          5  |          0  (omitted)
                             |
                       _cons |   2322.727   218.9965    10.61   0.000     1885.231    2760.223
                ------------------------------------------------------------------------------
                
                . lincom 2.rep78-3.rep78
                
                 ( 1)  2.rep78 - 3.rep78 = 0
                
                ------------------------------------------------------------------------------
                      weight | Coefficient  Std. err.      t    P>|t|     [95% conf. interval]
                -------------+----------------------------------------------------------------
                         (1) |      54.75   289.0146     0.19   0.850     -522.623     632.123
                ------------------------------------------------------------------------------
                
                .
                Kind regards,
                Carlo
                (Stata 19.0)

                Comment


                • #9
                  Thank you, Carlo! Yes, the lincom command is what I was looking for.

                  Best,

                  Ray
                  (Stata 16 SE)

                  Comment

                  Working...
                  X