In: Statistics and Probability
Here are data from an Oreo comparison taste test done between
regular and low-fat Oreo cookies.
Subject 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
Regular 3 7 5 7 8 10 9 6 10 5 9 8 8 8 6 5 6 8 7
Low-fat 6 4 8 8 6 6 5 4 7 7 5 7 6 6 8 7 4 6 5
Use it and R to run
a. A sign test to see if there is a difference in the median taste
test rating between regular and
low-fat Oreo cookies.
b. A Wilcoxon signed-ranks test to see if there is a difference in
the median taste test rating
between regular and low-fat Oreo cookies.
Solution-
R commands with output--
# Data from an Oreo comparison taste test done between regular and low-fat Oreo cookies.
>
> Regular= c(3,7,5,7,8,10,9,6,10,5,9,8,8,8,6,5,6,8,7)
> Low_fat= c(6,4,8,8,6,6,5,4,7,7,5,7,6,6,8,7,4,6,5)
>
>
> ## Sign Test
>
> d=Regular-Low_fat
> sp=length(d[d>0])
> sn=length(d[d<0])
> n=sp+sn
> P_value=pbinom(sp,n,0.5)
> sp
[1] 13
> P_value
[1] 0.9682159
>
>
> ## Wilcoxon's signed rank test
>
> wilcox.test(Regular,Low_fat,paired = T)
Wilcoxon signed rank test with continuity correction
data: Regular and Low_fat
V = 137, p-value = 0.08888
alternative hypothesis: true location shift is not equal to 0
Thank you..!!
Please like..