mE = (77-65) / 2
sM = 65 + mE
x = 25
dF = x-1
CI = .9
a = 1-CI
tIndex = (1-(a/2))
t = qt(tIndex,dF)
sE = mE/t
sSD = sE*sqrt(x)
sM
## [1] 71
mE
## [1] 6
sSD
## [1] 17.53481
mE = 25
sSD = 250
z = qnorm(0.95)
x = ((sSD*z)/mE)^2
x
## [1] 270.5543
In terms of confidence intervals, the z-score is dependent on sample size…as Z-score rises, samplesize decreases. Luke’s sample should be larger than Raina’s.
####(c) Calculate the minimum required sample size for Luke.
mE = 25
sSD = 250
z = qnorm(0.995)
x = ((sSD*z)/mE)^2
x
## [1] 663.4897
No real difference is immediately apparent. Minor differences seen can merely be sample variability.
Depends on how population sampling was conducted for the observations. However an individual student scores are not independent of each other categorie.
nH : There is no evident difference in the average scores of students in the reading and writing exam.
aH : There is an evident difference in the average scores of students in the reading and writing exam.
Students must be independent of each other. Yes
Nearly normal distribution. Yes Sample size less than 10% of population. Yes
x = 200
dF = 199
sDD = 8.887
diffOfMean = -0.545
sE = sDD /sqrt(x)
t = (diffOfMean) /(sE)
pV = pt(t,df=dF)
pV
## [1] 0.1934182
The P-value fails to be smaller than 5%. We reject the alternative Hypothesis in favor of the null.
A type II error could have been made. A false negative where there may have been differences in scores that we failed to observe.
0 is the best possible result to reject the alternative hypothesis, which we did. I would expect 0 to be in the CI.
nH : The data provides no difference between the average fuel efficiency of cars with manual and automatic transmissions in terms of their average city mileage?
aH : The data provides differences between the average fuel efficiency of cars with manual and automatic transmissions in terms of their average city mileage?
x = 26
autoMean = 16.12
manualMean = 19.85
autoSD = 3.58
manualSD = 4.51
diffOfMeans = autoMean - manualMean
sE = sqrt((autoSD^2/x)+(manualSD^2/x))
t = (diffOfMeans)/(sE)
p = pt(t,df=25)*2
p
## [1] 0.002883615
p-value is less than 0.05. We reject nH in favor of aH. Which means we’ve detected a difference in automatic vs manual car fuel efficiency.
nH : The means of each group are equal
aH : The means of each group are not equal
Observations independent of each other. Samples are 10% or less of the population. Sample sizes greater than 30 to prevent too much skew. All looks good.
msg = 501.54
prf = 0.0682
x = 1172
groups = 5
spacesBetween = 4
dF = x - groups
f = qf(1-prf,spacesBetween,dF)
mse= msg/f
ssg = spacesBetween*msg
sse = dF*mse
dF
## [1] 1167
spacesBetween
## [1] 4
f
## [1] 2.188931
mse
## [1] 229.1255
ssg
## [1] 2006.16
sse
## [1] 267389.5
Since the p-value is higher than 0.05 we fail to reject the Null hypothesis. This means theres no percieved difference in the means between groups.