yhat_plus: SCAD or MCP Regression Prediction

Description Usage Arguments Value Author(s) Examples

Description

Fits penalized regression with SCAD or MCP penalty and computes the predictions for the test data.

Usage

1
2
yhat_plus(dfTrain, dfTest, normalize = TRUE, ic = c("BIC", "AIC"), 
		method = c("scad", "mc+", "lasso"))

Arguments

dfTrain

Data frame for training data. Last column must be the output variable.

dfTest

Data frame for test data. Last column must be the output variable.

normalize

Default TRUE means the predictors are centered and scaled. Otherwise no transformation.

ic

"AIC" or "BIC"

method

"scad", "mc+" or "lasso"

Value

The predictions for the test sample

Author(s)

A. I. McLeod

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
Xy <- prostate
X <- prostate[,-9]
y <- prostate[,9]
n <- length(y)
d <- 10
set.seed(777513)
iTe <- sample(n, size=d)
iTr <- (1:n)[!match(1:n, iTe, nomatch = 0) > 0]
trdf <- data.frame(X[iTr,], y=y[iTr]) #X, y already defined
tedf <- data.frame(X[iTe,], y=y[iTe])
yhat_plus(trdf, tedf)

Example output

       69        72        10        68        25         6        55        26 
0.9973917 1.7908203 1.0259369 2.7342739 1.4321338 0.2577856 2.9660044 1.8346914 
       73        34 
2.3487090 0.9242967 

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