Learn R Programming

holiglm (version 1.0.1)

predict.hglm: Predict Method for HGLM Fits

Description

Obtains predictions from a fitted holistic generalized linear model object.

Usage

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

Value

A vector of predicted values. If type = "link", the predicted values are in the link scale; if type = "response", the predicted values are in the response scale.

Arguments

object

a fitted object of class inheriting from "hglm".

newdata

an optional data frame containing new observations for which predictions are to be made. If ommitted, the fitted linear predictors are used.

type

the type of predictions to be made. Possible values are "link" (default) or "response". If "link", the predictions are in the link scale; if "response", the predictions are transformed to the response scale.

...

optional arguments currently ignored.

Examples

Run this code
dat <- rhglm(100, c(1, 2, -3, 4, 5, -6))
fit <- hglm(y ~ ., constraints = k_max(3), data = dat)
pred <- predict(fit)
pred2 <- predict(fit, newdata=dat)

Run the code above in your browser using DataLab