-
Notifications
You must be signed in to change notification settings - Fork 47
Description
Hi.
I am also taking the coursera course of Statistical Inference for Estimation in Data Science
I have some problem with getting the correct answer of week 4 problem 2 part A
I tried to calculate the CI
my_ttest <- function(mean1, sd1, n1, mean2, sd2, n2, alpha) {
df = ((sd1**2/n1 + sd2**2/n2)**2 )/( (sd1**2/n1)**2/(n1-1) + (sd2**2/n2)**2/(n2-1) )
t = qt(p=1 - alpha/2, df)
c(mean1-mean2-t*sqrt(sd1**2/n1+sd2**2/n2), mean1-mean2+t*sqrt(sd1**2/n1+sd2**2/n2))
}
my_ttest(2.2, 1, 60, 2.5, 0.75, 40, 0.05)
my result of the CI is
-0.647936539378822
0.0479365393788226
compare to your result (correct result)
https://github.com/RyanJTalbot/MSDS/blob/main/Core/Data%20Science%20Foundations%20-%20Statistical%20Inference%20Specialization%20/Statistical%20Inference%20for%20Estimation%20in%20Data%20Science%20/wk4/Programming%20Assignment%20-%20Normal%20Distribution%20Confidence%20Intervals/M4_final_autograded.ipynb
conf.int.lower = -0.644
conf.int.upper = 0.044
there is a 0.003 error.
Would your please give me some help about the process to get the correct answer.
Thanks