lasso2 (version 1.2-9)

predict.gl1ce: Prediction Method for a `gl1ce' Object

Description

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.

Usage

## S3 method for class 'gl1ce':
predict(object, newdata, type=c("link", "response"),
              se.fit = FALSE, ...)

Arguments

Value

a vector of predictions.

Warning

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)).

Examples

Run this code
## 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")))
           )

Run the code above in your browser using DataCamp Workspace