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.
sample mean is in the middle of confidence interval.
mu = (77+65) / 2
mu
## [1] 71
margin of error is the difference of each of the bounds of confidence interval from the mean
ME <-(77-65)/2
ME
## [1] 6
sample standard deviation: sd = ME / T * sqrt(n)
T value for 90% confidence interval and df = 25-1 is 1.711 (from T-distribution table)
n=25
Tval = 1.711
sd <- ME / Tval * sqrt(n)
sd
## [1] 17.53361
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 same across the five groups
H1: the average number of hours worked are different across the five groups
The sample is assumed to be randomly selected and observations are independent
Sample is less than 10% of the population and has greater than 30 observations
Data should be normally distributed, box plot shows that almost all groups are normally distributed. Only “Bachelor’s” group shows skewness, but sample size is large enough to accept that fact.
Df column:
degree
K = 5
N = 1172
K-1
## [1] 4
residuals
N-K
## [1] 1167
total:
N-1
## [1] 1171
sum sq column:
SSdegree = MeanSqDegree*(K-1)
SSdegree = 501.54*(K-1)
SSdegree
## [1] 2006.16
SStotal = SSdegree + SSresiduals
SSresiduals = 267382
SStotal = SSdegree + SSresiduals
SStotal
## [1] 269388.2
mean sq column:
MeanSqResiduals = SSresiduals/(N-K)
MeanSqResiduals = SSresiduals/(N-K)
MeanSqResiduals
## [1] 229.1191
F-val = MeanSqDegree/MeanSqResiduals
MeanSqDegree = 501.54
F_val = MeanSqDegree/MeanSqResiduals
F_val
## [1] 2.188992
If we are using a p value < 0.05, then we fail to reject the null hypothesis and we can NOT conclude that the average number of hours worked are different across the five groups.