Learn R Programming

UPG: Efficient Bayesian Regression Models for Binary and Categorical Outcomes

UPG offers efficient Bayesian implementations of regression models for binary and categorical data. The package can be used to estimate Bayesian versions of probit, logit, multinomial logit and binomial logit models. In this context, the Bayesian paradigm is especially useful for uncertainty quantification and solving issues related to rare events and (quasi-)perfect separation. UPG allows for efficient posterior sampling in cases with imbalanced data as the implemented algorithms are based on the marginal data augmentation schemes developed in Frühwirth-Schnatter, Zens, and Wagner (2020). Several functions are available for tabulating and visualizing results as well as for predictive exercises.

Installation

UPG is available on CRAN and can be installed as follows:

install.packages("UPG")

Usage

The core function for estimating models is UPG(). Given a suitable outcome vector y and a suitable design matrix X, the four implemented models can be estimated using

  • UPG(y, X, model = "probit") for probit models
  • UPG(y, X, model = "logit") for binary logit models
  • UPG(y, X, model = "mnl") for multinomial logit models
  • UPG(y, X, Ni, model = "binomial") for binomial logit models

where binomial logit models require the number of trials Ni as additional input.

The estimation output can be analyzed using a variety of tools implemented in UPG. To tabulate and visualize the results, summary() and plot() are available. Predictions can be obtained using predict(). Extracting coefficients can be done using coef() and logLik() returns the log-likelihood of the model. Finally, the user has access to a number of MCMC diagnostics via UPG.Diag().

More details and applied examples may be found in the package vignette.

References

Frühwirth-Schnatter, S., Zens, G., & Wagner, H. (2020). Ultimate Pólya Gamma Samplers - Efficient MCMC for possibly imbalanced binary and categorical data. arXiv preprint arXiv:2011.06898.

Copy Link

Version

Install

install.packages('UPG')

Monthly Downloads

699

Version

0.3.4

License

GPL-3

Maintainer

Gregor Zens

Last Published

November 4th, 2023

Functions in UPG (0.3.4)

predict.UPG.Logit

Predicted probabilities from UPG.Logit objects
predict.UPG.MNL

Predicted probabilities from UPG.MNL objects
print.UPG.Probit

Print information for UPG.Probit objects
program

Students program choices.
summary.UPG.MNL

Estimation results and tables for UPG.MNL objects
summary.UPG.Probit

Estimation result summary and tables for UPG.Probit objects
print.UPG.Binomial

Print information for UPG.Binomial objects
predict.UPG.Probit

Predicted probabilities from UPG.Probit objects
titanic

Grouped Titanic survival data.
print.UPG.MNL

Print information for UPG.MNL objects
print.UPG.Logit

Print information for UPG.Logit objects
summary.UPG.Binomial

Estimation results and tables for UPG.Binomial objects
logLik.UPG.Binomial

Compute log-likelihoods from UPG.Binomial objects
summary.UPG.Logit

Estimation results and tables for UPG.Logit objects
UPG.Diag.Logit

MCMC Diagnostics for UPG.Logit objects
UPG

Efficient MCMC Samplers for Bayesian probit regression and various logistic regression models
UPG.Diag.MNL

MCMC Diagnostics for UPG.MNL objects
UPG.Diag

MCMC Diagnostics for UPG.Probit, UPG.Logit, UPG.MNL and UPG.Binomial objects using coda
UPG.Diag.Binomial

MCMC Diagnostics for UPG.Binomial objects
coef.UPG.MNL

Extract coefficients from UPG.MNL objects
coef.UPG.Binomial

Extract coefficients from UPG.Binomial objects
coef.UPG.Probit

Extract coefficients from UPG.Probit objects
coef.UPG.Logit

Extract coefficients from UPG.Logit objects
UPG.Diag.Probit

MCMC Diagnostics for UPG.Probit objects
plot.UPG.Logit

Coefficient plots for UPG.Logit objects
lfp

Female labor force participation data.
logLik.UPG.Logit

Compute log-likelihoods from UPG.Logit objects
predict.UPG.Binomial

Predicted probabilities from UPG.Binomial objects
plot.UPG.Binomial

Coefficient plots for UPG.Binomial objects
logLik.UPG.MNL

Compute log-likelihoods from UPG.MNL objects
plot.UPG.MNL

Coefficient plots for UPG.MNL objects
plot.UPG.Probit

Coefficient plots for UPG.Probit objects
logLik.UPG.Probit

Compute log-likelihoods from UPG.Probit objects