View source: R/zicreg-methods.R
extract.zicreg | R Documentation |
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.
## S3 method for class 'zicreg'
extract(model, CI = NULL, id = TRUE, ...)
model |
A zicreg model object, returned by |
CI |
The two-tailed confidence level, if desired in the resulting
|
id |
Logical indicating whether to prepend equation identifiers to
coefficient names ( |
... |
Ignored. |
A texreg-class
object, as produced by
createTexreg
, which can interface with all of that
package's generics. See 'Examples.'
John Niehaus
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.
extract
, createTexreg
,
zic.reg
# 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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.