Q5
The dataset, BAC{HoRM}, is from a study to compare the blood alcohol concentration (BAC) of subjects using two different methods (Breathalyzer Model 5000 or labtest BAC in a laboratory) on 15 subjects. Replicate the analysis by following the sleep example of the class note.
##      id test   bac
## 1.1   1    1 0.160
## 2.1   2    1 0.170
## 3.1   3    1 0.180
## 4.1   4    1 0.100
## 5.1   5    1 0.170
## 6.1   6    1 0.100
## 7.1   7    1 0.060
## 8.1   8    1 0.100
## 9.1   9    1 0.170
## 10.1 10    1 0.056
## 11.1 11    1 0.111
## 12.1 12    1 0.162
## 13.1 13    1 0.143
## 14.1 14    1 0.079
## 15.1 15    1 0.006
## 1.2   1    2 0.145
## 2.2   2    2 0.156
## 3.2   3    2 0.181
## 4.2   4    2 0.108
## 5.2   5    2 0.180
## 6.2   6    2 0.112
## 7.2   7    2 0.081
## 8.2   8    2 0.104
## 9.2   9    2 0.176
## 10.2 10    2 0.048
## 11.2 11    2 0.092
## 12.2 12    2 0.144
## 13.2 13    2 0.121
## 14.2 14    2 0.065
## 15.2 15    2 0.000| test | bac | 
|---|---|
| 1 | 0.1178 | 
| 2 | 0.1142 | 
| test | bac | 
|---|---|
| 1 | 0.0524911 | 
| 2 | 0.0519810 | 
| 15 | 10 | 14 | 7 | 8 | 4 | 11 | 6 | 13 | 1 | 12 | 2 | 9 | 5 | 3 | |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| id | 15 | 10 | 14 | 7 | 8 | 4 | 11 | 6 | 13 | 1 | 12 | 2 | 9 | 5 | 3 | 
| bac | 0.006 | 0.056 | 0.079 | 0.081 | 0.104 | 0.108 | 0.111 | 0.112 | 0.143 | 0.160 | 0.162 | 0.170 | 0.176 | 0.180 | 0.181 | 
## 
##  Paired t-test
## 
## data:  subset(dta5, test == "1")$bac and subset(dta5, test == "2")$bac
## t = 1.0447, df = 14, p-value = 0.3139
## alternative hypothesis: true difference in means is not equal to 0
## 95 percent confidence interval:
##  -0.003790739  0.010990739
## sample estimates:
## mean of the differences 
##                  0.0036## 
##  Paired t-test
## 
## data:  bac[test == 1] and bac[test == 2]
## t = 1.0447, df = 14, p-value = 0.3139
## alternative hypothesis: true difference in means is not equal to 0
## 95 percent confidence interval:
##  -0.003790739  0.010990739
## sample estimates:
## mean of the differences 
##                  0.0036## 
##  Paired t-test
## 
## data:  bac by test
## t = 1.0447, df = 14, p-value = 0.3139
## alternative hypothesis: true difference in means is not equal to 0
## 95 percent confidence interval:
##  -0.003790739  0.010990739
## sample estimates:
## mean of the differences 
##                  0.0036## Analysis of Variance Table
## 
## Response: bac
##           Df   Sum Sq   Mean Sq F value    Pr(>F)    
## id        14 0.075156 0.0053683 60.2791 4.851e-10 ***
## test       1 0.000097 0.0000972  1.0914    0.3139    
## Residuals 14 0.001247 0.0000891                      
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1## Analysis of Variance Table
## 
## Response: bac
##           Df   Sum Sq   Mean Sq F value    Pr(>F)    
## id        14 0.075156 0.0053683 60.2791 4.851e-10 ***
## test       1 0.000097 0.0000972  1.0914    0.3139    
## Residuals 14 0.001247 0.0000891                      
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1| x | 
|---|
| -0.015 | 
| -0.014 | 
| 0.001 | 
| 0.008 | 
| 0.010 | 
| 0.012 | 
| 0.021 | 
| 0.004 | 
| 0.006 | 
| -0.008 | 
| -0.019 | 
| -0.018 | 
| -0.022 | 
| -0.014 | 
| -0.006 | 
| -0.022 | -0.019 | -0.018 | -0.015 | -0.014 | -0.014 | -0.008 | -0.006 | 0.001 | 0.004 | 0.006 | 0.008 | 0.01 | 0.012 | 0.021 | 
## 
##  One Sample t-test
## 
## data:  ehs_d
## t = -1.0447, df = 14, p-value = 0.3139
## alternative hypothesis: true mean is not equal to 0
## 95 percent confidence interval:
##  -0.010990739  0.003790739
## sample estimates:
## mean of x 
##   -0.0036檢定結果: p-value = 0.3139,表示兩種方法測得的BAC沒有顯著差異。
#Equivalence test效果量測試:差多少才算是有差?
例如:A藥比B藥使患者多睡半小時,藥效有差嗎?A生比B生數學多考10分,能力有差嗎?(使用前要先由共識決定差多少有差。)
Equivalence test (Schuirmann, 1987)
H0:The mean bac between tests is different beyond the equivalence bound of (0, 0.05)
H1:The mean bac between tests is the same.
Conclusions 血液酒精濃度差異值的效果量檢測結果不顯著。