Skip to content

Instantly share code, notes, and snippets.

@karan19100
Created July 18, 2020 21:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save karan19100/ac15f72b7523a5b208bf6143c15aa424 to your computer and use it in GitHub Desktop.
Save karan19100/ac15f72b7523a5b208bf6143c15aa424 to your computer and use it in GitHub Desktop.
step4_predicting_linear_model_by_karan_shah
# K-Cross Validation
kfold <- CVlm(data = newdata2, form.lm = formula(HEMATOCRIT ~ HEMAGLOBIN), m=5,
dots = FALSE, seed=123, legend.pos="topleft",
main="Cross Validation; k=5",
plotit=TRUE, printit=FALSE)
# The mean squared error measures how a regression line is close to a set of points
attr(kfold, 'ms')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment