Next: polygamma() Up: MacAnova Help File Previous: plot()   Contents

# poisson()

Usage:
 ```poisson([Model] [, print:F or silent:T, incr:T, offsets:vec, pvals:T,\ maxiter:m, epsilon:eps, coefs:F]), vec a REAL vector, m an integer > 0, eps REAL > 0 ```

Keywords: glm, regression, categorical data
```poisson(Model) computes a log linear regression fit of the model
specified in the CHARACTER variable Model.  If y is the response
variable in the model it must be a REAL vector with y[i] >= 0.
Estimation is by maximum likelihood on the assumption that y[i] is
Poisson.  If any y[i] is not an integer a warning message is printed.

See topic 'models' for information on specifying Model.

poisson(Model,...) is equivalent to glmfit(Model,dist:"poisson",

poisson() sets the side effect variables RESIDUALS, WTDRESIDUALS, SS,
DF, HII, DEPVNAME, TERMNAMES, and STRMODEL.  The elements of
WTDRESIDUALS are the final weighted residuals in the iteratively
reweighted least squares fit to log(response).  See topic 'glm'.
Without keyword phrase 'inc:T' (see below), TERMNAMES has value
vector("","", ...,"Overall model","ERROR1"), DF has value vector(0,0,
...,ModelDF,ErrorDF) and SS has value vector(0,0,...,ModelDeviance,
ErrorDeviance).

If, say, Model is "y=x1+x2", an iterative algorithm fits log(y) as a
linear function of x1 and x2.  A two line Analysis of Deviance table is
printed, with line 1 the diffence between the deviance from a model with
all coefficients 0 and the deviance of the estimated model, and line
2, labeled "ERROR", the deviance of the estimated model.  Under
appropriate assumptions, the latter can be used to test the goodness of
fit of the model.

poisson(Model,inc:T) computes the full Poisson model and all partial
models -- only a constant term, the constant and the first term, and so
on.  It prints an Analysis of Deviance table, with one line for each
term, plus the deviance of the complete model labeled as "ERROR" .
Each term's deviance is the reduction in deviance associated with that
term.

If you omit Model (poisson()), the model from the most recent GLM
command such as poisson() or anova(), or the model in CHARACTER variable
STRMODEL is assumed.

Computations are carried out using iteratively reweighted least squares
with starting values derived from an unweighted least squares fit of
log(y + .25).

Other keyword phrases
Keyword phrase  Default  Meaning
maxiter:m       50     Positive integer m is the maximum number of
iterations that will be allowed in fitting

epsilon:eps    1e-6    Small positive REAL specifying relative error
in objective function (2*log likelihood)
required to end iteration

offsets:OffVec  none   Causes model to be fit to log(p) to be 1*Offvec
+ Model, where OffVec is a REAL vector the same
length as response y.  Note OffVec is in log
units.

See topic 'glm_keys' for information on keyword phrases print:F,
silent:T, coefs:F and pvals:T.

The default value for pvals can be changed by setoptions(pvals:T).  See
topic setoptions(), subtopic 'options:"pvals"'.

Examples of the use of 'offsets'.
Cmd> poisson("y=x", offsets:3*x, inc:T, pvals:T)
The P value associated with x can be used to test the hypothesis H0:
beta1 = 3 in the model log(E[y]) = beta0 + beta1*x.

Cmd> poisson("y=1", offsets:rep(log(10), length(y), inc:T, pvals:T)
The P value associated with the CONSTANT term can be used to test H0:
E[y] = 10, assuming y contains a random sample from a Poisson
distribution.
```

Gary Oehlert 2003-01-15