Working backwards, Part II. (5.24, p. 203) A 90% confidence interval for a population mean is (65, 77). The population distribution is approximately normal and the population standard deviation is unknown. This confidence interval is based on a simple random sample of 25 observations. Calculate the sample mean, the margin of error, and the sample standard deviation.

##This is a student distribution since the sample size is small and the population standard deviation is unknown. Hence, we calculate the t-statistic. The sample mean is 71, the MOE is 6, the standard deviation is 17.5.

x1 <- 65
x2 <- 77
Samplemean <- (x1 + x2) / 2; Samplemean
## [1] 71
MOE <- (x2 - x1) / 2; MOE
## [1] 6
tstat <- qt(0.95, 24); tstat
## [1] 1.710882
sd <- (MOE * sqrt(25)) / tstat; sd
## [1] 17.53481

SAT scores. (7.14, p. 261) SAT scores of students at an Ivy League college are distributed with a standard deviation of 250 points. Two statistics students, Raina and Luke, want to estimate the average SAT score of students at this college as part of a class project. They want their margin of error to be no more than 25 points.

  1. Raina wants to use a 90% confidence interval. How large a sample should she collect?

##ANSWER (a): The MOE = t-stat * sd/sqrt(n). Hence, the sample size is calculated as (t-stat * sd/MOE)^2 and is found to be 272.25 ~= 273.

n <- ((1.65 * 250) / 25) ^ 2; n
## [1] 272.25
  1. Luke wants to use a 99% confidence interval. Without calculating the actual sample size, determine whether his sample should be larger or smaller than Raina’s, and explain your reasoning.

##Answer (b): A 99% confidence interval is a higher confidence, which means the sample size should be larger, all else equal.

  1. Calculate the minimum required sample size for Luke.

##Answer (c): The minimum sample size is ~ 666.

n <- ((2.58 * 250) / 25) ^ 2; n
## [1] 665.64

High School and Beyond, Part I. (7.20, p. 266) The National Center of Education Statistics conducted a survey of high school seniors, collecting test data on reading, writing, and several other subjects. Here we examine a simple random sample of 200 students from this survey. Side-by-side box plots of reading and writing scores as well as a histogram of the differences in scores are shown below.

  1. Is there a clear difference in the average reading and writing scores?

##Answer (a): There is no clear difference in the average reading and writing scoresas the median in both boxplots is at the same height.

  1. Are the reading and writing scores of each student independent of each other?

##Anser (b): The scores of each student are not independent as the student is likely to be good at both or not.

  1. Create hypotheses appropriate for the following research question: is there an evident difference in the average scores of students in the reading and writing exam?

##Answer (c): The null hypothesis is the statement that there is no difference in the average scores of students in the reading and writing exam. The alternative hypothesis is the statement that there is a difference in the average scores of students in the reading and writing exam.

##Hnull: muReading - muWriting = 0 ##Halt: muReading - muWriting != 0

  1. Check the conditions required to complete this test.

##Answer (d): The sample of 200 students constitutes less than 10% of the population of all high school seniors satisfying the independence condition and since the sample size is large enough, the normality condition is satisfied as well.

  1. The average observed difference in scores is \({ \widehat { x } }_{ read-write }=-0.545\), and the standard deviation of the differences is 8.887 points. Do these data provide convincing evidence of a difference between the average scores on the two exams?

##Answer (e): The t-stat is (sample diff - null diff) / SE. The p-value is found to be > 0.2 from the T- probability tables. Since the p-value is > 0.05, we fail to reject the null hypothesis that there is no difference in the reading and writing scores of a student.

tstat <- -0.545 / (8.887 / sqrt(200)); tstat
## [1] -0.867274
  1. What type of error might we have made? Explain what the error means in the context of the application.

##Answer (f): We might have made a Type II error, since we failed to reject the null when perhaps the alternative is true. In this context, it means, we concluded that there is no difference in the average reading and writing scores for a given student, while in fact there might be such a difference.

  1. Based on the results of this hypothesis test, would you expect a confidence interval for the average difference between the reading and writing scores to include 0? Explain your reasoning.

##Answer (g): We failed to reject the null hypothesis, so the confidence interval will include 0.


Fuel efficiency of manual and automatic cars, Part II. (7.28, p. 276) The table provides summary statistics on highway fuel economy of cars manufactured in 2012. Use these statistics to calculate a 98% confidence interval for the difference between average highway mileage of manual and automatic cars, and interpret this interval in the context of the data.

