#read Hald data
data(Hald)
#run the main function:
hald.Bvs<- Bvs(formula="y~x1+x2+x3+x4", data=Hald, n.keep=16)
#Prediction at the mean value:
pred.mean<- predict(object=hald.Bvs, newdata=as.data.frame(t(colMeans(Hald))))
#prediction at the original design matrix
predict(object=hald.Bvs)
Run the code above in your browser using DataLab