1. Include the aspect that the county is "coastal" or not in a multiple linear regression analysis using a "dummy" variable.
2. Test each of the individual coefficients to see if they are significant.
3. What would a histogram look like of the residuals? A scatter plot?
I used R software to solve this question
R codes and output:
> d=read.table('data.csv',header=T,sep=',')
> head(d)
Income Age Coastal
1 48952 48.3 1
2 46669 58.8 1
3 47780 48.0 0
4 46855 39.2 1
5 37724 51.9 1
6 35414 56.2 1
> attach(d)
> cor(Income , Age)
[1] 0.1799701
> fit=lm(Income~ Age+ Coastal)
> summary(fit)
Call:
lm(formula = Income ~ Age + Coastal)
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 *
Age -48.08 334.77 -0.144 0.8905
Coastal 5899.94 5768.20 1.023 0.3458
---
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
F-statistic: 0.641 on 2 and 6 DF, p-value: 0.5594
> residuals=fit$residual
> residuals
1 2 3 4 5 6
5705.15192 3926.99875 10418.66818 3170.61800 -5349.75774
-7453.01094
7 8 9
-2919.44310 -84.35934 -7414.86574
> hist(residuals)
a.
Correlation between median income and median age is 0.180
2.
Since p-value for both the variables (0.8905, 0.3458) are greater than 0.05, hence we conclude that both variable are not statistically significant.
3.
histogram of residuals:
Residuals are positively skewed.
1. Include the aspect that the county is "coastal" or not in a multiple linear regression...
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 $ 49,374 58.5 0 B 46,850 46.5 1 C 47,586 48.5 1 D 47,781 45.5 1 E 33,738 37.3 0 F 35,553 43.4 0 G 39,910 45.3 0 H 37,266 34.2 0 I 34,571 36.5 0 Is there a linear relationship between the...
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 $ 46,757 50.1 0 B 48,213 49.9 0 C 46,588 57.9 1 D 47,586 52.5 0 E 34,097 37.7 0 F 30,963 45.1 1 G 33,632 43.5 1 H 35,971 48.2 1 I 30,131 33.5 1 Click here for the Excel Data File...