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
Description of the data A research team randomly assigned participants to either a primed condition (denoted 1 in the data set) or non-primed condition (denoted 0). Responses on 44 individuals (20 in the non-primed group and 22 in the primed group) were recorded to one decimal place.
Purpose of the study The purpose of the study was to see if the people who were “primed” preferred the specific label more, than people who were not.
Visualize the data
library(ggplot2)
ggplot(data=preference, mapping=aes(x=as.factor(primed), y=preference)) + geom_point()
Interpret the plot The plot shows that the number of people does not change, however, the preference is higher for primed.
Formulate the null hypothesis The null hypothesis states that the means are going to be the same whether people are primed or not.
The alternative hypothesis The alternative hypothesis then, is that primed people are going to have a higher preference, and the means are going to be different.
Decide on the test The test that was chosen for this project is t-test.
ggplot(data=preference) + geom_qq(mapping=aes(sample=preference, color=as.factor(primed)))
The graph seems to follow the bell-curve shape close enough for us to assume that it is Normal.
Level of significance The level of significance would be set to 0.05.
T-test The t-test is going to be prformed.
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
Interpret P-value The p-value is equal to 0.002666. However, the level of significance was set up to 0.05. It is not equal, therefore, the null hypothesis should be rejected.
Interpret Confidence Interval The confidence interval is equal to ( -28.398779; -3.441221). The further away from 0 the endpoints, the more different the means are. Therefore, we can conclude that the means are different in this situation.
Interpret the sample estimates The two sample estimates are: non-primed mean= 2.005000 and primed mean= 2.972727. The primed mean is larger bigger by 0.967727, meaning that the group of primed people is larger by that number.
Conclusion In conclusion, it is safe to conclude that the primed people have a higher preference than not primed. Therefore, the t-test performed showed that the p-value and confidence interval are far apart. This being said, the null hypothesis is therefore rejected, and the alternative hypothesis is proven.