predict.crm | R Documentation |
Obtains predictions from a fitted crm
object.
## S3 method for class 'crm'
predict(object, newdata = NULL, ...)
object |
a fitted object of class " |
newdata |
optionally, a data frame in which to look for variables with which to predict. If omitted, the fitted coefficients are used. |
... |
further arguments passed to or from other methods. |
predict.crm
produces predicted values, obtained by evaluating the fitted
crm
object on the data frame newdata
.
predict.crm
returns a vector of predicted response values.
Peter Filzmoser, Sebastiaan Hoppner, Irene Ortner, Sven Serneels, and Tim Verdonck
Filzmoser, P., Hoppner, S., Ortner, I., Serneels, S., and Verdonck, T. (2020). Cellwise Robust M regression. Computational Statistics and Data Analysis, 147, 106944. DOI:10.1016/j.csda.2020.106944
crm
, spadimo
, cellwiseheatmap
, daprpr
library(crmReg)
data(topgear)
train <- topgear[1:200, ]
test <- topgear[201:245, ]
crmfit <- crm(formula = MPG ~ ., data = train, seed = 2020)
estimated_MPG_test <- predict(crmfit, newdata = test)
plot(test$MPG, estimated_MPG_test, xlab = "True MPG", ylab = "Estimated MPG")
abline(a = 0, b = 1)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.