Learn R Programming

ProxReg (version 1.1.2)

ols_KCV: K-Fold Cross Validation for OLS

Description

ols_KCV makes the K-Fold Cross Validation for ordinary least squared regression

Usage

ols_KCV(data,k,y,x)

Value

the root mean square error after K-Fold Cross Validation on training set

Arguments

data

full dataset which will be used for KCV

k

integer, which indicates how many training and test set will be splited from the dataset

y

dependent variable

x

independent variables

Examples

Run this code
df<-mtcars
ols_KCV(mtcars,5,"hp",c("mpg","qsec","disp"))

Run the code above in your browser using DataLab