II Econometric Analysis Using R

Also available in Stata and Python versions

### Chapter 16. Multinomial and Ordered Response Models

#### Example 16.1

Load libraries

library(wooldridge)
library(nnet)
library(stargazer)
library(haven)
library(MASS)

School and Employment Decisions for Young Men

#library(haven)
df <- read_dta("Wooldridge_2E/keane.dta")
#library(nnet)
mlogit<-multinom( status ~ educ + exper + expersq + black,  data=df, subset=year==87)
## # weights:  18 (10 variable)
## initial  value 1886.317300
## iter  10 value 1034.528631
## iter  20 value 907.857379
## final  value 907.857241
## converged
stargazer(mlogit, no.space = T, type="text")
##
## ==============================================
##                       Dependent variable:
##                   ----------------------------
##                         1              2
##                        (1)            (2)
## ----------------------------------------------
## educ                -0.674***      -0.315***
##                      (0.070)        (0.065)
## exper                 -0.106       0.849***
##                      (0.173)        (0.157)
## expersq               -0.013       -0.077***
##                      (0.025)        (0.023)
## black                0.812***        0.311
##                      (0.303)        (0.281)
## Constant            10.276***      5.542***
##                      (1.133)        (1.086)
## ----------------------------------------------
## Akaike Inf. Crit.   1,835.714      1,835.714
## ==============================================
## Note:              *p<0.1; **p<0.05; ***p<0.01

#### Example 16.2

Asset Allocation in Pension Plans

OLS <- lm(pctstck ~ choice + age + educ + female + black + married +
finc25 + finc35 + finc50 + finc75 + finc100 + finc101 + wealth89 + prftshr,
data=pension)

pension$pctstck2 <- as.factor(pension$pctstck)
#library(MASS)
Oprobit <- polr(pctstck2 ~ choice + age + educ + female + black + married +
finc25 + finc35 + finc50 + finc75 + finc100 + finc101 + wealth89 + prftshr,
data=pension, method = "probit", Hess = TRUE )

stargazer(OLS, Oprobit, no.space = T, type="text")
##
## =================================================
##                          Dependent variable:
##                     -----------------------------
##                           pctstck        pctstck2
##                             OLS          ordered
##                                           probit
##                             (1)            (2)
## -------------------------------------------------
## choice                    12.048*        0.371**
##                           (6.298)        (0.184)
## age                       -1.626**       -0.050**
##                           (0.775)        (0.023)
## educ                       0.754          0.026
##                           (1.207)        (0.035)
## female                     1.303          0.046
##                           (7.164)        (0.206)
## black                      3.967          0.093
##                           (9.783)        (0.282)
## married                    3.303          0.094
##                           (7.998)        (0.233)
## finc25                    -18.186         -0.578
##                           (14.120)       (0.423)
## finc35                     -3.925         -0.135
##                           (14.486)       (0.431)
## finc50                     -8.129         -0.262
##                           (14.342)       (0.427)
## finc75                    -17.579         -0.566
##                           (16.078)       (0.478)
## finc100                    -6.746         -0.228
##                           (15.791)       (0.469)
## finc101                   -28.344         -0.864
##                           (17.905)       (0.529)
## wealth89                   -0.003        -0.0001
##                           (0.012)        (0.0004)
## prftshr                   15.808**       0.482**
##                           (7.333)        (0.216)
## Constant                 134.116**
##                           (55.705)
## -------------------------------------------------
## Observations                194            194
## R2                         0.100
## Adjusted R2                0.029
## Residual Std. Error  39.134 (df = 179)
## F Statistic         1.418 (df = 14; 179)
## =================================================
## Note:                 *p<0.1; **p<0.05; ***p<0.01