I'm really super new to R and am doing the most basic stuff for a beginner's statistics class. I've been staring at this question for a while and can't work out what I'm meant to do.
Here's the question:
- Using the data Anscombe, included in the car package, perform a regression to examine whether the number of people living in an urban area has an effect on income. Perform all necessary steps, including a scatter plot, then answer the following questions. Hint: load data from the package with the following command A<-Anscombe a. Interpret the coefficient for urban.
b. Interpret the model’s R squared.
c. For the variance that is not explained by the model, what is the explanation?
d. Can we say that there is a linear relationship between the two variables?
The code and output I've used is: A<-Anscombe
shapiro.test(A$income) shapiro.test(A$urban) A1<-lm(urban~income,data=Anscombe) summary(A1) scatterplot(urban~income,data=Anscombe,smooth=F) Call: lm(formula = urban ~ income, data = Anscombe) Residuals: Min 1Q Median 3Q Max -351.06 -51.07 -4.37 81.75 220.13 Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) 67.04877 91.99292 0.729 0.47 income 0.18524 0.02811 6.590 2.87e-08 *** --- Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1 Residual standard error: 111.3 on 49 degrees of freedom Multiple R-squared: 0.4699, Adjusted R-squared: 0.459 F-statistic: 43.43 on 1 and 49 DF, p-value: 2.866e-08
I'm not sure if I've put urban and income in the right order in my functions for this question? And I'm not sure how to interpret the coefficient results, or how to interpret the model's R squared.
Can someone please help me understand these results and how to answer this question?