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.
n <- 25
ME <- ((77-65)/2)
ME
## [1] 6
xbar <- ((77+65)/2)
xbar
## [1] 71
df <- 25-1
t.value <- qt(.95, df)
t.value
## [1] 1.710882
sd <- (ME/t.value)*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.
zs <- 1.65
ME <- 25
SD <- 250
sz <- (((zs*SD)/(ME))^2)
sz
## [1] 272.25
zsl <- 2.58
ME <- 25
SD <- 250
ssl <- (((zsl*SD)/(ME))^2)
ssl
## [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.
No no clear differnce in the average of the reading and weiting scoreces.
Yes they are independent.
H0: mean(read)-mean(write)=0 H1: mean(read)-mean(write)!=0
The condition required are independence and normality.Both are satisfied as ther ei sno skewness and outliers and we already know that observations are independent.
n <- 200
mean.diff <- -.545
df <- n-1
SD <- 8.887
SE <- SD/sqrt(n)
T <- (mean.diff-0)/SE
pv <- pt(T, df)
pv
## [1] 0.1934182
Since we did NOT reject the null hypothesis, we are making a Type II error. which would say that there was a difference in the reading and writing average scores but we did not notice it.
I would expect that the confidence interval would include 0.Because there is no difference between reading and writing scores.
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.
n.a <- 26
n.m <- 26
SD.A <- 3.58
SD.M <- 4.51
mA <- 16.12
mM <- 19.85
alpha <- .05
meandiff <- mA - mM
SEA <- SD.A/sqrt(n.a)
SEM <- SD.M/sqrt(n.m)
SE <- sqrt(((SEA)^2)+(SEM)^2)
T.1 <- (meandiff-0)/SE
pv1 <- pt(T.1, 25)
pv1 <- 2*pv1
pv1
## [1] 0.002883615
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%?
Assuming significance level is α = 0.05, 304 new enrollees are needed for each interface to detect an effect size of 0.5 surveys per enrollee.
sd1 <- 2.2
sd2 <- 2.2
effect_size <- 0.5
standard_error <- 0.5/(0.84+1.96)
n <- (sd1^2+sd2^2)/standard_error^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.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: mean(lessthanhs) = mean(HS) = mean(JC) = mean(BA) = mean(G) Alternate: at least one of the means differ
For ANOVA we must check for independence within and across groups, normality, and nearly equal variability across groups. We look at the box plot to determine that this data set meets those requirements and it does.
There is not enough evidence for us to reject H0, thus conclude there is not convincing evidence that the avg hours worked per week is any different for the 5 educational groups.