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.
boxplot(scores)
fivenum(scores)
## [1] 57.0 72.5 78.5 82.5 94.0
Mix-and-match. (2.10, p. 57) Describe the distribution in the histograms below and match them to the box plots.
var(sym)
## [1] 8.332754
var(uni)
## [1] 837.5455
var(rs)
## [1] 0.8587554
mean(sym)
## [1] 59.88987
mean(uni)
## [1] 49.9199
median(rs)
## [1] 1.282097
a: symmetric distribution, the center (as mean) is 59.89, the variance is 8.33 (#2)
b: uniform distribution, the center (as mean) is 49.92, the variance is 837.55(#3)
c: right-skewed distribution, the center (as median) is 1.28, the variance is 0.86 (#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.
This is right skewed as most observations occur to the left and tail off to the right. Median would better represent a typical observation as it would lessen the impact of super expensive houses. IQR would be better as it would more represent the typical observations (the expensive houses being otuside the range).
This is a symmetric distribution as the observatons will mostly evenly distribute between both sides of the center. Mean and standard deviation would be fair measures of typical observations as there shouldn’t extreme prices compared to the mean.
depends how you read the description, but if most dont drink, and those who do drink don’t always specifically drink excessively, then this would be right skewed. Median would better represent a typical observation as it would lessen the impact of excessive drinkers. IQR would be better as it would more represent the typical observations.
This is mostly a symmetric distribution, with the majority of salaries occuring symetrically. However, there will be some very high salaries from the exectuives. Median would better represent a typical observation as it would lessen the impact of executive salaries. IQR would be better as it would more represent typical salaries
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.
survival is not independent of whether or not they got a transplant as the outcome tends to correlate to whether or not they got the transplant.
It says that those who do not get the transplant tend to die relatively quickly with a median survival time of 21 days, while those who get it tend to live longer with a median survival of 207 days. There is also a much large range of survival times among those who got the transplant, presumably becuase they would have died quickly like those in the control group had they not recieved the transplant.
median(heartTr$survtime[heartTr$transplant == "control"])
## [1] 21
median(heartTr$survtime[heartTr$transplant == "treatment"])
## [1] 207
#Treatment Group
sum(heartTr$survived == "dead" & heartTr$transplant == "treatment")/69
## [1] 0.6521739
#Control Group
sum(heartTr$survived == "dead" & heartTr$transplant == "control")/34
## [1] 0.8823529
Whether survival is independent of whether or not a patient got a transplant
sum(heartTr$survived == "alive")
## [1] 28
sum(heartTr$survived == "dead")
## [1] 75
sum(heartTr$transplant == "treatment")
## [1] 69
sum(heartTr$transplant == "control")
## [1] 34
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 proportional to the differences observed in the actual study. 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.
The outcomes are unlikely to be independent of the treatment, or be due to chance.
\begin{center} \end{center}