These are RStudio coding questions. Please provide the codes needed for each question step by step. Thank you so much.
Part I: Using The Spending Dataset
a) [1 Mark] Run the following codes using the student number of the Group Leader only for a group assignment or your student if it is an individual assignment:
set.seed(studentNumber)
SpendingSample <- spending[-sample(1:nrow(spending), 83), ]
This code will remove 20% of the observations giving you a unique 80% sample dataframe that you will use to answer all remaining questions. As a result, your answers will be different from every other group in the class. Use the new dataframe SpendingSample to answer questions b, c, d, and e.
b) [1 Mark] Can we conclude with 95% confidence that persons who own their primary residence (with or without a mortgage) are more likely than renters to own a cell phone?
c) [1 Mark] Can we conclude with 95% confidence that more than 60% of respondents own a vehicle?
d) [1 Mark] Can we conclude with 95% confidence that persons who own a cell phone have higher total expenditures than persons who do not own a cell phone?
e) [1 Mark] Examine the variable TR030_C. Do persons who have a full-time job and possess their own vehicle spend more on vehicle operations than persons with a vehicle who do not have a full-time job?