predict.serp | R Documentation |
This function takes a fitted serp
object produced by serp() and
produces predicted values. Type of predictions returned include response,
link and class. Prediction is also possible with new set of values having
the same column names as in the original values used for the model fit.
## S3 method for class 'serp' predict(object, type = c("link", "response", "class"), newdata = NULL, ...)
object |
An object of class |
type |
could be any of these: response, link or terms. |
newdata |
fresh dataset with all relevant variables. |
... |
additional arguments. |
A vector of predicted classes with type
equal to 'class'
or a dataframe of predicted values for type
equal to 'response'
and 'link'.
anova.serp
, summary.serp
,
confint.serp
, vcov.serp
library(serp) m <- serp(rating ~ temp + contact, slope = "penalize", reverse = TRUE, link = "logit", tuneMethod = "user", lambda = 1, data = wine) head(predict(m, type = "link")) head(predict(m, type = "response")) predict(m, type = "class") n.wine <- wine[1:20,] predict(m, newdata = n.wine, type = "class")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.