I want to check whether the purchase intention of a product is affected by a label. I did a t-test t.test(myfile$Purch_Int~myfile$Product) and got
mean in group 0 = 3.757
mean in group 1 = 3.883
but when I ask for the mean myfile[Product== 1, mean(Purch_Int), by = Label] I get:
mean in group 0 = 3.938
mean in group 1 = 3.821
Why is there such a big difference?
Thanks in advance