predict.logbin.smooth: Predict Method for logbin.smooth Fits

Description Usage Arguments Details Value Note Author(s) See Also Examples

View source: R/predict.logbin.smooth.r

Description

Obtains predictions from a fitted logbin.smooth object.

Usage

1
2
3
## S3 method for class 'logbin.smooth'
predict(object, newdata = NULL, type = c("link", "response", "terms"), 
        terms = NULL, na.action = na.pass, ...)

Arguments

object

a fitted object of class inheriting from "logbin.smooth".

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. The "terms" option returns a matrix giving the fitted values of each term in the model formula on the linear predictor scale.

The value of this argument can be abbreviated.

terms

with type = "terms" by default all terms are returned. A character vector specifies which terms are to be returned.

na.action

function determining what should be done with missing values in newdata. The default is to predict NA.

...

further arguments passed to or from other methods.

Details

predict.logbin.smooth constructs the underlying basis functions for smooth variables in newdata and runs predict.logbin to obtain predictions. Note that if values of smooth covariates in newdata are outside the covariate space of object, an error will be returned.

If newdata is omitted, the predictions are based on the data used for the fit. In that case how cases with missing values in the original fit are treated is determined by the na.action argument of that fit. If na.action = na.omit, omitted cases will not appear in the residuals, whereas if na.action = na.exclude they will appear, with residual value NA. See also napredict.

Value

A vector or matrix of predictions. For type = "terms", this is a matrix with a column per term, and may have an attribute "constant".

Note

Variables are first looked for in newdata and then searched for in the usual way (which will include the environment of the formula used in the fit). A warning will be given if the variables found are not of the same length as those in newdata if it was supplied.

Author(s)

Mark W. Donoghoe markdonoghoe@gmail.com

See Also

logbin.smooth, predict.logbin

predict.glm for the equivalent method for models fit using glm.

Examples

1
## For an example, see example(logbin.smooth)

mdonoghoe/logbin documentation built on Aug. 13, 2021, 7:30 p.m.