poisreg: Poisson regression

View source: R/poisreg.R

poisregR Documentation

Poisson regression

Description

A unified interface to perform Poisson, Negbin and log-normal Poisson models

Usage

poisreg(
  formula,
  data,
  weights,
  subset,
  na.action,
  offset,
  contrasts = NULL,
  start = NULL,
  mixing = c("none", "gamma", "lognorm"),
  vlink = c("nb1", "nb2"),
  opt = c("bfgs", "nr", "newton"),
  maxit = 100,
  trace = 0,
  check_gradient = FALSE,
  ...
)

## S3 method for class 'poisreg'
scoretest(object, ..., vcov = NULL)

## S3 method for class 'poisreg'
residuals(object, ..., type = c("deviance", "pearson", "response"))

Arguments

formula

a symbolic description of the model, (for the count component and for the selection equation)

data

a data frame

subset, weights, na.action, offset, contrasts

see stats::lm,

start

a vector of starting values

mixing

the mixing distribution, one of "none", "gamma" and "lognorm"

vlink

one of "nb1" and "nb2"

opt

optimization method

maxit

maximum number of iterations

trace

printing of intermediate result

check_gradient

if TRUE the numeric gradient and hessian are computed and compared to the analytical gradient and hessian

...

further arguments

object

a poisreg object

vcov

the covariance matrix estimator to use for the score test

type

the type of residuals for the residuals method

Value

an object of class c("poisreg", "micsr"), see micsr::micsr for further details.

Examples

nb1 <- poisreg(trips ~ workschl + size + dist + smsa + fulltime + distnod +
               realinc + weekend + car, trips, mixing = "gamma", vlink = "nb1")

micsr documentation built on June 8, 2025, 9:31 p.m.