#Graded: 1.8, 1.10, 1.28, 1.36, 1.48, 1.50, 1.56, 1.70
###1.8 Smoking habits of UK residents
###(a)Answer: Each row of the data matrix represent a single person.
###(b)Answer: There are 1691 participants in the survry.
###(c)Answer: Data types of the variables:
###sex - Categorical, non ordinal
###age - numerical, discrete
###marital - Categorical, non ordinal
###grossIncome - Categorical, ordinal
###smoke - Categorical, non ordinal
###amtWeekends - Categorical, ordinal
###amtWeekdays - Categorical, ordinal
###1.10 Cheaters, scope of inference
###(a)Answer:Population of interest is 160 childaren between the ages of 5 and 15. The samples are half children who were explicitly told not to cheat and the others who were not given any explicit instructions.
###(b)Answer:I can't tell the results of the study can be generalized to the population since I am not sure whether a samples were randomly selected from the population or convenience sample by some conditions.The result can't be used to establish causal relationships if these two variables are not correlated.
###1.28 Reading the paper
###(a)Answer: Yes, we can conclude that smoking causes dementia later in life since the sample size is big that the sample can represent the population. Also, the propotions of ordinal Categorical varibales for smoking people are base on 25% of the dementia patien and distribute to the each group. Since the population of ordinal variable of smoking people is decresing while incresing the amount of packages, the propotion of the each group smoker is increasing. The result is reasonalbe.
###(b)Answer: No. It should be said that students who were identified as bullies have more risk to having sleep disorders.
###1.36 Exercise and mental health
###(a)Randomized experiment
###(b)The treatment group is to exercise twice a week and control groups is the rest not assign to exercise in this study.
###(c)Yes.age is the blocking variable.
###(d)No, because he instruct the rest not to exercise and these samples would notice they were in a control group.
###(e)The results of the study may not be used to establish a causal relationship between exercise and mental health if these two variables are not correlated. However, the conclusions can be generalized to the population at large if each subset sample size is large ( >25 ) since he used stratified random sampling to ensure representative proportions of each age group.
###(f)The reservations about the study proposal is that the study is not using blinding.
###1.48 Stats scores
df <- c(57,66,69,71,72,73,74,77,78,78,79,79,81,81,82,83,83,88,89,94)
summary(df)
## Min. 1st Qu. Median Mean 3rd Qu. Max.
## 57.00 72.75 78.50 77.70 82.25 94.00
boxplot(df, main="Stats scores")

###1.50 Mix-and-Match
###Answer: Base on their sample sizes, means, interquartiles, I mathch them as following:
###(a) ->(2)
###(b) ->(3)
###(c) ->(1)
###1.56 Distributions and appropriate statistics
###Answer: I will prefer use these variables in each case as following
###(a)Answer:left skewed,mean,SD
###(b)Answer:symmetric, mean or median, SD or IQR
###(c)Answer:right skewed,mean,SD
###(d)Answer:left skewed,mean,SD
###1.70 Heart transplants
###(a)Answer:Yes, sinde the number of control and treatment groups in the mosaic plot is independent.
###(b)Answer:Base on the box plots, treatment group that have heart transplant can make the life much longer than people in control group. So the treatment is effecitveness.
###(c)Answer: Obviously, the propotion of death in treatment group is smaller than the one in control group.
###(d)Answer:
###i.The study is being test whether the treatment is effective.
###ii....alive on 28 cards...on 75 cards ...one group of size 69 representing treatment, and another group of size 34 representing control....a distribution centered at 0....the simulated differences in proportions are low.
###iii The simulation results shows the fraction is low, that the null hypothesis should be rejected in favor of the alternative. The treatmeat is effective.