mprobit
is used to fit the (Bayesian) Multinomial Probit
models via Markov chain Monte Carlo. Along with the standard
Multinomial Probit model, it can also fit models with different choice
sets for each observation, and complete or partial ordering of all the
available alternatives. The computation uses the efficient marginal
data augmentation algorithm that is developed by Imai and van Dyk (2004).mprobit(formula, data = parent.frame(), choiceX = NULL, cXnames = NULL,
base = NULL, n.draws = 5000, p.var = "Inf", p.df = n.dim+1, p.scale = 1,
coef.start = 0, cov.start = 1, burnin = 0, thin = 0, verbose = FALSE)
formula
and choiceX
. The default is the environment
in which mprobit
is called.choiceX
. The details and examples are provided
below.5000
."Inf"
, which represents an impropen.dim-1
. The prior
degree of freedom parameter for the covariance matrix. The default is
n.dim+1
, which is equal to the total number of alternatives.1
. The prior scale matrix for the covariance
matrix. The first diagonal element will be set to 1 if
it is not equal to 1 already. A scalar input can be used to set0
.1
. The starting values for the covariance
matrix. The first diagonal element will be set to 1 if it is not
equal to 1 already. A scalar input can be used to set the0
.0
.TRUE
, helpful messages along with
a progress report (every 10%) of the Gibbs sampling are printed
on the screen. The default is FALSE
.mnp
containing the following elements:.Random.seed
.y ~ x1 +
x2
, where y
is a factor variable indicating the most
preferred choice and x1
and x2
are individual-specific
covariates. The inerations of individual-specific variables with each
of the choice indicator variables will be fit.
To specify choice specific covariates, use the syntax,
choiceX=list(A=cbind(z1, z2), B=cbind(z3, z4), C=cbind(z5,
z6))
, where A
, B
, and C
represent the choice
names of the response varaible, and z1
and z2
are each
vectors of length $n$ that record the values of the two
choice-specic covariates for each individual for choice A, likewise
for z3
, ..., z6
. The corresponding variable names via
cXnames=c("price", "quantity")
need to be specified, where price
refers to the coefficient
name for z1
, z3
, and z5
, and quantity
refers to that for z2
, z4
, and z6
. If the choice set varies from one observation to another, use the
syntax, cbind(y1, y2, y3) ~ x1 + x2
, in the case of a
three choice problem, and indicate unavailable alternatives by
NA
. If only the most preferred choice is observed, y1, y2, and y3 are
indicator variables that take on the value one for individuals who
prefer that choice and zero otherwise. The last column of the
response matrix, y3
in this particular example syntax, is
used as the base category.
For the Multinomial ordered Probit model where the complete
or partial ordering of the available alternatives is recorded, use the
same syntax as when the choice set varies (i.e., cbind(y1, y2,
y3, y4) ~ x1 + x2
). For each observation, all the available
alternatives in the response variables should be numerically ordered
in terms of preferences such as 1 2 2 3
. Ties are allowed. The
missing values in the response variable should be denoted by
NA
. The software will impute these missing values using the
specified covariates. The resulting uncertainty estimates of the
parameters will properly reflect the amount of missing data. For
example, we expect the standard errors to be larger when there is more
missing data.
summary.mnp
;
## load the detergent data
data(detergent)
## run the standard Multinomial Probit model with intercepts and the price
res1 <- mprobit(choice ~ 1, choiceX=list(Surf=Surf, Tide=Tide, Wisk=Wisk,
EraPlus=EraPlus, Solo=Solo, All=All),
cXnames=c("price"), data=detergent, n.draws=5000,
p.df=6, burnin=1000, thin=3, verbose=TRUE)
summary(res1)
## load the Japanese election data
data(japan)
## run the Multinomial ordered Probit model
res2 <- mprobit(cbind(LDP, NFP, SKG, JCP) ~ sex + education + age,
data = japan, n.draws=5000, verbose = TRUE)
summary(res2)
Run the code above in your browser using DataLab