Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Question 6 In the cities handout that you covered in lecture last week, you saw that R2 could be computed in two ways: either by
Question 6 In the cities handout that you covered in lecture last week, you saw that R2 could be computed in two ways: either by using the regressions sum of squares (SSH) or the residual sum of squares (R33). Note also that TSS, which is the sum of squared errors using the mean of y to predict the value of y is equal to the square of the SD of 3;. If R2 is close to 0, what does this say about RSS and T85"? What does this say about it"? Question 7 Consider the cities data, which appeared in the practice problems from class (nd the problems and data at httpsz//tinyurl.com/stat2011andout-cities). a. Create a linear model regressing the municipal expenditures (mun_exp) of a city against its population (pop). Call this model lml. b. Calculate the predictions and residuals manually with tidyverse as in question 5 0n the handout. c. What is the R2 for this model? d. New create a new variable in the cities dataframe, called many_for, as described in the handout, which will be TRUE if there are at least 10 foreigners in the city, and FALSE. otherwise. e. Create a linear model that uses both pop and many_for to predict mun_exp. Call this model lm2. f. What is the R2 for this model? Interpret the summary of this model. How many coefcients were computed (including the intercept)? What would be the slope and intercept of the regression line(s)? Do you have any comment on this model? Is there an improvement over lml? g. (Optional) Create a scatterplot with mun_exp on the y axis, and pop on the .7: axis. Use geom_abline() to plot the regression line from the model 11111, that uses pop to predict mun_exp. Color it green. For fun, see if you can plot the lines from 11112. Color them red and blue. What do you see
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started