Description Usage Arguments Value Warning Examples
This is a method for the generic function predict
for class "gl1ce"
, typically produced from
gl1ce()
. When newdata
is missing, the
fitted values are extracted, otherwise returns new predictions.
1 2 3 |
object |
a fitted |
newdata |
a data frame containing the values at which predictions are required.
This argument can be missing, in which case predictions are made at
the same values used to compute the object.
Only those predictors referred to in the right side of the formula in
object need be present by name in |
type |
type of predictions, with choices "link" (the default), or
"response". The default produces predictions on the scale of the
additive predictors, and with |
se.fit |
logical indicating if standard errors should be returned as well. Not yet available. |
... |
further potential arguments passed to methods. |
a vector of predictions.
predict
can produce incorrect predictions when the newdata
argument is used if the formula in object
involves
data-dependent transformations, such as poly(Age, 3)
or sqrt(Age - min(Age))
.
1 2 3 4 5 6 7 8 9 10 11 12 | ## start with
example(gl1ce)
predict(gl1c.E, new = esoph[1:7,])# type 'link'
predict(gl1c.E, new = esoph[1:7,], type = "response")
## identities / consistency checks :
stopifnot(predict(gl1c.E, type = "response") == fitted(gl1c.E),
all.equal(predict(gl1c.E)[1:7],
as.vector(predict(gl1c.E, new = esoph[1:7,]))),
all.equal(fitted(gl1c.E)[1:7],
as.vector(predict(gl1c.E, new = esoph[1:7,], type = "response")))
)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.