Question 2 (a) table 5.5

Question 2 (b)

## 
## Call:
## lm(formula = Spending ~ Salary, data = data)
## 
## Residuals:
##      Min       1Q   Median       3Q      Max 
## -1277.84  -448.02   -96.32   404.63  1703.20 
## 
## Coefficients:
##              Estimate Std. Error t value Pr(>|t|)    
## (Intercept) 1.384e+03  4.097e+02   3.378  0.00144 ** 
## Salary      9.012e-02  1.602e-02   5.627 8.75e-07 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 630.8 on 49 degrees of freedom
## Multiple R-squared:  0.3925, Adjusted R-squared:  0.3801 
## F-statistic: 31.66 on 1 and 49 DF,  p-value: 8.747e-07

Question 2(d)

## 
## Call:
## lm(formula = Teacher_Pay ~ Per_Pupil_Spending, data = data)
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -6354.9 -2504.3  -805.2   787.3 17904.0 
## 
## Coefficients:
##                    Estimate Std. Error t value Pr(>|t|)    
## (Intercept)        9145.725   2880.091   3.175  0.00259 ** 
## Per_Pupil_Spending    4.355      0.774   5.627 8.75e-07 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 4385 on 49 degrees of freedom
## Multiple R-squared:  0.3925, Adjusted R-squared:  0.3801 
## F-statistic: 31.66 on 1 and 49 DF,  p-value: 8.747e-07

Question 2(e)

##        1 
## 30922.54

Question 2(f)

Problem 3:

Question 3(a) I renamed the dataset and the variable titles so that I can code it more easily. It was giving me errors when I tried to use the included dataset.

Question 3(b) and 3(c)

## [1] "Linear Model Summary:"
## 
## Call:
## lm(formula = Invest ~ Savings, data = data)
## 
## Residuals:
##       Min        1Q    Median        3Q       Max 
## -0.031554 -0.008684  0.001404  0.009487  0.020082 
## 
## Coefficients:
##             Estimate Std. Error t value Pr(>|t|)    
## (Intercept)  0.04352    0.01763   2.469   0.0232 *  
## Savings      0.84676    0.06928  12.222  1.9e-10 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 0.01434 on 19 degrees of freedom
## Multiple R-squared:  0.8872, Adjusted R-squared:  0.8812 
## F-statistic: 149.4 on 1 and 19 DF,  p-value: 1.899e-10
## [1] "Log-Log Model Summary:"
## 
## Call:
## lm(formula = log(Invest) ~ log(Savings), data = data)
## 
## Residuals:
##       Min        1Q    Median        3Q       Max 
## -0.105127 -0.032324  0.004649  0.045466  0.080277 
## 
## Coefficients:
##              Estimate Std. Error t value Pr(>|t|)    
## (Intercept)  -0.21591    0.09858   -2.19   0.0412 *  
## log(Savings)  0.82881    0.06985   11.87 3.13e-10 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 0.05643 on 19 degrees of freedom
## Multiple R-squared:  0.8811, Adjusted R-squared:  0.8748 
## F-statistic: 140.8 on 1 and 19 DF,  p-value: 3.134e-10