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.
x1 <- 65
x2 <- 77
n <- 25
SM <- (x2+x1)/2
SM
## [1] 71
ME <- (x2-x1)/2
ME
## [1] 6
df <- 25-1
t <- qt(.95, df)
t
## [1] 1.710882
sd <- (ME/t)*5
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.
z_score <- 1.65
ME <- 25
sd <- 250
n <- ((z_score * sd) / ME) ^2
n
## [1] 272.25
Answer:It will be larger because of the larger z_score. While the margin of error remains the same.
z_score <- 2.575
ME <- 25
sd <- 250
n <- ((z_score * sd) / ME) ^2
n
## [1] 663.0625
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.
We can see that there are differences although not significant.
Are the reading and writing scores of each student independent of each other? The reading and writing scores are independent of each other.
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:μreading−μwriting=0 HA:μreading−μwriting≠0
Check the conditions required to complete this test. The obersvations are independent and the distrubtion is normal with no skew.
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?
mu <- -.545
df <- n-1
SD <- 8.887
n <- 200
SE <- SD/sqrt(n)
t <- (mu-0)/SE
p <- pt(t, df)
p
## [1] 0.1930531
Since the p-value is higher than 0.05, we maintain the null hypotheses. The data does not provide convincing evidence of a difference between the average scores on the two exams
We made have made a Type II error in rejecting the alternative hypothesis and wrongly concluded that there is no a difference in the average reading and writing score
n <- 26
SDauto <- 3.58
SDmanual <- 4.51
mdiff <- 16.12 - 19.85
SEauto <- SDauto/sqrt(n)
SEmanual <- SDmanual/sqrt(n)
SE <- sqrt(((SEauto)^2)+(SEmanual)^2)
T <- (mdiff-0)/SE
p <- pt(T, n-1)
p <- 2*p
p
## [1] 0.002883615
H0:μAuto−μmanual=0
HA:μAuto−μmanual≠0
The p-value is less than 0.05 so we can reject the null hypothesis
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.
df<-25
mean_A<-22.92
sd_A<-5.29
n_A<-26
mean_M<-27.88
sd_M<-5.01
n_M<-26
#find the differences of the means
mean_diff<-mean_A-mean_M
mean_diff
## [1] -4.96
SE<-sqrt(((sd_A^2)/n_A)+((sd_M^2)/n_M))
SE
## [1] 1.428881
-4.96 - (2.485* 1.428881)
## [1] -8.510769
The difference of highway mileage between automatic and manual cars are between (-8.51 and -.141).
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%?
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.
H0<-The average number of hours worked are the same across the five groups. HA<- The average number of hours worked varies across the five groups.
Check conditions and describe any assumptions you must make to proceed with the test. • the observations are independent between groups • the data within each group are nearly normal • the variability across the groups is about equal The 3 conditions are met.
Below is part of the output associated with this test. Fill in the empty cells.
The average hours worked,is different for at least one group.