Stats scores. (2.33, p. 78) Below are the final exam scores of twenty introductory statistics students.
57, 66, 69, 71, 72, 73, 74, 77, 78, 78, 79, 79, 81, 81, 82, 83, 83, 88, 89, 94
Create a box plot of the distribution of these scores. The five number summary provided below may be useful.
scores <- c(57, 66, 69, 71, 72, 73, 74, 77, 78, 78, 79, 79, 81, 81, 82, 83, 83, 88, 89, 94)
boxplot(scores, xlab = "Final Exam Scores", main = "Final Exam Scores of 20 Introductory Statistics Students", horizontal = TRUE)
Mix-and-match. (2.10, p. 57) Describe the distribution in the histograms below and match them to the box plots.
Ans: Histogram (a) has symmetrical distribution and matches with box plot (2). Histogram (b) has multimodal distribution in a nearly rectangular shape. It matches with box plot (3). Histogram (c) has right-skewed distribution with a right-hand tail, and matches with box plot (1).
Distributions and appropriate statistics, Part II. (2.16, p. 59) For each of the following, state whether you expect the distribution to be symmetric, right skewed, or left skewed. Also specify whether the mean or median would best represent a typical observation in the data, and whether the variability of observations would be best represented using the standard deviation or IQR. Explain your reasoning.
Ans: a(1) This is a right-skewed distribution with Q2-Q1 < Q3-Q2 and the outliers are far away from 3rd quartile. a(2) Median would better represent this data as it is less affected by outliers. a(3) Interquartile Range would better represent the variability of this data as it is less affected by outliers.
Ans: b(1) This is a symmetrical distribution as Q2-Q1 = Q3-Q2, and $1,200,000 is the double of the median. b(2) Mean would better represent this data as it provides better measure of central tendency while there are no outliers. b(3) Standard deviation would better represent the variability of this data as it can measure dispersion better when there are no outliers.
Ans: c(1) This is a right-skewed distribution since most students don’t drink with only a few older than 21 drink excessively, so the drink data would suddenly increase when age>21 and gradualy decrease when age increases. The tail of the histogram would focus on the right side. c(2) Median would better represent this data as it is less affected by outliers. c(3) Interquartile Range would better represent this data as it is less affected by outliers.
Ans: d(1) As there is no information on the quartiles, I would say this is a right-skewed distribution since only few earn higher salaries than all others, the data would focus on the left with a tail on the right side. d(2) Median would better represent this data as it is less affected by skewed data. d(3) Interquartile Range would better represent the variability of this data as it is less affected skewed data.
Heart transplants. (2.26, p. 76) The Stanford University Heart Transplant Study was conducted to determine whether an experimental heart transplant program increased lifespan. Each patient entering the program was designated an official heart transplant candidate, meaning that he was gravely ill and would most likely benefit from a new heart. Some patients got a transplant and some did not. The variable transplant indicates which group the patients were in; patients in the treatment group got a transplant and those in the control group did not. Of the 34 patients in the control group, 30 died. Of the 69 people in the treatment group, 45 died. Another variable called survived was used to indicate whether or not the patient was alive at the end of the study.
Ans: Survival is not independent of the patient who got a transplant. The treatment group has a much higher living rate than the control group.
Ans: The patients in treatment group have increased their survival time by about 50% as the Q3 in control group has a similar value to the Q1 in treatment group. Therefore, the efficacy is high.
control_all <- subset(heartTr, heartTr$transplant == 'control')
control_dead <- subset(heartTr, heartTr$survived == 'dead' & heartTr$transplant == 'control')
nrow(control_dead)/nrow(control_all)
## [1] 0.8823529
treat_all <- subset(heartTr, heartTr$transplant == 'treatment')
treat_dead <- subset(heartTr, heartTr$survived == 'dead' & heartTr$transplant == 'treatment')
nrow(treat_dead)/nrow(treat_all)
## [1] 0.6521739
Ans: “Doing heart transplants can increase the life span” is true or not.
## [1] 28
## [1] 75
## [1] 69
## [1] 34
## [1] 0.230179
We write alive on 28 cards representing patients who were alive at the end of the study, and dead on 75 cards representing patients who were not. Then, we shuffle these cards and split them into two groups: one group of size 69 representing treatment, and another group of size 34 representing control. We calculate the difference between the proportion of dead cards in the treatment and control groups (treatment - control) and record this value. We repeat this 100 times to build a distribution centered at 0. Lastly, we calculate the fraction of simulations where the simulated differences in proportions are 23.02%. If this fraction is low, we conclude that it is unlikely to have observed such an outcome by chance and that the null hypothesis should be rejected in favor of the alternative.
Ans: As the difference in percentage is only 23.02% which is small, so the null hypothesis should be rejected.
\begin{center} \end{center}