In: Statistics and Probability
A regional planner employed by a public university is studying the demographics of nine counties in the eastern region of an Atlantic seaboard state. She has gathered the following data:
ounty | Median Income | Median Age | Coastal | ||
A | $ | 48,952 | 48.3 | 1 | |
B | 46,669 | 58.8 | 1 | ||
C | 47,780 | 48.0 | 0 | ||
D | 46,855 | 39.2 | 1 | ||
E | 37,724 | 51.9 | 1 | ||
F | 35,414 | 56.2 | 1 | ||
G | 34,389 | 49.1 | 0 | ||
H | 38,128 | 30.3 | 0 | ||
I | 30,384 | 38.9 | 0 |
Include the aspect that the county is "coastal" or not in a multiple linear regression analysis using a "dummy" variable. (Negative amounts should be indicated by a minus sign. Round your answers to 2 decimal places.)
Income= _____________ + ______________ Median Age + ____________ Coastal
Test each of the individual coefficients to see if they are significant. (Negative amounts should be indicated by a minus sign. Leave no cells blank - be certain to enter "0" wherever required. Round your answers to 2 decimal places.)
Predictor t p-value
Constant
Median Age
Coastal
> head(df) Median.Income Median.Age Coastal 1 9 48.3 1 2 6 58.8 1 3 8 48.0 0 4 7 39.2 1 5 4 51.9 1 6 3 56.2 1 > df$Coastal = factor(df$Coastal) > df$Median.Income = as.integer(df$Median.Income) > str(df) 'data.frame': 9 obs. of 3 variables: $ Median.Income: int 9 6 8 7 4 3 2 5 1 $ Median.Age : num 48.3 58.8 48 39.2 51.9 56.2 49.1 30.3 38.9 $ Coastal : Factor w/ 2 levels "0","1": 2 2 1 2 2 2 1 1 1 > mod = lm(Median.Income ~ .,data=df) > summary(mod) Call: lm(formula = Median.Income ~ ., data = df) Residuals: Min 1Q Median 3Q Max -3.1718 -1.7345 0.2757 0.7088 4.4127 Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) 6.67063 5.78606 1.153 0.293 Median.Age -0.06424 0.13469 -0.477 0.650 Coastal1 2.39772 2.32082 1.033 0.341 Residual standard error: 2.912 on 6 degrees of freedom Multiple R-squared: 0.1521, Adjusted R-squared: -0.1305 F-statistic: 0.5383 on 2 and 6 DF, p-value: 0.6095 |
|
Hence the fitted model is income = 6.670 -0.0642*median.age + 2.3977*coastall |
|
|