help in R A researcher wants to know if there is a relationship between income a
ID: 3054370 • Letter: H
Question
help in R
A researcher wants to know if there is a relationship between income and education. Check the data first, then run correlations.
First, read in the data "DatForActivity7.csv"
1. Run the pearson correlation between variables "income" & educ
Do you think the pearson correlation coef above can accurately describe the relation between income & edu... Why? (you can use histogram to justify your argument)
2. What would be a more appropriate method to calculate the relationship between these two varaibles?
"DatForActivity7.csv":
income educ 0 20 0 8 1551400 17 13475 19 13475 12 1551400 11 1551400 6 1551400 14 1551400 16 1551400 17 0 10 26950 14 1551400 11 0 11 22050 15 1551400 12 0 14 1551400 12 11637.5 12 1551400 20 1551400 19 0 12 26950 14 26950 16 1551400 14 1551400 12 22050 16 0 12 0 13 0 12 0 8 1551400 18 1551400 18 13475 14 26950 18 22050 12 1551400 13 18375 16 1551400 12 0 14 1551400 18 1551400 12 15925 9 18375 19 18375 14 1551400 16 1551400 16 18375 16 1551400 16 15925 15Explanation / Answer
(a) correlation between x and y=corr(x,y)=r=0.1265 ( using ms-excel=correl( , ))
or r=cov(x,y)/(sd(x)(sd(y))=309463.2/(764259.3*3.2016)=0.1265
(b) we can use simple linear regression income(y)=a+b*education(x)=263542.69+30191.53*x
following information has been generated
SUMMARY OUTPUT Regression Statistics Multiple R 0.126475477 R Square 0.015996046 Adjusted R Square -0.004504036 Standard Error 773755.0977 Observations 50 ANOVA df SS MS F Significance F Regression 1 4.67158E+11 4.67E+11 0.780292 0.381454836 Residual 48 2.87375E+13 5.99E+11 Total 49 2.92046E+13 Coefficients Standard Error t Stat P-value Lower 95% Upper 95% Intercept 263542.6873 494187.8474 0.533284 0.596297 -730088.5579 1257174 X Variable 1 30191.52927 34178.7825 0.883341 0.381455 -38529.51758 98912.58Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.