Estimate the regression coefficients in an NB GLM model

Share:

Description

Estimate the regression coefficients in an NB GLM model with known dispersion parameters

Usage

1
2
irls.nb.1(y, s, x, phi, beta0 = rep(NA, p), mustart = NULL, maxit = 50,
  tol.mu = 0.001/length(y), print.level = 0)

Arguments

y

an n vector of counts

s

a scalar or an n vector of effective library sizes

x

an n by p design matrix

phi

a scalar or an n-vector of dispersion parameters

mustart

starting values for the vector of means

beta0

a vector specifying known and unknown components of the regression coefficients: non-NA components are hypothesized values of beta, NA components are free components

maxit

maximum number of iterations

tol.mu

a number, convergence criteria

print.level

a number, print level

Details

This function estimates the regression coefficients using iterative reweighted least squares (IRLS) algorithm, which is equivalent to Fisher scoring. The implementation is based on glm.fit.

Users can choose to fix some regression coefficients by specifying beta0. (This is useful when fitting a model under a null hypothesis.)

Value

a list of the following components:

beta

a p-vector of estimated regression coefficients

mu

an n-vector of estimated mean values

conv

logical. Was the IRLS algorithm judged to have converged?

zero

logical. Was any of the fitted mean close to 0?