Graded Exercises

5.6 Working backwards, Part II.

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, Confidence Interval = (65, 77), df = 24 (25-1), t_24 (@90%) = 1.71

sample_mu +/- t_24*(s/sqrt(n)) = (65, 77)

sample_mean 77-((77-65)/2) = 71

71-(1.71(s/sqrt(25))) = 65; #### sample_sd = ((65-71)sqrt(25))/1.71 = 17.54

SE = 17.54/sqrt(25) = 3.508

Margin of Error = t_24SE = 1.713.508 = 6

5.14 SAT scores.

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?

Margin of Error = Z_90*S/sqrt(n)

ME = 25; S=250, Z_90=qnorm(.95)=1.65

n = 272.25

  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.

z_99 = qnorm(.995)=2.58, Sample should be larger because z-score is larger; Accuracy increase as larger is the sample size

  1. Calculate the minimum required sample size for Luke.

z_99 = qnorm(.995)=2.58

n = `r ((2.58*250)/25)^2

5.20 High School and Beyond, Part I.

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.

library("png")
pp <- readPNG("HighSchool.png")
plot.new() 
rasterImage(pp,0,0,1,1)

  1. Is there a clear difference in the average reading and writing scores?

Yes, the median value for writing is higher than reading. Also, the maximum & minimum values for reading are larger & smaller (respectively) than writing

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

Hard to conclude that as the population number is unknown, so we cannot verify if a 200 students sample is less or equal to 10% of the population in order to guarantee independence. However, it seems reasonable

  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: Avg scores reading - Avg scores writing = 0

H1: Avg scores reading - Avg scores writing != 0

  1. Check the conditions required to complete this test.

Random Sample size > 30; sample size <= 10% of the population, therefore independent

Sample distribution nearly normal with no skew

  1. The average observed difference in scores is ¯ xreadwrite =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?

Point_estimate = 0.545, SE=8.887/sqrt(199) = 0.62, df=199

T = (0.545-0)/0.62 = 0.879

p-Value = 0.8097693

p-Value is greater than 0.05, so H0 cannot be rejected, therefore the data does not provide evidence of a difference between the avg. scores on the two exams

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

Type II Error: Failing to reject the null hypothesis given that it is false, in this case failing to conlcude that there is a difference between the avg. scores on the two exams

  1. 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.

Confidence Interval = point_estimate +/- T_199 (@90% conf. level) * SE

T_199 (@90% conf. level) = 1.6525467

0.545 - (1.650.62), #### 0.545 + (1.650.62)

(-0.478, 1.568)

Yes, the confidence interval includes 0

5.32 Fuel efficiency of manual and automatic cars, Part I.

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 difference between the average fuel efficiency of cars with manual and automatic transmissions in terms of their average city mileage? Assume that conditions for inference are satis???ed

library("png")
pp <- readPNG("FuelEff.png")
plot.new() 
rasterImage(pp,0,0,1,1)

H0: Avg_mpg_man - Avg_mpg_aut = 0

H1: Avg_mpg_man - Avg_mpg_aut != 0

point_estimate = 19.85-16.12 = 3.73

SE = sqrt(((4.51)2/26)+((3.58)2/26)) = 1.129

df = 26-1 = 25

T = (3.73-0)/1.129 = 3.30

p-Value (two-sided) = 0.0029052

p-Value is smaller than 0.05 significance level, therefore we reject the null hypothesis, there is strong evidence of a difference between the average fuel efficiency of cars with manual and automatic transmissions in terms of their average city mileage

5.48 Work hours and education.

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

library("png")
pp <- readPNG("WorkHrs.png")
plot.new() 
rasterImage(pp,0,0,1,1)

  1. Write hypotheses for evaluating whether the average number of hours worked varies across the ???ve groups.

H0: Avg_work_hrs across 5 groups is the same

H1: Avg_work_hrs across 5 groups is different (diff !=0)

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

Random Samples sizes > 30; sample sizes <= 10% of the population, therefore independent

Sample distributions nearly normal with marked skewness but due to large sample sizes, we can assume nearly normal distributions

Variability across groups is about the same

  1. Below is part of the output associated with this test. Fill in the empty cells.
library("png")
pp <- readPNG("OutputTest.png")
plot.new() 
rasterImage(pp,0,0,1,1)

library("png")
pp <- readPNG("OutputTestResults.png")
plot.new() 
rasterImage(pp,0,0,1,1)

  1. What is the conclusion of the test?

p-Value = 0.0684 is greater that 0.05 (significance level), H:0 cannot be rejected, therefore, the average number of hours worked is the same across the ???ve groups