Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

negbinirr

Incidence rate ratios for a negative binomial regression.


Description

This function estimates a negative binomial regression model and calculates the corresponding incidence rate ratios.

Usage

negbinirr(formula, data, robust = FALSE, clustervar1 = NULL, 
          clustervar2 = NULL, start = NULL, control = glm.control())

Arguments

formula

an object of class “formula” (or one that can be coerced to that class).

data

the data frame containing these data. This argument must be used.

robust

if TRUE the function reports White/robust standard errors.

clustervar1

a character value naming the first cluster on which to adjust the standard errors.

clustervar2

a character value naming the second cluster on which to adjust the standard errors for two-way clustering.

start

starting values for the parameters in the glm.nb model.

control

see glm.control.

Details

If both robust=TRUE and !is.null(clustervar1) the function overrides the robust command and computes clustered standard errors.

Value

irr

a coefficient matrix with columns containing the estimates, associated standard errors, test statistics and p-values.

fit

the fitted glm.nb object.

call

the matched call.

See Also

Examples

# simulate some data
set.seed(12345)
n = 1000
x = rnorm(n)
y = rnegbin(n, mu = exp(1 + 0.5 * x), theta = 0.5)

data = data.frame(y,x)

negbinirr(formula=y~x,data=data)

mfx

Marginal Effects, Odds Ratios and Incidence Rate Ratios for GLMs

v1.2-2
GPL-2 | GPL-3
Authors
Alan Fernihough [aut, cre], Arne Henningsen [ctb]
Initial release
2019-02-06

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.