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.

ME = 6
mean = 71
n = 25
Z = 1.645
SD = ME * n^0.5 / Z
SD
## [1] 18.23708

The mean is 71, the margin of error is 6, and the stdev is 18.24.


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?
ME = 25
SD = 250
Z = 1.645
n = (ME/(Z*SD))^(-2)
ceiling(n)
## [1] 271

The sample size would need to be at least 271.

  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.

It should be larger becuase it requires a higher confidence (The higher Z needs to be offset).

  1. Calculate the minimum required sample size for Luke.
ME = 25
SD = 250
Z = 2.576
n = (ME/(Z*SD))^(-2)
ceiling(n)
## [1] 664

It should be at least 664.


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?

Students tend to score higher on writing than reading.

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

A student’s reading and writing scores are dependent on eachother. However, one students’ scores shouldn’t affect other students’ scores (unless of course they cheat off eachother).

  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?

H0: there is no significant difference between the average reading and writing exam scores (difference is 0) HA: there is a significant difference between the average reading and writing exam scores (difference isn’t 0)

  1. Check the conditions required to complete this test.

The scores are distributed normally, the scores are independent, there are more than 10 cases of each, the sample is random.

  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?

We’re going to assume 95% confidence.

X = -0.545
SD = 8.887
n = 200
Z = 1.96
ME = Z*SD/(n^0.5)

CI = X + c(-ME,ME)
CI
## [1] -1.7766754  0.6866754

As the CI includes 0, there is not sufficient evidence that the difference between scores isn’t 0. We cannot reject the null hypothesis; there is no significant difference between scores.

  1. What type of error might we have made? Explain what the error means in the context of the application.

As we accepted the null hypothesis, the possible error here could be type 2. This could mean that there was a difference bwteen the scores even though we didn’t find evidence of that.

  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.

I used a CI above for the hypothesis test. If the range excludes 0, then it would be evidence of a difference, as it would be within our confidence to say that there was more than 0 difference. However, the range contained 0, and that means is is more than 5% likely that there was no difference.


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.

X = 22.92 - 27.88
SE = (5.29^2/26 + 5.01^2/26)^0.5
Z = 2.326
ME = Z*SE

CI = X + c(-ME,ME)
CI
## [1] -8.283576 -1.636424

The 98% CI for the differences in fuel efficience between the two types of cars does not contain 0. Thus (within the context 98% confidence), we can determine that there is a significant differece in fuel efficiencies; manual is more efficient than automatic.


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%?

X = 4
SD = 2.2
Z = 1.282
ME = 0.5


n = (Z * SD / ME) ^ 2
ceiling(n)
## [1] 32

They would need 32 enrollees.


Work hours and education. The General Social Survey collects data on demographics, education, and work, among many other characteristics of US residents.47 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.

H0: the means across all groups are the same: they all work the same average number of hours. HA: the means for at least one of the groups are different than the others: they do not all work the same number of hours on average.

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

The observations are independent within and across groups: true assuming no one works two of these jobs. The data within each group are nearly normal: true. The variability is similar across groups: true (im assuming/didnt actually check).

  1. Below is part of the output associated with this test. Fill in the empty cells.
totalmean <- 40.45
means <- c(38.67, 39.6, 41.39, 42.55, 40.85)
SDs <- c(15.81, 14.97, 18.1, 13.62, 15.51)
ns <- c(121, 546, 97, 253, 155)
Groups <- 5

SSG = sum(ns*(means - totalmean)^2)
MSG = 501.54
SSE = 267382 #given
SST = SSE + SSG
MSE = SSE/1167
F = MSG/MSE
PrF = pf(F, 4, 1167, lower.tail = FALSE)
SSG
## [1] 2004.101
MSG
## [1] 501.54
SSE
## [1] 267382
SST
## [1] 269386.1
MSE
## [1] 229.1191
F
## [1] 2.188992
PrF
## [1] 0.06819325
#               Df     sum Sq      Mean Sq        F-value       Pr($>$F)
#degree =       4      2004.10     501.54         2.19          0.0682    
#residual =     1167   267382.00   229.12
#total =        1171   269386.10
  1. What is the conclusion of the test?

Assuming a significance level of 0.05, we cannot reject the hypothesis as p > 0.05 (p = 0.068). Therefore, we conclude that there is no significant variation in work hours between groups.