predict.bess: make predictions from a "bess" object.

Description Usage Arguments Value Author(s) References See Also Examples

View source: R/predict.bess.R

Description

Similar to other predict methods, which returns predictions from a fitted "bess" object.

Usage

1
2
  ## S3 method for class 'bess'
predict(object, newdata, type = c("ALL", "opt", "AIC", "BIC", "EBIC"),...)

Arguments

object

Output from the bess function or the bess.one function.

newdata

New data used for prediction.

type

Types of coefficients returned. type = "AIC" cooresponds to the predictor with optimal AIC value; type = "BIC" cooresponds to the predictor with optimal BIC value; type = "EBIC" cooresponds to the predictor with optimal EBIC value; type = "ALL" cooresponds to all predictors in the bess object; type = "opt" cooresponds to predictors in best model. Default is ALL.

...

Additional arguments affecting the predictions produced.

Value

The object returned depends on the types of family.

Author(s)

Canhong Wen, Aijun Zhang, Shijie Quan, and Xueqin Wang.

References

Wen, C., Zhang, A., Quan, S. and Wang, X. (2017). BeSS: an R package for best subset selection in linear, logistic and CoxPH models. arXiv: 1709.06254.

See Also

bess, bess.one

Examples

1
2
3
data <- gen.data(500, 20, family = "gaussian", 10, 0.2, 1)
fit <- bess(data$x, data$y, family = "gaussian")
pred=predict(fit, newdata = data$x)

BeSS documentation built on Jan. 30, 2018, 5:03 p.m.