A 90% con???dence interval for a population mean is (65, 77). The population distribution is approximately normal and the population standard deviation is unknown. This con???dence interval is based on a simple random sample of 25 observations. Calculate the sample mean, the margin of error, and the sample standard deviation.
samp_mean <- ((77+65)/2)
samp_mean
## [1] 71
margin_error <- ((77-65)/2)
margin_error
## [1] 6
#n=25, df=25-1
t_val <- qt(.95,24)
stand_error <- margin_error/ t_val
sd_samp <- stand_error * sqrt(25)
sd_samp
## [1] 17.53481
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.
Raina wants to use a 90% con???dence interval. How large a sample should she collect?
st_dev <- 250
margin_error <-25
ci <-1.65
student <- (((ci*st_dev)/(margin_error))^2)
student
## [1] 272.25
Luke wants to use a 99% con???dence interval. Without calculating the actual sample size, determine whether his sample should be larger or smaller than Raina’s, and explain your reasoning.
st_dev <- 250
margin_error <-25
ci <-2.58
student_luke <- (((ci*st_dev)/(margin_error))^2)
student_luke
## [1] 665.64
Calculate the minimum required sample size for Luke.
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.
Is there a clear difference in the average reading and writing scores? There isn’t a clear difference in the average reading and writing scores based on the box plot.
Are the reading and writing scores of each student independent of each other? Yes
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: The mean of reading results - writing results will equal 0 H1: The mean of reading results - writing results will not equal 0
Check the conditions required to complete this test.
The average observed difference in scores is ¯ xreadwrite =0.545, and the standard deviationof the differences is 8.887 points. Do these data provide convincing evidence of a difference between the average scores on the two exams?
num <- 200
diff <- -.545
df <- num-1
st_dev <- 8.887
stand_error <- st_dev/sqrt(num)
t_val <- (diff-0)/stand_error
p_val <- pt(t_val,diff)
## Warning in pt(t_val, diff): NaNs produced
p_val
## [1] NaN
What type of error might we have made? Explain what the error means in the context of the application.
Based on the results of this hypothesis test, would you expect a con???dence interval for the average difference between the reading and writing scores to include 0? Explain your reasoning
Each year the US Environmental Protection Agency (EPA) releases fuel economy data on cars manufactured in that year. Below are summary statistics on fuel eciency (in miles/gallon) from random samples of cars with manual and automatic transmissions manufactured in 2012. Do these data provide strong evidence of a di???erence between the average fuel eciency of cars with manual and automatic transmissions in terms of their average city mileage? Assume that conditions for inference are satis???ed.
num_a <-26
sd_a <- 3.58
mean_a <-16.12
num_m <-26
sd_m <- 4.51
mean_m <-19.85
alpha <- .05
diff_mean <- mean_a - mean_m
stand_err_a <- sd_a/sqrt(num_a)
stand_err_m <- sd_m/sqrt(num_m)
stand_err <- sqrt(((stand_err_a)^2)+(stand_err_m)^2)
t_val <-(diff_mean-0)/stand_err
p_val <-pt(t_val,25)
p_val <- 2*p_val
p_val
## [1] 0.002883615
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.
Write hypotheses for evaluating whether the average number of hours worked varies across the ???ve groups.
Check conditions and describe any assumptions you must make to proceed with the test.
Below is part of the output associated with this test. Fill in the empty cells.
What is the conclusion of the test?