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.
# calculating sample size
me = 25
sd = 250
z = 1.645
n = (me/(z*sd))^(-2)
ceiling(n)
## [1] 271
Because a higher confidence interval is being used, Luke must have a higher sample size.
# calculating sample size
me = 25
sd = 250
z = 2.576
n = (me/(z*sd))^(-2)
ceiling(n)
## [1] 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.
Yes, more students score higher in higher than writing.
These scores are independent of each other
Null: There is no signifcant difference between the average scores of the reading and writing exams. Alternative: There is a signifcant difference between the average scores of the reading and writing exams.
The data is normally distributed, the scores are independent, the sample is less than 10% of the population, and there is a significant difference amongst the means of both reading and writing.
There is not enough evidence to suggest there is a difference between the averages of these exams due to the low p-value (less than 0.05 in this case). Therefore, we reject the alternative hypothesis.
x_ = -0.545
sd2 = 8.887
n2 = 200
deg_free <- 199
stand_err <- sd2/sqrt(n2)
t_score <- (x_-0) / stand_err
p_value <- 2* pt(t_score,deg_free)
p_value
## [1] 0.3868365
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.
mean_diff <- 22.92 - 27.88
stand_err_2 <- sqrt((5.29)^ 2 / 9 + (5.01)^ 2 / 9)
deg_free_2 <- 8
p_value_2 <- 0.98
x_2 <- p_value_2 + (1-p_value_2)/2
t_score_2 <- qt(x_2, deg_free_2)
lower <- mean_diff - t_score_2 * stand_err_2
upper_2 <- mean_diff + t_score_2 * stand_err_2
c(lower, upper_2)
## [1] -11.994429 2.074429
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%?
Z_score_80 <- 1.28
Stand_dev <- 2.2
Marg_err_2 <- 0.5
Sample_size_ <- ((Z_score_80 * Stand_dev) / Marg_err_2)^ 2
ceiling(Sample_size_)
## [1] 32
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.
Null: The average number of hours worked does not vary from the five groups. Alternative: The average number of hours worked varies.
We assume the collected sample is random, less than 10% of the total population, independent, and normally distributed.
df_degree <- 4
df_degree
## [1] 4
sample_size <-1172
mean_df <- 501.54
sum_residual <- 267382
df_residual <- sample_size - 5
df_residual
## [1] 1167
df_total <- df_degree + df_residual
df_total
## [1] 1171
sum_degree <- df_degree * mean_df
sum_degree
## [1] 2006.16
sum_total <- sum_residual + sum_degree
sum_total
## [1] 269388.2
mean_residual <- sum_residual / df_residual
mean_residual
## [1] 229.1191
F_value <- mean_df / mean_residual
F_value
## [1] 2.188992