{"id":625,"date":"2014-05-13T20:40:07","date_gmt":"2014-05-14T01:40:07","guid":{"rendered":"http:\/\/homepages.uc.edu\/~yaozo\/wordpress\/?p=625"},"modified":"2014-05-13T20:40:07","modified_gmt":"2014-05-14T01:40:07","slug":"cross-validation-for-linear-regression","status":"publish","type":"post","link":"https:\/\/zhuoyao.net\/index.php\/2014\/05\/13\/cross-validation-for-linear-regression\/","title":{"rendered":"Cross-Validation for Linear Regression"},"content":{"rendered":"<table style=\"color: #000000;\" summary=\"page for cv.lm {DAAG}\" width=\"100%\">\n<tbody>\n<tr>\n<td>cv.lm {DAAG}<\/td>\n<td align=\"right\">R Documentation<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h2 style=\"color: #606060;\">Cross-Validation for Linear Regression<\/h2>\n<h3 style=\"color: #606060;\">Description<\/h3>\n<p style=\"color: #000000;\">This function gives internal and cross-validation measures of predictive accuracy for ordinary linear regression. The data are randomly assigned to a number of `folds&#8217;. Each fold is removed, in turn, while the remaining data is used to re-fit the regression model and to predict at the deleted observations.<\/p>\n<h3 style=\"color: #606060;\">Usage<\/h3>\n<pre style=\"color: #102040;\">cv.lm(df = houseprices, form.lm = formula(sale.price ~ area), m=3, dots = \n      FALSE, seed=29, plotit=TRUE, printit=TRUE)\n<\/pre>\n<h3 style=\"color: #606060;\">Arguments<\/h3>\n<table style=\"color: #000000;\" summary=\"R argblock\">\n<tbody>\n<tr valign=\"top\">\n<td><code style=\"color: #102040;\">df<\/code><\/td>\n<td>a data frame<\/td>\n<\/tr>\n<tr valign=\"top\">\n<td><code style=\"color: #102040;\">form.lm<\/code><\/td>\n<td>a formula object<\/td>\n<\/tr>\n<tr valign=\"top\">\n<td><code style=\"color: #102040;\">m<\/code><\/td>\n<td>the number of folds<\/td>\n<\/tr>\n<tr valign=\"top\">\n<td><code style=\"color: #102040;\">dots<\/code><\/td>\n<td>uses pch=16 for the plotting character<\/td>\n<\/tr>\n<tr valign=\"top\">\n<td><code style=\"color: #102040;\">seed<\/code><\/td>\n<td>random number generator seed<\/td>\n<\/tr>\n<tr valign=\"top\">\n<td><code style=\"color: #102040;\">plotit<\/code><\/td>\n<td>if TRUE, a plot is constructed on the active device<\/td>\n<\/tr>\n<tr valign=\"top\">\n<td><code style=\"color: #102040;\">printit<\/code><\/td>\n<td>if TRUE, output is printed to the screen<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h3 style=\"color: #606060;\">Value<\/h3>\n<table style=\"color: #000000;\" summary=\"R argblock\">\n<tbody>\n<tr valign=\"top\">\n<td><code style=\"color: #102040;\">ss<\/code><\/td>\n<td>the cross-validation residual sum of squares<\/td>\n<\/tr>\n<tr valign=\"top\">\n<td><code style=\"color: #102040;\">df<\/code><\/td>\n<td>degrees of freedom<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h3 style=\"color: #606060;\">Author(s)<\/h3>\n<p style=\"color: #000000;\">J.H. Maindonald<\/p>\n<h3 style=\"color: #606060;\">See Also<\/h3>\n<p style=\"color: #000000;\"><code style=\"color: #102040;\">lm<\/code><\/p>\n<h3 style=\"color: #606060;\">Examples<\/h3>\n<pre style=\"color: #102040;\">cv.lm()<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>cv.lm {DAAG} R Documentation Cross-Validation for Linear Regression Description This function gives internal and cross-validation measures of predictive accuracy for ordinary linear regression. The data&hellip; <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[20],"tags":[],"class_list":["post-625","post","type-post","status-publish","format-standard","hentry","category-r"],"_links":{"self":[{"href":"https:\/\/zhuoyao.net\/index.php\/wp-json\/wp\/v2\/posts\/625","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/zhuoyao.net\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/zhuoyao.net\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/zhuoyao.net\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/zhuoyao.net\/index.php\/wp-json\/wp\/v2\/comments?post=625"}],"version-history":[{"count":0,"href":"https:\/\/zhuoyao.net\/index.php\/wp-json\/wp\/v2\/posts\/625\/revisions"}],"wp:attachment":[{"href":"https:\/\/zhuoyao.net\/index.php\/wp-json\/wp\/v2\/media?parent=625"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/zhuoyao.net\/index.php\/wp-json\/wp\/v2\/categories?post=625"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/zhuoyao.net\/index.php\/wp-json\/wp\/v2\/tags?post=625"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}