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.
smean= (77+65)/2
smean
## [1] 71
#since sample is 25, df = 25-1 = 24
tdf=round(qt(c(.05, .95), df=24)[2],3)
#using upper limit 77
serror = (77-smean)/tdf
serror
## [1] 3.506721
sd=serror*sqrt(25)
sd
## [1] 17.53361
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.
25 = \(z * \frac{250}{\sqrt{n}}\)
or
\(n = (10 * z)^2\)
# Calculating using Z
z90=1.65
samplesize=round((10*z90)^2,0)
samplesize
## [1] 272
We require large sample size compared to Raina, since confidence is more.
# Calculating using Z
z99=2.58
samplesize=round((10*z99)^2,0)
samplesize
## [1] 666
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.
Ans : The means seem slighly different, but the distribution of differences looks quite normal.
Ans : No. The scores of either reading or writing are independant, but one student is likely to have scores for both sides in the sample. PAIRED DATA.
\(H_O\): \(\mu_r - \mu_w = 0\), No difference between the average reading and writing scores.
\(H_A\): \(\mu_r - \mu_w \neq 0\), There is a difference.
Ans : There are 200 students in the sample and were randomly collected. The box plots indicate a little enough skew that we can use the t distribution. Conditions are satisfied.
se <- round(8.887 / sqrt(200), 3)
se
## [1] 0.628
tdf <- round((-0.545-0)/se, 3)
tdf
## [1] -0.868
p <- round(2 * pt(tdf, 199), 3)
p
## [1] 0.386
\(H_A\) cane be rejected, because not convicing evidence of diff in avg means.
Since we have rejected \(H_A\), if it were actually true, we would have made a type II error. If we took a larger sample, we would decrease our chances of making a type II error.
We would expect confidence intervals to include 0, as it has been determined that there is no convincing evidence of a difference in average means.
Each year the US Environmental Protection Agency (EPA) releases fuel economy data on cars manufactured in that year. Below are summary statistics on fuel efficiency (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 satisfied.
\(H_O\): \(\mu_a - \mu_m = 0\), No difference between the average automatic and manual MPG.
\(H_A\): \(\mu_a - \mu_m \neq 0\), There is a difference.
\(\sigma = .05\)
n = 26
mdiff = 16.12 - 19.85
sddiff = 3.58 - 4.51
SEdiff = sqrt((3.58^2)/n + (4.51^2)/n)
t = (mdiff-0)/SEdiff
p = round(2 * pt(t, n-1), 3)
p
## [1] 0.003
With \(\sigma = .05\) and p = 0.003, we reject \(H_0\). There is convincing evidence of a difference in the means of miles per gallon in manual and automatic transmissions.
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.
\(H_0: \mu{<HS} = \mu{HS} = \mu_{JR} = \mu_{B} = \mu_{G}\). The avg hours worked arcross all five groups does not vary.__
\(H_A:\) The avg hours across some or all groups does vary.
The data in each group appears relatively normal and the variability is similar across each group. Assumption for ANOVA, that obsrvtns are independent.
k = 5
df_G = k-1
n = 1172
df_E = n - k
df_T = df_G + df_E
gmean = 40.45
SSE = round(sum((121-1)*15.81^2, (546-1)*14.97^2, (97-1)*18.1^2,
(253-1)*13.62^2, (155-1)*15.51^2), 0)
SSG = round(sum(121*(38.67-gmean)^2, 546*(39.6-gmean)^2, 97*(41.39-gmean)^2,
253*(42.55-gmean)^2, 155*(40.85-gmean)^2), 0)
SST = round(SSE + SSG, 0)
MSG = round(SSG / (k-1), 2)
MSE = round(SSE / (n-k), 2)
f = round(MSG / MSE, 3)
df=data.frame(c("ANOVA","degree","Residuals","Total"))
df[2]=c("Df",df_G,df_E,df_T)
df[3]=c("Sum Sq",SSG,267382,269378)
df[4]=c("Mean Sq",501.54,MSE,NA)
df[5]=c("F Value",f,NA,NA)
df[6]=c("Pr(>F)",0.0682,NA,NA)
knitr::kable(df)
c..ANOVA….degree….Residuals….Total.. | V2 | V3 | V4 | V5 | V6 |
---|---|---|---|---|---|
ANOVA | Df | Sum Sq | Mean Sq | F Value | Pr(>F) |
degree | 4 | 2004 | 501.54 | 2.187 | 0.0682 |
Residuals | 1167 | 267382 | 229.11 | NA | NA |
Total | 1171 | 269378 | NA | NA | NA |
There is not enough evidence for us to reject \(H_0\), thus we accept and conclude there is no difference in avg work hours per week among diff groups.