2

I am currently conducting (conditional) multinomial logistic regression analyses using the mlogit package in R. The standard output of these models are coefficients, standard errors, and their significance level. As these coefficients can be hard to interpret, I also calculate marginal effects using the effects() function included in the package. However, the effects() function only provides the marginal effects (or elasticities) but no other information. Ideally, I would also present some information on significance and confidence intervals. Is there a function or easy way to calculate the standard errors and level of significance of marginal effects calculated by effects()?

Example using the MC dataset included in mlogit package

    # loading packages
    library(mlogit)
    library(Formula)
    
    # loading dataset on mode of travel from mlogit package
    data("ModeCanada", package = "mlogit")
    
    # only include choice sets with all four alternatives
    MC <- dfidx(ModeCanada, subset = noalt == 4)
    
    # formula of a multinomial model with income as a predictor of 
    # the mode of travel
    ml.MC1 <- mlogit(choice ~ 1 | income | 1, MC)
    
    # calculate model
    summary(ml.MC1)

    # output includes coefficients of the model but also standard 
    # error, z-values, and level of significance
    
    Coefficients :
                      Estimate Std. Error z-value  Pr(>|z|)
    (Intercept):air -1.5035093  0.1963055 -7.6590 1.865e-14 ***
    (Intercept):bus -1.7715605  0.6643887 -2.6665  0.007666 **
    (Intercept):car  0.7371313  0.1572490  4.6877 2.763e-06 ***
    income:air       0.0414857  0.0034315 12.0896 < 2.2e-16 ***
    income:bus      -0.0510644  0.0181427 -2.8146  0.004884 **
    income:car       0.0053445  0.0029496  1.8120  0.069991 .
    ---
    Signif. codes:
    0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
    Log-Likelihood: -2779.2

    # calculate marginal effects (an absolute increase of predictor as absolute
    # change in predicted outcome probability)(at sample means). 
    # However, the output only includes the marginal effect of changes in 
    # income, but no info on standard errors, etc.

    effects(ml.MC1, covariate = "income", type = "aa")

            train           air           bus           car 
    -0.0029162845  0.0086781323 -0.0001209537 -0.0056408941 

1 Answers1

1

I don't have an R solution, but here is a Stata solution that might be helpful to compare with for future R answers or your own routines. In any case, a "manual" R solution would be to apply the Delta Theorem to the elasticity expressions derived in section 3.6 (Derivatives and Elasticities) of Kenneth's Book. I hope this might help you to get started.

Conditional logit replication

. asclogit choice  if noalt==4  ,case(case)   casev(income) alternatives(alt)  base(train) nolog

Alternative-specific conditional logit         Number of obs      =     11,116
Case ID variable: case                         Number of cases    =       2779

Alternatives variable: alt                     Alts per case: min =          4
                                                              avg =        4.0
                                                              max =          4

                                                  Wald chi2(3)    =     212.63
Log likelihood = -2779.2424                       Prob > chi2     =     0.0000

------------------------------------------------------------------------------
      choice |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
air          |
      income |   .0414857   .0034315    12.09   0.000       .03476    .0482113
       _cons |  -1.503509   .1963055    -7.66   0.000    -1.888261   -1.118758
-------------+----------------------------------------------------------------
bus          |
      income |  -.0510649   .0181427    -2.81   0.005    -.0866239   -.0155059
       _cons |  -1.771551   .6643887    -2.67   0.008    -3.073729   -.4693731
-------------+----------------------------------------------------------------
car          |
      income |   .0053445   .0029496     1.81   0.070    -.0004365    .0111255
       _cons |   .7371313    .157249     4.69   0.000     .4289289    1.045334
-------------+----------------------------------------------------------------
train        |  (base alternative)
------------------------------------------------------------------------------

Marginal Effect


. margins  ,dydx(income)

Average marginal effects                        Number of obs     =     11,116
Model VCE    : OIM

Expression   : Pr(alt|1 selected), predict()
dy/dx w.r.t. : income

------------------------------------------------------------------------------
             |            Delta-method
             |      dy/dx   Std. Err.      z    P>|z|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
income       |
    _outcome |
        air  |   .0081304   .0004962    16.38   0.000     .0071578     .009103
        bus  |  -.0002234   .0000904    -2.47   0.014    -.0004007   -.0000461
        car  |  -.0052056   .0005082   -10.24   0.000    -.0062017   -.0042095
      train  |  -.0027014    .000358    -7.55   0.000    -.0034031   -.0019997
------------------------------------------------------------------------------