predict.GeDS {GeDS} | R Documentation |
Predict method for GeDS objects
Description
This is a user friendly method to compute predictions from GeDS objects.
Usage
## S3 method for class 'GeDS'
predict(object, newdata, type = c("response", "link", "terms"), n = 3L, ...)
Arguments
object |
the |
newdata |
an optional |
type |
character string indicating the type of prediction required. By
default it is equal to |
n |
integer value (2, 3 or 4) specifying the order ( |
... |
potentially further arguments (required by the definition of the generic function). They are ignored, but with a warning. |
Details
This is a method for the function predict
that allows
the user to handle GeDS-Class
objects.
In analogy with the function predict.glm
in the
stats package, the user can specify the scale on which the predictions
should be computed through the argument type
. If the predictions are
required to be on the scale of the response variable, the user should set
type = "response"
, which is the default. Alternatively if one wants
the predictions to be on the predictor scale, it is necessary to set
type = "link"
.
By specifying type = "terms"
, it is possible to inspect the predicted
values separately for each single independent variable which enter either the
GeD spline component or the parametric component of the predictor model. In
this case the returned result is a matrix whose columns correspond to the
terms supplied via newdata
or extracted from the object
.
As GeDS objects contain three different fits (linear, quadratic and cubic),
it is possible to specify the order for which GeDS predictions are required
via the input argument n
.
Value
A numeric vector corresponding to the predicted values (if
type = "link"
or type = "response"
). If type = "terms"
a
numeric matrix with a column per term.
See Also
predict
for the standard definition;
GGeDS
for examples.