Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

predict.overglm

Predictions for Negative Binomial and Beta-Binomial regression models


Description

Produces predictions and optionally estimates standard errors of those predictions from a fitted negative binomial or beta-binomial regression model.

Usage

## S3 method for class 'overglm'
predict(object, ..., newdata, se.fit = FALSE, type = c("link", "response"))

Arguments

object

an object of class overglm which is obtained from the fit of a negative binomial or beta-binomial regression model.

...

further arguments passed to or from other methods.

newdata

an (optional) data frame in which to look for variables with which to predict. If omitted, the fitted linear predictors are used.

se.fit

an (optional) logical switch indicating if standard errors are required. By default, se.fit is set to be FALSE.

type

an (optional) character string giving the type of prediction required. The default, "link", is on the scale of the linear predictors, and the alternative, "response", is on the scale of the response variable.

Value

A matrix with so many rows as newdata and one column with the predictions. If se.fit=TRUE then a second column with estimates standard errors is included.

Examples

fit1 <- overglm(tumors ~ group, family="nb3(log)", data=mammary)
newdata <- data.frame(group=as.factor(c("control","retinoid")))
predict(fit1,newdata=newdata,type="response",se.fit=TRUE)

fit2 <- overglm(cbind(cells,200-cells) ~ tnf + ifn + tnf*ifn, family="bb(logit)", data=cellular)
newdata <- data.frame(tnf=c(0,100),ifn=c(100,0))
predict(fit2,newdata=newdata,type="response",se.fit=TRUE)

glmtoolbox

Set of Tools to Data Analysis using Generalized Linear Models

v0.1.0
GPL-2 | GPL-3
Authors
Luis Hernando Vanegas [aut, cre], Luz Marina Rondón [aut], Gilberto A. Paula [aut]
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.