Learn R Programming

DGLMExtPois (version 0.2.3)

predict.glm_hP: Predict Method for glm_hP Fits

Description

Obtains predictions from a fitted "glm_hP" object.

Usage

# S3 method for glm_hP
predict(object, newdata = NULL, type = c("link", "response"), ...)

Value

A vector with the prediction means.

Arguments

object

a fitted object of class inheriting from "glm_hP".

newdata

optionally, a data frame in which to look for variables with which to predict. If omitted, the fitted linear predictors are used.

type

the type of prediction required. The default is on the scale of the linear predictors; the alternative "response" is on the scale of the response variable.

...

further arguments passed to or from other methods.

Examples

Run this code
data(Bids)
## Fit a hype-Poisson model
Bids$size.sq <- Bids$size ^ 2
fit <- glm.hP(formula.mu = numbids ~ leglrest + rearest + finrest +
              whtknght + bidprem + insthold + size + size.sq + regulatn,
              formula.gamma = numbids ~ 1, data = Bids)

## As the newdata parameter is not used the fitted values are obtained
predict(fit, type = "response")

Run the code above in your browser using DataLab