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:
County | 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
Using R for the analysis,
Code :
data = read.csv('C:\\Users\\Temp\\Desktop\\coastal.csv')
model = lm(income~., data = data)
summary(model)
Output :
Model : Income = 39669.20 - 48.08* median age + 5899.94* coastal
Call:
lm(formula = income ~ ., data = data)
Residuals:
Min 1Q Median 3Q Max
-7453.0 -5349.8 -84.4 3927.0 10418.7
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 39669.20 14380.78 2.758 0.0329
* (< 0.05, is significant)
age -48.08 334.77 -0.144 0.8905 (>
0.05, not significant)
coastal 5899.94 5768.20 1.023
0.3458 (>0.05, not significant)
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Residual standard error: 7237 on 6 degrees of freedom
Multiple R-squared: 0.1761, Adjusted R-squared:
-0.09859 (shows that model is not good enough)
F-statistic: 0.641 on 2 and 6 DF, p-value: 0.5594
None of the variables is significant from above table.
Rate my answer and comment for doubt