Learn R Programming

micsr (version 0.1-2)

poisreg: 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 poisreg scoretest(object, ..., vcov = NULL)

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

Value

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

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

Examples

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

Run the code above in your browser using DataLab