predict.regsubsets | R Documentation |
Predict responses for the best model in a subset selection with a specific number of predictors.
## S3 method for class 'regsubsets'
predict(object, d, newdata, ...)
object |
An object of type "regsubsets" |
d |
Number of data predictors |
newdata |
Dataset for which to predict responses |
... |
Additional arguments |
A set of predicted responses for newdata
subs=leaps::regsubsets(mpg~.,mtcars,subset=1:25)
predict(subs,3L,mtcars[26:32,])
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.