Few questions related to R

Learning Goal: I’m working on a r multi-part question and need the explanation and answer to help me learn.

Please help me with these questions related to R. And provide the answer in R markdown PDF file. Thank you!

Study of Teenage Gambling in Britain

The teengamb dataset contains a survey conducted to study teenage gambling in Britain. The dataset has 47 observations and five variables:

sex: 0 = male, 1 = female
status: Socioeconomic status score based on parents occupation
income: income in pounds per week
verbal: verbal score in words out of 12 correctly defined
gamble: expenditure on gambling in pounds per year

Use the following statement to access the data: data(teengamb, package= β€œfaraway”)

Question 1

Make sure to convert any categorical variable to a factor.

Create a regression with gamble as the outcome variable and sex, status, income, and verbal as predictors.

Hint: See Lesson 3, Slide 48.

Question 2

Create a standardized residuals vs. fitted plot. Do you think the variance is constant?

Hint: See Lesson 6, Slide 11.

Question 3

Create a Quantile-Quantile plot and a histogram based on the standardized residuals. Does the distribution of residual

πŸ’‘ Buy the answer for only $12 Get it now β†’

s look normal?

Hint: Go to Lesson 6, Slide 28.

Question 4

Print all the standardized residuals.

Are there any observations with standardized residuals greater than 3 or smaller than -3? If so, which ones? What are their standardized residuals?

Hint: Use the rstandard function

Question 5

Identify points with leverages that are at least two times the average leverage.

Did you find any points? If so, which points did you find?

Hint: Go to Lesson 6, Slide 22.

Question 6

Detect outliers using studentized residuals. Use the Bonferroni correction.

Did you detect any outliers? If so, show the studentized residual of any outlier you found.

Hint: Go to Lesson 6, Slide 40.

Question 7

Show the values of any outlier observation you found in question 6 (i.e., show the entire row of each such observation).

Hint: Assuming that observation 5 is an outlier, you can use teengamb[5,]

Question 8

Use Cooks distances to search for influential points. Does any point have a Cook’s distance above 0.5?

Hint: See Lesson 6, Slide 48.

Question 9

Create a half normal plot of the Cooks distances. Which four observations have the highest Cooks distances?

Hint: See Lesson 6, Slide 48.

πŸ’‘ Buy the answer for only $12 Get it now β†’