zibPlot: Function to plot parameter posteriors from Zero-inflated Beta...

Description Usage Arguments Value Examples

Description

Function to plot parameter posteriors from Zero-inflated Beta Regressions

Usage

1
2
zibPlot(obj, iter, variable_names = NULL, xlab = "\nCoef. Estimates",
  title = "")

Arguments

obj

model object from zoib where one.inflation = FALSE and joint = FALSE.

iter

integer. The number of iterations.

variable_names

character vector of variable names. Must be in the same order and the same length as variables enterd into the zoib formula.

xlab

character string x-axis label.

title

character string title for the plot

Value

a ggplot2 plot

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
## Not run: 
Load packages
library(zoib)
library(zibHelpers)

# Run example of clustered zero-inflated beta regression from
# Liu and Kong (under review, 12-14)

# Load data
data("AlcoholUse", package = "zoib")
AlcoholUse$Grade <- as.factor(AlcoholUse$Grade)

nIter = 50 # Number of iterations, including burn-in

# Estimate
Out <- zoib(Percentage ~ Grade + Days + Gender|1|Grade + Days + Gender|1,
            data = AlcoholUse, random = 1, EUID = AlcoholUse$County,
            zero.inflation = TRUE, one.inflation = FALSE, joint = FALSE,
            n.iter = nIter)

# Plot the posterior summary
zibPlot(Out, iter = nIter)

## End(Not run)

christophergandrud/zibHelpers documentation built on May 13, 2019, 7:04 p.m.