Produce the following in R:
- Load the required packages:
- Reverse code the appropriate items of the SURPS.
rowMeans()to calculate mean scores for each participant on each of the four SURPS subscales.
cannabis_useto a factor collapsing levels of with fewer than 61 participants as described in the previous section.
- Produce M and SD sensation seeking scores at each level of cannabis use (after collapsing the levels as needed).
ggplot()to produce a boxplot with cannabis use on the x axis and sensation seeking on y axis. Use
geom_jitter()to plot each participants’ score overtop of the boxplots.
- Conduct ANOVA and pairwise comparisons
aov()to produce a model predicting hopelessness from cannabis use.
summary()to inspect the results.
- Conduct planned comparisons.
emmeans::emmeans()to produce estimated marginal means. You will need to specify values for the arguments
emmeans::contrast()to conduct the contrasts described in the analytic strategy. See
vignette(topic = "comparisons", package = "emmeans").
emmeans::eff_size()to produce Cohen’s d effect sizes for the contrasts.
Write a Results section, consistent with APA style, that includes the following:
- Results of the ANOVA.
- Results of the planned comparisons.
- The plot you produced.
Provide short answer responses to the following prompts:
- Provide a statement of support or nonsupport for your hypothesis. Refer to the results of both the omnibus ANOVA test and the planned comparisons in your response.
- The design plan described how levels of cannabis use would be collapsed if the groups were too small to provide adequate statistical power. Do you think that collapsing levels of cannabis use was adequately justified? Why or why not? How might collapsing levels of cannabis use have affected your results?
- Describe one limitation of this study. How could the limitation you identified be addressed in future research?