如何在R中执行70/30的保持

时间:2017-09-11 22:30:03

标签: r regression cross-validation

我正在尝试根据以下线性回归模型进行预测:

enter image description here

我想根据这个公式预测我的拦截(市场份额),给出每个响应变量的值。从这些结果中我的公式是什么,我可以为每个变量插入数字吗?

或者我是否需要先进行训练/训练集?

编辑:添加了结果文本。

summary(fit2)

Call:
lm(formula = Headache_Panel_Cleaned$Private_Label_Cleaned ~ Income_cleaned + 
    Age_Cleaned + Education_Cleaned, data = Headache_Panel_Cleaned)

Residuals:
    Min      1Q  Median      3Q     Max 
-53.880 -33.804  -5.473  32.589  68.171 

Coefficients:
                  Estimate Std. Error t value Pr(>|t|)    
(Intercept)       52.02867    0.96849  53.721   <2e-16 ***
Income_cleaned    -0.22711    0.01199 -18.949   <2e-16 ***
Age_Cleaned       -0.11363    0.01334  -8.516   <2e-16 ***
Education_Cleaned  0.13104    0.01213  10.807   <2e-16 ***
---
Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1

Residual standard error: 35.09 on 38115 degrees of freedom
  (8224 observations deleted due to missingness)
Multiple R-squared:  0.0102,    Adjusted R-squared:  0.01012 
F-statistic:   131 on 3 and 38115 DF,  p-value: < 2.2e-16

0 个答案:

没有答案