extract.zicreg {bizicount}R Documentation

Texreg for zicreg objects

Description

This is a method for the extract generic to be used with objects that are output from the zic.reg function. The results can then interface with the texreg-package, as shown in examples below.

Usage

## S3 method for class 'zicreg'
extract(model, CI = NULL, id = TRUE, ...)

Arguments

model

A zicreg model object, returned by zic.reg.

CI

The two-tailed confidence level, if desired in the resulting texreg object.

id

Logical indicating whether to prepend equation identifiers to coefficient names (ct_ for count parameters, zi_ for zero-inflated parameters)

...

Ignored.

Value

A texreg-class object, as produced by createTexreg, which can interface with all of that package's generics. See 'Examples.'

Author(s)

John Niehaus

References

Leifeld, Philip (2013). texreg: Conversion of Statistical Model Output in R to LaTeX and HTML Tables. Journal of Statistical Software, 55(8), 1-24. URL http://dx.doi.org/10.18637/jss.v055.i08.

See Also

extract, createTexreg, zic.reg

Examples

# Simulate some zip data
n=1000
x = cbind(1, rnorm(n))
z = cbind(1, rbeta(n, 4, 8))
b = c(1, 2.2)
g = c(-1, 1.7)
lam = exp(x %*% b)
psi = plogis(z %*% g)


y = bizicount::rzip(n, lambda = lam, psi=psi)
dat = cbind.data.frame(x = x[,-1], z = z[,-1], y = y)

# estimate model

mod = zic.reg(y ~ x | z, data = dat)


### Output to table with texreg

# extract information

tr_obj_se = texreg::extract(mod)
tr_obj_ci = texreg::extract(mod, CI = .95)

# output to latex, single table

texreg::texreg(list(tr_obj_se, tr_obj_ci))

# output to plain text, multiple tables

texreg::screenreg(tr_obj_se)
texreg::screenreg(tr_obj_ci)

[Package bizicount version 1.3.2 Index]