Question: Please provide the complete solution and R codes. Thank you! Problem 2. This problem uses the UNll data in the all-4 package. (a) Plot fertility
Please provide the complete solution and R codes. Thank you!

Problem 2. This problem uses the UNll data in the all-4 package. (a) Plot fertility against ppgdp. Fit a linear model regressing fertility on ppgdp and add the t on the plot. Comment on why this model is not good. (b) Use a \"residuals vs t\" plot to check if there is any non-constant variance or non-linearity problem. State the main problem and explain why in one or two sentences. (c) Use a normal QQ probability plot to check if the normality assumption is met. State the main problem and explain why in one or two sentences. (d) Shapiro-Wilk test is a test of normality of a numeric variable. The null hypothesis for this test is that the variable is normally distributed. Use the R function shapiro.test(} to test if the residuals of the linear fit in part (a) is normally distributed. State the p-value of this test and your conclusion given 0: = 0.05. Does the result support your conclusion in part (c)? (Use the code '?shapiro.test or help[shapiro.tlst) to understand how to use this mction.) (e) Perform necessary transformation(s) to correct the problems found in (b) or (c) Use L'residuals vs t\" plot and normal QQ probability plot again to verify that the problems are corrected
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
