Chapter 1 - Introduction to Data Graded: 1.8, 1.10, 1.28, 1.36, 1.48, 1.50, 1.56, 1.70 (use the library(openintro); data(heartTr) to load the data)
1.8 Smoking habits of UK residents (a) What does each row of the data matrix represent? (b) How many participants were included in the survey? (c) Indicate whether each variable in the study is numerical or categorical. If numerical, identify as continuous or discrete. If categorical, indicate if the variable is ordinal.
1.10 Cheaters, scope of inference. (a) Identify the population of interest and the sample in this study. (b) Comment on whether or not the results of the study can be generalized to the population, and if the findings of the study can be used to establish causal relationships.
1.28 Reading the paper. (a) Based on the reading I can conclude that there is a correlation between smoking and dimentia. There is a relationship betweent he amoubt of packs smoked and dimentia. (b) The statement would not be justified. A more substative finding can be that sleeping disorders are linked with behavioral issues.
1.36 Exercise and mental health. (a) What type of study is this? (b) What are the treatment and control groups in this study? (c) Does this study make use of blocking? If so, what is the blocking variable? (d) Does this study make use of blinding? (e) Comment on whether or not the results of the study can be used to establish a causal relationship between exercise and mental health, and indicate whether or not the conclusions can be generalized to the population at large. (f) Suppose you are given the task of determining if this proposed study should get funding. Would you have any reservations about the study proposal?
1.48 Stats scores.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.
#Vector
library(ggplot2)
data <- c(57, 66, 69, 71, 72, 73, 74, 77, 78, 78, 79, 79, 81, 81, 82, 83, 83, 88, 89, 94)
scores <- data.frame(scores=data,type=rep("score", length(data)))
#Theme
Themeplot <- theme(axis.ticks=element_blank(),
panel.border = element_rect(color="blue", fill=NA),
panel.background=element_rect(fill="White"),
panel.grid.major.y=element_line(color="white", size=0.1),
panel.grid.major.x=element_line(color="white", size=0.1))
#Boxplot
bp <- ggplot(data=scores, aes(x=type, y=scores)) +
Themeplot +
geom_boxplot(colour="Black") +
labs(title="Boxplot of Stats Scores", x="Stats scores", y="Score")
bp
1.50 Mix-and-match. Describe the distribution in the histograms below and match them to the box plots.
A=2 (Mid) B=3 (uniform) C=1 (left skew)
1.56 Distributions and appropriate statistics, Part II
Annual salaries of the employees at a Fortune 500 company where only a few high level executives earn much higher salaries than the all other employees.
left skew, Higher numnber of employees earning less.
1.70 Heart transplants. (a) Based on the mosaic plot, is survival independent of whether or not the patient got a transplant? Explain your reasoning. (b) What do the box plots below suggest about the efficacy of the heart transplant treatment. (c) What proportion of patients in the treatment group and what proportion of patients in the control group died? (d) One approach for investigating whether or not the treatment is effective is to use a randomization technique.
The boxplot shows that the people who receievd treament have a far higher survival time in comparison to the indivduals who did not.