R/yhat_step.R

yhat_step <-
function(dfTrain, dfTest, ic=c("BIC","AIC")) {
    ansFull <- lm(y~., data=dfTrain)
    ic <- match.arg(ic)
    k <- ifelse(identical(ic, "AIC"), 2, log(nrow(dfTrain)))
    junk <- capture.output(ansStep <- step(ansFull, k=k))
    predict(ansStep, newdata=dfTest)
  }

Try the gencve package in your browser

Any scripts or data that you put into this service are public.

gencve documentation built on May 2, 2019, 6:08 a.m.