Investigate the joint impact of salary and the number of children on the amount spent. To that
Question:
- Investigate the joint impact of salary and the number of children on the amount spent. To that end, run a regression model with "AmountSpent" as the response and "Salary" and "Children" as the only 2 predictors. Then, answer the following questions:
Tips:
lm(formula = AmountSpent ~ Salary + Children, data = d)
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 1.822e+024.534e+01 4.019 6.3e-05 ***
Salary 2.236e-02 6.635e-0433.704 < 2e-16 ***
Children -2.356e+021.933e+01 -12.191 < 2e-16 ***
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.'0.1 ' ' 1
Residual standard error: 641.3 on 997 degrees of freedom
Multiple R-squared: 0.5557,Adjusted R-squared: 0.5548
F-statistic: 623.4 on 2 and 997 DF, p-value: < 2.2e-16
- Now, add an interaction term between salary and number of children to the above model, i.e., first identify an interaction term between salary and the number of children, then include it as a third predictor variable (in addition to the main effects of salary and number of children). Then, answer the following questions:
Tips:
lm(formula = AmountSpent ~ Salary + Children + Salary * Children, data = d)
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) -6.167e+01 5.646e+01-1.092 0.275
Salary 2.673e-02 9.022e-0429.632 < 2e-16 ***
Children 7.691e+00 3.971e+01 0.194 0.846
Salary:Children -4.234e-036.078e-04 -6.966 5.91e-12 ***
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.'0.1 ' ' 1
Residual standard error: 626.5 on 996 degrees of freedom
Multiple R-squared: 0.5763, Adjusted R-squared: 0.575
F-statistic: 451.6 on 3 and 996 DF, p-value: < 2.2e-16
Question: Is this model (#2) better compared to the previous model (#1)? Why?