2 Model

\[ Y_{i} = \alpha + \beta X_{i} + e_{i} \]

2.1 Variables

x = food[,2]   # Income
y = food[,1]   # Food Expenditure

2.2 Estimation

reg <- lm(y ~ x)

2.3 Results

summary(reg)  
## 
## Call:
## lm(formula = y ~ x)
## 
## Residuals:
##      Min       1Q   Median       3Q      Max 
## -223.025  -50.816   -6.324   67.879  212.044 
## 
## Coefficients:
##             Estimate Std. Error t value Pr(>|t|)    
## (Intercept)   83.416     43.410   1.922   0.0622 .  
## x             10.210      2.093   4.877 1.95e-05 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 89.52 on 38 degrees of freedom
## Multiple R-squared:  0.385,  Adjusted R-squared:  0.3688 
## F-statistic: 23.79 on 1 and 38 DF,  p-value: 1.946e-05

2.4 b1, b2

b1 <- coef(reg)[[1]] 
b2 <- coef(reg)[[2]]

b1
## [1] 83.416
b2
## [1] 10.20964