predict
is a generic function for predictions from the results of
various model fitting functions. predict.lmodel2
is the method
for model fit objects of class "lmodel2"
.
# S3 method for lmodel2
predict(
object,
method = "MA",
newdata = NULL,
interval = c("none", "confidence"),
level = 0.95,
...
)
If interval = "none"
a numeric vector is returned, while if
interval = "confidence"
a data frame with columns fit
,
lwr
and upr
is returned.
a fitted model object.
character One of the methods available in object
.
An optional data frame in which to look for variables with which to predict. If omitted, the fitted values are used.
Type of interval calculation.
the confidence level required. Currently only 0.95 accepted.
ignored by this method.
Function lmodel2()
from package 'lmodel2' returns a fitted
model object of class "lmodel2"
which differs from that returned by
lm()
. Here we implement a predict()
method for objects of
this class. It differs from the generic method and that for lm
objects in having an additional formal parameter method
that must be
used to select which of the methods supported by lmodel2()
are to be
used in the prediction. The returned object is similar in its structure to
that returned by predict.lm()
but lacking names or rownames.
lmodel2