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

View source: R/PLOT.R

plot.UPG.ProbitR Documentation

Coefficient plots for UPG.Probit objects

Description

plot generates plots from UPG.Probit objects using ggplot2. Coefficient plots show point estimates for all coefficients as well as their credible intervals.

Usage

## S3 method for class 'UPG.Probit'
plot(
  x = NULL,
  ...,
  sort = FALSE,
  names = NULL,
  xlab = NULL,
  ylab = NULL,
  q = c(0.025, 0.975),
  include = NULL
)

Arguments

x

an object of class UPG.Probit.

...

other plot parameters.

sort

a logical variable indicating whether the plotted coefficients should be sorted according to effect sizes. Default is FALSE.

names

a character vector indicating names for the variables used in the plots.

xlab

a character vector of length 1 indicating a title for the x-axis.

ylab

a character vector of length 1 indicating a title for the y-axis.

q

a numerical vector of length two providing the posterior quantiles to be extracted. Default are 0.025 and 0.975 quantiles.

include

can be used to plot only a subset of variables. Specify the columns of X that should be kept in the plot. See examples for further information.

Value

Returns a ggplot2 object.

Author(s)

Gregor Zens

See Also

summary.UPG.Probit to summarize a UPG.Probit object and create tables. predict.UPG.Probit to predict probabilities using a UPG.Probit object. coef.UPG.Probit to extract coefficients from a UPG.Probit object.

Examples


# estimate a probit model using example data
library(UPG)
data(lfp)
y = lfp[,1]
X = lfp[,-1]
results.probit = UPG(y = y, X = X, model = "probit")

# plot the results and sort coefficients by effect size
plot(results.probit, sort = TRUE)

# plot only variables 1 and 3 with custom names, credible intervals and axis labels
plot(results.probit,
     include  = c(1, 3),
     names    = c("Custom 1", "Custom 2"),
     q        = c(0.1, 0.9),
     xlab     = c("Custom X"),
     ylab     = c("Custom Y"))


UPG documentation built on Nov. 4, 2023, 5:06 p.m.