Learn R Programming

glmtoolbox (version 0.1.12)

estequa.zeroinflation: Estimating Equations in Regression Models to deal with Zero-Excess in Count Data

Description

Computes the estimating equations evaluated at the parameter estimates and the observed data for regression models to deal with zero-excess in count data.

Usage

# S3 method for zeroinflation
estequa(object, submodel = c("counts", "zeros"), ...)

Value

A vector with the values of the estimating equations evaluated at the parameter estimates and the observed data.

Arguments

object

an object of the class zeroinflation.

submodel

an (optional) character string which allows to specify the model: "counts" or "zeros". By default, submodel is set to "counts".

...

further arguments passed to or from other methods.

Examples

Run this code
####### Example 1: Roots Produced by the Columnar Apple Cultivar Trajan
data(Trajan)
fit1 <- zeroalt(roots ~ photoperiod, family="nbf(log)", zero.link="logit", data=Trajan)
estequa(fit1)

fit1a <- zeroinf(roots ~ photoperiod, family="nbf(log)", zero.link="logit", data=Trajan)
estequa(fit1a)

####### Example 2: Self diagnozed ear infections in swimmers
data(swimmers)
fit2 <- zeroalt(infections ~ frequency | location, family="nb1(log)", data=swimmers)
estequa(fit2)

fit2a <- zeroinf(infections ~ frequency | location, family="nb1(log)", data=swimmers)
estequa(fit2a)

####### Example 3: Article production by graduate students in biochemistry PhD programs
bioChemists <- pscl::bioChemists
fit3 <- zeroalt(art ~ fem + kid5 + ment, family="nb1(log)", data = bioChemists)
estequa(fit3)

fit3a <- zeroinf(art ~ fem + kid5 + ment | ment, family="nb1(log)", data = bioChemists)
estequa(fit3a)

Run the code above in your browser using DataLab