##ANSWER: First we check the independence condition, assuming these are random samples, and also because 26 cars constitute less than 10% of the entire population of cars manufactured in 2012, the independence and randomization conditions are satisfied. Also, if we look at the boxplots, the median is at the center of the boxplot indicating a near normal distribution, hence the normal condition is satisfied as well.

##degrees of freedom = 25. With a 98% confidence interval and 0.02 in the two tails, we look up the t-stat value to be 2.49. Hence, the confidence interval is (-8.517913, -1.402087). We can state with a 98% confidence that the average mileage of manual cars is between 1.4 to 8.5 mpg higher than that of automatic cars.

PI = 22.92 - 27.88; PI
## [1] -4.96
MOE <- 2.49 * sqrt((5.29 ^ 2) / 26 + (5.01 ^ 2) / 26); MOE
## [1] 3.557913
LB = PI - MOE; LB
## [1] -8.517913
UB = PI + MOE; UB
## [1] -1.402087


Email outreach efforts. (7.34, p. 284) A medical research group is recruiting people to complete short surveys about their medical history. For example, one survey asks for information on a person’s family history in regards to cancer. Another survey asks about what topics were discussed during the person’s last visit to a hospital. So far, as people sign up, they complete an average of just 4 surveys, and the standard deviation of the number of surveys is about 2.2. The research group wants to try a new interface that they think will encourage new enrollees to complete more surveys, where they will randomize each enrollee to either get the new interface or the current interface. How many new enrollees do they need for each interface to detect an effect size of 0.5 surveys per enrollee, if the desired power level is 80%?

##Answer: Assuming significance level = 0.05, and 0.025 in each tail, the z-score is 1.96. We find the z-score for the alternative distribution using z0.2 = 0.84. The centers of the null and alternative hypothesis are (1.96 + 0.84 = 2.8 SE) away. We calculate n to be ~304.

n <- ((2.8 ^ 2) / (0.5 ^ 2))* (2 * (2.2 ^2)); n
## [1] 303.5648

Work hours and education. The General Social Survey collects data on demographics, education, and work, among many other characteristics of US residents. Using ANOVA, we can consider educational attainment levels for all 1,172 respondents at once. Below are the distributions of hours worked by educational attainment and relevant summary statistics that will be helpful in carrying out this analysis.

  1. Write hypotheses for evaluating whether the average number of hours worked varies across the five groups.

##Answer (a): The null hypothesis statement is that the average number of hours worked does not vary (i.e. is the same) across the five groups. The alternative hypothesis is that the average number of hours worked varies.

##Hnull: mu1 = mu2 = mu3 = mu4 = mu5 ##Halt: mu1 != mu2 != mu3 != mu4 != mu5

##where mu1 = average number of hours worked for the less than HS education resident group. ##where mu2 = average number of hours worked for the HS education resident group. ##where mu3 = average number of hours worked for the Jr Coll education resident group. ##where mu4 = average number of hours worked for the Bachelor’s education resident group. ##where mu5 = average number of hours worked for the Graduate education resident group.

  1. Check conditions and describe any assumptions you must make to proceed with the test.

##Answer (b): The independence condition is satisfied assuming the 1,172 respondents are randomly chosen. The sample sizes of each of the five groups is large, hence the normality condition is fulfilled. Finally, the equal variances condition is also satisfied as the ratio of the sample variances is < 2.

  1. Below is part of the output associated with this test. Fill in the empty cells.

##Answer: There are five groups, so the degrees of freedom is k = 4. The residuals is total respondents minus the degrees of freedom, 1167. The f-value is calculated as 2.188, mean squared error is calculated as 229.12, sum of squares between groups is 2006, sum of squares total is 269388.

df <- 5 - 1; df
## [1] 4
r <- 1172 - 5; r
## [1] 1167
ssg <- 501.54 * 4; ssg
## [1] 2006.16
sst <- ssg + 267382; sst
## [1] 269388.2
mse <- 267382/1167; mse
## [1] 229.1191
F <- 501.54/mse; F
## [1] 2.188992
  1. What is the conclusion of the test?

##Answer: We do not reject the null hypothesis since the test stat 0.0682 > 0.05 (assumed significance), i.e. there is a 6.82% probability that any difference between the groups is due to random chance.