The experiment comes from a test on Example 6 part b that describes whether people prefer certain products if they are primed or not.
library(ggplot2)
preference <- read.csv("preference.csv")
preference
## preference primed
## 1 1.8 0
## 2 0.1 0
## 3 4.0 0
## 4 2.1 0
## 5 2.4 0
## 6 3.4 0
## 7 1.7 0
## 8 2.2 0
## 9 1.9 0
## 10 1.9 0
## 11 0.1 0
## 12 3.3 0
## 13 2.1 0
## 14 2.0 0
## 15 1.4 0
## 16 1.6 0
## 17 2.3 0
## 18 1.8 0
## 19 3.2 0
## 20 0.8 0
## 21 1.7 1
## 22 1.7 1
## 23 4.2 1
## 24 3.0 1
## 25 2.9 1
## 26 3.0 1
## 27 4.0 1
## 28 4.1 1
## 29 2.9 1
## 30 2.9 1
## 31 1.2 1
## 32 4.0 1
## 33 3.0 1
## 34 3.9 1
## 35 3.1 1
## 36 2.5 1
## 37 3.2 1
## 38 4.1 1
## 39 3.9 1
## 40 1.1 1
## 41 1.9 1
## 42 3.1 1
The data has forty two rows and two columns. The columns are preference and primed. There are two groups that have to evaluate a specific label and one group is primed before seeing the product. The other group is not. The researchers want to test their attitudes to the label.
The purpose of the study is to see whether people prefer a brand more if they are primed before to see a specific label or if they are not primed beforehand. The product has a picture of a dog on the label. The researchers wanted to see whether people who were primed had a higher preference to the product. The primed people were exposed to pictures of animals beforehand and then shown the product. The other group was not primed and the researchers wanted to see if their attitude was lower than the primed group.
library(ggplot2)
ggplot(data=preference, mapping=aes(x=as.factor(primed), y=preference)) + geom_point()
The preference would be higher for the primed rather than the people not primed. The graph shows that people who are primed have a higher preference to the product with the specific label. Primed people had a higher attitude to the product with the label of a dog than the other people who were not primed beforehand. Those people had a lower attitude toward the product.
The null hypothesis is that the means of difference would be zero. This means that the primed and non-primed people would have the same preference. The means would be the same.
The alternative hypothesis would be that the mean would not be zero. They would be unequal. The primed group would be higher than the other group because they would have a higher preference.
The test we will use is a T test. We are using a T test because we are trying to find whether or not the means of the two populations are equal. T tests are trying to find the population means of a quantitative variable.
We would use a two test sample. One for the primed and the other for preference.
The graph shows that both were close enough to the line to be determined Normal.
gg <- ggplot(data=preference)
ggplot(data=preference) + geom_qq(mapping=aes(sample=preference, color=as.factor(primed)))
The level of significance will be 0.05.
t.test(formula=preference~as.factor(primed), data=preference)
##
## Welch Two Sample t-test
##
## data: preference by as.factor(primed)
## t = -3.2072, df = 39.282, p-value = 0.002666
## alternative hypothesis: true difference in means is not equal to 0
## 95 percent confidence interval:
## -1.577912 -0.357543
## sample estimates:
## mean in group 0 mean in group 1
## 2.005000 2.972727
The p value is less than the level of significance. The p value is 0.002666 and the level of signficiance is 0.05. Therefore, we will reject the null hypothesis because the populations means are not zero.
Since the confidence interval is not zero, they are not different for the difference in means. The farther they are from zero the more different they are. The confidence interval was -1.577912 -0.357543 and the mean estimate for 0 is 2.005000 and 1 is 2.972727.
We fail to reject the alternative hypothesis and therefore people who are primed to see the product will have a higher preference. The sample estimate guesses that there are 2.972727 on average more preference for the primed group.
The primed group has a higher preference to the label with the animal than the group who was not primed. We reject the null hypothesis and accept the alternative hypothesis. More people will prefer a product if they are primed before than if they are not.