In: Math
Part 2– R work (must be done in R)
Copy and paste your R code and output into a word document, along with your written answers to the questions, and upload to Canvas.
Follow these instructions to import the necessary dataset:
Before opening the dataset needed for this problem, you’ll need to call the “car”package. Run the following line of code:
> library(car)
Now you can import the “Prestige” dataset and use it to answer the question below. Name the data frame with your UT EID:
> my_eid <- Prestige
Remember to include any code you use along with your answers in your submission!
ThePrestigedataset contains information about different occupations in Canada in 1971. We want to see if the average years of education of the workforce (“education”) can predict an occupation’s annual income (“income”).
Make a scatterplot for this analysis. Why is a linear regression not appropriate? (1pt)
Create a new variable in the dataset called “log_income” that is the natural log of each income value. (1pt)
Conduct a full analysis to see if education can predict log-income. Include all steps for full credit. Comment on any assumptions that might not be met, but carry out the full test. (4pt)