Question One

Setting a work directory

Import data

(a)

Plot

## Comment ### Looking at the numbers, as income increases, expenditure also seems to increase, but not perfectly. For example, income 30 corresponds to expenditure 9, income 33 to 8 (which is a slight decrease), then 40 to 11. So there might be a general upward trend but with some variability. The plot might show a positive correlation, but maybe not very strong. I should check for outliers or any non-linear patterns. Since the income ranges from 13 to 43 and expenditure from 4 to 11, the plot should spread across that range. Maybe the relationship is roughly linear? That’s what I need for regression. So in the plot, I can comment on the direction (positive), form (linear?), strength (moderate?), and any unusual features.

(b)

## 
## Call:
## lm(formula = expenditure ~ income)
## 
## Residuals:
##      Min       1Q   Median       3Q      Max 
## -0.87148 -0.66518 -0.03357  0.69345  0.78137 
## 
## Coefficients:
##             Estimate Std. Error t value Pr(>|t|)    
## (Intercept)  2.17266    0.72022   3.017   0.0166 *  
## income       0.20230    0.02327   8.692 2.39e-05 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 0.733 on 8 degrees of freedom
## Multiple R-squared:  0.9043, Adjusted R-squared:  0.8923 
## F-statistic: 75.56 on 1 and 8 DF,  p-value: 2.391e-05

For each additional dollar of income, food expenditure increases by approximately 0.202 dollars per week. The intercept suggests that if income were zero, the expected expenditure is $2.18, which might not make practical sense but is part of the model.

(c)