Built using Zelig version r packageVersion("Zelig")

knitr::opts_knit$set(
    stop_on_error = 2L
)
knitr::opts_chunk$set(
    fig.height = 11,
    fig.width = 7
)

options(cite = FALSE)

Bayesian Probit Regression with probit.bayes.

Use the probit regression model for model binary dependent variables specified as a function of a set of explanatory variables. The model is estimated using a Gibbs sampler. For other models suitable for binary response variables, see Bayesian logistic regression, maximum likelihood logit regression, and maximum likelihood probit regression.

Syntax

z.out <- zelig(Y ~ X1 + X2, model = "probit.bayes", weights = w,
               data = mydata)
x.out <- setx(z.out)
s.out <- sim(z.out, x = x.out)

Additional Inputs

Using the following arguments to monitor the Markov chains:

Use the following parameters to specify the model’s priors:

Use the following arguments to specify optional output for the model:

Zelig users may wish to refer to help(MCMCprobit) for more information.

Examples

rm(list=ls(pattern="\\.out"))
suppressWarnings(suppressMessages(library(Zelig)))
set.seed(1234)

Basic Example

Attaching the sample dataset:

data(turnout)

Estimating the probit regression using probit.bayes:

z.out <- zelig(vote ~ race + educate, model = "probit.bayes",
               data = turnout, verbose = FALSE)

You can check for convergence before summarizing the estimates with three diagnostic tests. See the section Diagnostics for Zelig Models for examples of the output with interpretation:

z.out$geweke.diag()
z.out$heidel.diag()
z.out$raftery.diag()
summary(z.out)

Setting values for the explanatory variables to their sample averages:

x.out <- setx(z.out)

Simulating quantities of interest from the posterior distribution given: x.out

s.out1 <- sim(z.out, x = x.out)
summary(s.out1)

Simulating First Differences

Estimating the first difference (and risk ratio) in individual’s probability of voting when education is set to be low (25th percentile) versus high (75th percentile) while all the other variables are held at their default values:

x.high <- setx(z.out, educate = quantile(turnout$educate, prob = 0.75))
x.low <- setx(z.out, educate = quantile(turnout$educate, prob = 0.25))
s.out2 <- sim(z.out, x = x.high, x1 = x.low)
summary(s.out2)

Model

Let $Y_{i}$ be the binary dependent variable for observation $i$ which takes the value of either 0 or 1.

$$ \begin{aligned} Y_{i} & \sim & \textrm{Bernoulli}(\pi_{i})\ & = & \pi_{i}^{Y_{i}}(1-\pi_{i})^{1-Y_{i}},\end{aligned} $$ where $\pi_{i}=\Pr(Y_{i}=1)$.

$$ \begin{aligned} \pi_{i}= \Phi(x_i \beta),\end{aligned} $$

where $\Phi(\cdot)$ is the cumulative density function of the standard Normal distribution with mean 0 and variance 1, $x_{i}$ is the vector of $k$ explanatory variables for observation $i$, and $\beta$ is the vector of coefficients.

$$ \begin{aligned} \beta \sim \textrm{Normal}k \left( b{0}, B_{0}^{-1} \right) \end{aligned} $$

where $b_{0}$ is the vector of means for the $k$ explanatory variables and $B_{0}$ is the $k \times k$ precision matrix (the inverse of a variance-covariance matrix).

Quantities of Interest

$$ \begin{aligned} E(Y \mid X) = \pi_{i}= \Phi(x_i \beta), \end{aligned} $$

given the posterior draws of $\beta$ from the MCMC iterations.

$$ \begin{aligned} \text{FD}=\Pr(Y=1\mid X_{1})-\Pr(Y=1\mid X). \end{aligned} $$

$$ \begin{aligned} \text{RR}=\Pr(Y=1\mid X_{1})\ /\ \Pr(Y=1\mid X). \end{aligned} $$

$$ \begin{aligned} \frac{1}{\sum t_{i}}\sum_{i:t_{i}=1}[Y_{i}(t_{i}=1)-E[Y_{i}(t_{i}=0)]], \end{aligned} $$

where $t_{i}$ is a binary explanatory variable defining the treatment ($t_{i}=1$) and control ($t_{i}=0$) groups.

$$ \begin{aligned} \frac{1}{\sum t_{i}}\sum_{i:t_{i}=1}[Y_{i}(t_{i}=1)-\widehat{Y_{i}(t_{i}=0)}], \end{aligned} $$

where $t_{i}$ is a binary explanatory variable defining the treatment ($t_{i}=1$) and control ($t_{i}=0$) groups.

Output Values

The output of each Zelig command contains useful information which you may view. For example, if you run:

z.out <- zelig(y ~ x, model = "probit.bayes", data)

then you may examine the available information in z.out by using names(z.out), see the draws from the posterior distribution of the coefficients by using z.out$coefficients, and view a default summary of information through summary(z.out). Other elements available through the $ operator are listed below.

See also

Bayesian probit regression is part of the MCMCpack package by Andrew D. Martin and Kevin M. Quinn. The convergence diagnostics are part of the CODA package by Martyn Plummer, Nicky Best, Kate Cowles, and Karen Vines.

z5 <- zprobitbayes$new()
z5$references()


IQSS/Zelig documentation built on Dec. 11, 2023, 1:51 a.m.