powered by
ols_KCV makes the K-Fold Cross Validation for ordinary least squared regression
ols_KCV(data,k,y,x)
the root mean square error after K-Fold Cross Validation on training set
full dataset which will be used for KCV
integer, which indicates how many training and test set will be splited from the dataset
dependent variable
independent variables
df<-mtcars ols_KCV(mtcars,5,"hp",c("mpg","qsec","disp"))
Run the code above in your browser using DataLab