【原创】R语言数据分析可视化案例报告论文(附代码数据) 有憎言遂步回归变量选择数据分析可视化 案例报告 介绍 所有可能的回归 所有子集回归检验潜在自变量集合的所有可能的子集。如果有K个潜在的自变量(除了常数),那么就 有2k2k不) ## Best Subsets Regression ## ## Model Index Predictors ## -- ## 1 wt ## 2 hp wt ## 3 hp wt qsec ## 4 disp hp wt qsec ## -- ## ## ## Subsets Regression Summary ## Adj. Pred ## Model R-Square R-Square R-Square C(p) APC ## AIC SBIC SBC MSEP FPE HSP ## 1 0・7528 0・7446 0・7087 12・4809
## 2 0・8268 0・8148 0・7811 2・3690
## 3
0・8171 0・ 782 3・0617
## 4 0・8351 0・8107 0・ 771
166・0294 74・2916
9・8972 9・8572 0・3199
7・4314 7・3563 0・2402 157・1426 67・7238
7・6140 7・4756 0・2461
70・0408
8・1810 7・9497 0・ 2644 ## ## AIC: Akaike Information Criteria ## SBIC: Sawa's Bayesian Information Criteria ## SBC: Schwarz Bayesian Criteria ## MSEP: Estimated error of prediction, assuming multivariate normality 【原创】R语言数据分析可视化案例报告论文(附代码数据) 有问题到淘宝找“大数据部落”就可以了 ## FPE: Final Prediction Error ## HSP: Hocking's Sp ## APC: Amemiya Prediction Criteria The plotmethod shows the panel of fit criteria for best subset regression methods. model <-lm(mpg ~disp +hp +wt +qsec, data = mtcars) k <-ols_best_subset(model) plot(k) R-Square orw 72 Stepwise Forward Regression Best Subsets Regression Adj. R-Square ?
【原创】R语言数据分析可视化案例报告论文(附代码数据) 有问题到淘宝找“大数据部落”就可以了 Build regression model from a set of candidate predictor variables by entering predictors based on p values, in a stepwise manner until there is no variable left to enter any more. The model should include all the candidate predictor variables. If details is set to true, each step is displayed. Variable Selection # stepwise forward regression model <-lm(y ~・,data = surgical) ols_step_forward(model) ## We are selecting variables based on p value