Step 2: Load the data

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

Step 3: Describe the data

Primed consumers (1 in data set) and non-primed consumers (0) were asked to indicate their attitude toward a product on a continuous rating scale from 0 (dislike very much) to 6 (like very much), which is the preference scale.

Step 4: The Purpose of the Study

The purpose of this study is to assess whether primed consumers process visual information easier and have different preferences from non-primed consumers.

Step 5: Visualize Data

library(ggplot2)
ggplot(data=preference, mapping=aes(x=as.factor(primed), y=preference)) + geom_point()

Step 6: Interpret the plot

There is a greater chance of having a higher preference for the product if you are primed.

Step 7: Formulate the Null Hypothesis

The preference for the primed and non-primed consumer is the same.

Step 8: Identify the Alternate Hypothesis

There will be a difference in preference for the primed and non-primed consumers.

Step 9: Decide on Type of Test

A t-test will be used because we are testing hypotheses about population means of a quantative variable.

Step 10: Choose Number of Samples

We need two samples

Step 11: Check assumptions of the test

library(ggplot2)
ggplot(data=preference) + geom_qq(mapping=aes(sample=preference, color=as.factor(primed)))

The nonprimed data (0) has a lot of variation but it is stil considered a normal distribution because the points have a diagnol characteristic. The primed data (1) has a fairly normal distribution.

Step 12: Decide on Significance of the test

It is always a safe bet to use the traditional level of significance of 0.05

Step 13: Perform the test

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

Step 14: Interpret the P-value

Since the p-value is less than the level of significance, we regect the null hypothesis that the means are equal.

Step 15: Interpret the Confidence Interval

The confidence interval is the range of plausible values for the difference in means. Zero is not in this interval. Therefore 0 is not a plausible value for the difference in means, so it is not plausible that the means are the same. The result of STEP 15 is consistent with the result of STEP 14.

Step 16: Interpret the Sample Estimates

The means are not equal. The primed consumers have a greater mean of 0.97 than the non-primed consumers.

Step 17: Conclusion

The primed consumers have a higher preference for the product than the non-primed consumers.