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.
Mix-and-match. (2.10, p. 57) Describe the distribution in the histograms below and match them to the box plots.
a)Normal Distribution matches boxplot 2 b)Uniform (Symmetric) Distribution matches boxplot 3 c)Right skewed Distribution matches boxplot 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.
Skew type: Right skewed; Because the 25% and 50% are very close together. Because he 75% is so far from the median means that the more costly homes are have prices that are spread further apart.
Typical observation: Median; Median would better represent a typical observation as median is less affected by skewed data
Variability: IQR; Because the data is right-skewed, as IQR is less affected by skewed data.
Skew type: Normal Distribution; the distance between (Q2-Q1) and (Q3-Q2) are equal.
Typical observation: Mean; Because the data is normally distributed, the mean can give us the typical house price within the data set.
Variability: Standard Deviation; Because as IQR is less affected by skewed data as it is more generally understood and would allow for other stastistical operations.
Skew type: Right skewed due to given the assumption that most students don’t drink since they are under 21 and only a few drink excessively.
Typical observation: Median because median is less affected by skewed data
Variability: IQR because it is less affected by skewed data
Skew type: Right skewed because most salaries will be close together with executive being far higher. Typical observation: Median because median is less affected by skewed data
Variability: IQR because it is less affected by skewed data
Heart transplants.
It appears survival is dependent of the patient receiving the transplant because the mosaic plot shows the control had a much higher proportion of patients that died by the end of the study.
The treatment box plot is right-skewed, that means that those who survived longer than the mean age are further apart in survival time than those below the mean. Ultimately, this means that the mean is likely skewed by those that survived a lot longer than the average. Treatment does make a difference in survival time, but it does not appear to be more effective than the control.
## get control proportion that died
C_tot <- nrow(subset(heartTr, transplant == 'control'))
C_Died <- nrow(subset(heartTr, transplant == 'control' & survived == 'dead'))
C_P<- round(C_Died / C_tot *100, 2)
## get treatment proportion that died
TR_tot <- nrow(subset(heartTr, transplant == 'treatment'))
TR_died <- nrow(subset(heartTr, transplant == 'treatment' & survived == 'dead'))
TR_P <- round(TR_died / TR_tot *100, 2)
The proportion of the control group that had died : 88.24%. The proportion of the treatment group that had died : 65.22%
Null hypothesis: There is no difference in life span between the control group and the treatment group. Alternative hypothesis: There is a difference in life span between the control group and the treatment group.
table(heartTr$survived)
##
## alive dead
## 28 75
table(heartTr$transplant)
##
## control treatment
## 34 69
TR_P - C_P
## [1] -23.02
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 __ greater than or equal to 0.23017_______. 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.
\begin{center}
Answer: The simulation shows that the occurance of a difference of at least 23.02 would be a very rare event. We can therefore reject the null and accept that there is a difference in survival rate between the treatment and control groups.