5.6 Working backwards, Part II.

#sample mean
s_mean <- ((77+65) / 2)
s_mean
## [1] 71
#standard deviation 
SD <- (((77-65) / 2)/ qt(.95, 24)) * 5
SD
## [1] 17.53481
#margin error
(77-65)/2
## [1] 6

5.14 SAT scores

#a
((250 * qnorm(0.95)) / 25)^2
## [1] 270.5543
#b 
#we want a bigger z score value the sample will be bigger, the sample should be bigger

#c

sample<-round(((2.575 *250) / 25) ^ 2)
sample
## [1] 663

5.20 High School and Beyond, Part I.

a-) its seem normaly distrubted but there are slighty different in the average between reading and writting.

b-) Yes, but also its depends soemtimes reading and writting can be correlate.

c-) HO: The average difference on reading and writting is zero HA: The average difference on reading and writting is not zero

d-) sample size > 30 normal distrubuted

e-)

dif <- -.545
SE <- 8.887/sqrt(200)
p <- pt((dif-0)/SE, 199)
p
## [1] 0.1934182

f-) fail to reject the null hypothesis

g-) because we fail to rejec HO,cofidence level should include 0

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

dif <- 16.12 - 19.85
man <- 4.51/sqrt(26)
auto <- 3.58/sqrt(26)
SE <- sqrt( (man ^ 2) + (auto ^ 2))
p <- 2 * pt((dif-0)/SE, 25)
p
## [1] 0.002883615
# we reject null hypothesis

5.48 Work hours and education

#a-)

#HO: same average hous across the 5 groups
#HA: not the same average hours across the 5 groups

#b-)

#the variables are independent

#c-)
# the degre is 4
# the residuals is 1172 - 5 = 1167
# the total is 1167 + 4 = 1171

#sum sqr degree and total
sum_sqr_degree <- 4 * 501.54
sum_sqr_total <- 267382 + sum_sqr_degree


sum_sqr_degree
## [1] 2006.16
sum_sqr_total
## [1] 269388.2
# F value
F_value <- 501.54 / (267382 / 1167)
F_value
## [1] 2.188992