2015年7月14日 星期二

7.14 Coursera Statistical Inference Quiz 3 Question 6

Question 6

To further test the hospital triage system, administrators selected 200 nights and randomly assigned a new triage system to be used on 100 nights and a standard system on the remaining 100 nights. They calculated the nightly median waiting time (MWT) to see a physician. The average MWT for the new system was 4 hours with a standard deviation of 0.5 hours while the average MWT for the old system was 6 hours with a standard deviation of 2 hours. Consider the hypothesis of a decrease in the mean MWT associated with the new treatment. What does the 95% independent group confidence interval with unequal variances suggest vis a vis this hypothesis? (Because there's so many observations per group, just use the Z quantile instead of the T.)

Options:
  • When subtracting (old - new) the interval is entirely above zero. The new system appears to be effective. (correct)
  • When subtracting (old - new) the interval is entirely above zero. The new system does not appear to be effective.
  • When subtracting (old - new) the interval contains 0. The new system appears to be effective. (previously chosen)
  • When subtracting (old - new) the interval contains 0. There is not evidence suggesting that the new system is effective. (previously chosen)
R code:
  • X <- 6; Sx <- 2
    Y <- 4; Sy <- 0.5
    nx <- 100; ny <- 100
    df <- (Sx^2/nx + Sy^2/ny)^2/((Sx^2/nx)^2/(nx-1) + (Sy^2/ny)^2/(ny-1))
    X - Y + c(-1,1) * qt(0.975, df) * sqrt(Sx^2/nx + Sy^2/ny)
  • return: [1] 1.591503 2.408497
  • Z quantile: (4 - 6)/(2/sqrt(100))
I replaced qt(0.975, df) with Z quantile at the very beginning. The question is a little confusing me as it ask using the Z quantile instead of the T. Anyway. I attempted this question correct in the last time. 7 out of 7. Perfect!

Side note: remember that the calculation of confidence intervals is different for the situation of equal and unequal variance. For unequal variance, the degree of freedom (df) has to be calculated in a more complicated way.

沒有留言:

張貼留言