Before opening the dataset needed for this problem, you’ll needto call the “car” package:
> library(car)
?Now you can import the “Wong” dataset and use it to answer thequestion below.
Remember to include any code you use along with your answers inyour submission!
3. The Wong dataset contains data from a study by Wong, Monette,and Weiner (2001) on patients who fell into comas after sustainingtraumatic brain injuries. After waking, Wong and colleaguesadministered two different intelligence tests (the “piq” and “viq”variables). The “duration” variable indicates how long each patientwas in a coma before waking (measured in days).
a. Consider that this dataset represents the population of allpatients who fell into comasafter sustaining traumatic braininjuries. Calculate the population mean and standard deviation ofthe duration variable.
b. Simulate drawing 1,000 random samples of size n =30 and storethe sample mean durations in a vector (see the Lab 4 handout and/orvideo). Create a histogram of your sampling distribution of meansfor duration.
c. Calculate the mean and standard deviation of your samplingdistribution. How do they compare to the population mean andstandard deviation?
d. If you decreased your sample size to n=10, how would the shapeof your sampling distribution change compared to what you reportedabove?