Assignment 6

Due by 8:30am on Monday, October 19, 2026

RULES

You must use a RNotebook or RMarkdown file for this assignment:

  • Sections should have appropriate headers
  • All code must be contained within a code chunk. You are allowed to split up your code into many code chunks, or just have one large chunk per section. That is up to you. However, I do not want to see code located outside of a chunk (unless you’re making a quick note or telling us what you’re doing – but the code outside of a chunk shouldn’t be evaluated).
  • Any explanations I ask for should be outside of a code chunk (aka formatted text). I personally would put this directly underneath the header, but it can come after the code chunk ends, as well. Whatever you prefer. However, I do not want to see any sentences as comments within a code chunk (e.g., #a long sentence like this). Comments within the code is fine in terms of describing what the code is doing. But when I ask for your opinion or an explanation of something, that needs to be formatted text.

You must use the ggplot2 package and syntax for all plotting. No plots in base R.

Descriptive Statistics

Revisit Assignment 1, especially the Results: Summary Statistics - Part 2 section. After reviewing that, do the following.

Here’s your to-do list:

  • Get the mean, median, and standard deviation of 3 numeric variables in your dataset, but get these for each level of the categorical variable you chose in Assignment 1. That is, if your categorical variable was “treatment group”, you need the mean, median, and standard deviation for those that were in the “control” group and those that were in the “treatment” group. Now that you know more about using R, complete this task in any way except the way you did in Assignment 1. That is, do NOT use indexing and logical vectors.
  • Take those same 3 numeric variables and z-score them. Then make a density plot that has the distribution for all 3 variables overlaid and a figure legend telling you which variable each color represents. You do not need to plot each distribution per level of your categorical variable.
  • Describe in 1-2 sentences why it makes sense that you z-scored the 3 variables before plotting.

Hint: For the second bullet point, think carefully about whether the data should be in the long form or wide form before plotting.

Hypothesis Testing

Here’s your to-do list:

  • Conduct 2 hypothesis tests from your dataset. Choose any statistical tests that come from the Comparing Means lecture. For each of the 2 tests you need to:
    • Give a rationale for why you’re looking at this (does it theoretically make sense?; one sentence is OK)
    • State your null and alternative hypotheses
    • Have a code chunk running the test and printing out the results
    • Make a plot that shows the effect for each of your 2 tests (that is, if you are comparing 2 means, make a figure that illustrates this)
    • For each test, you must also provide either a confidence interval or a measure of effect size
    • Write 2-5 sentences per test interpreting the results including interpreting the \(p\)-value, confidence intervals/effect sizes, graph, and how it fits in to your hypotheses.

Current State of Academia in Psychology and Neuroscience

Here’s your to-do list:

  • Write a few sentences about publication bias as discussed in the lecture and in class. In it, describe what the “file drawer problem” is and how statistical power plays a role in publication bias.
  • Given what was presented in the Power+ lecture, what do you think about the state of Psychology and Neuroscience research? Do you feel optimistic, hopeless, energized, etc.? Explain why. There is no right answer, I just want to hear your thoughts.
  • If you currently work in a lab (or have previously worked in a lab), describe 2 things that your lab could improve upon to better support rigorous research. If you do not work in a lab (and you have not previously worked in one), describe 2 things that you could do better with your assignments in this class that would better adhere to Open Science standards.

Side note: Lots of focus has been given to Psychology research, but all of these same problems are present in Neuroscience research, too. If you would like papers supporting this, feel free to reach out – I’m happy to send some over. Anyone studying behavior will run into these types of issues because humans are not rational beings (unlike what your economist friends might say…). I also just really love these topics, so feel free to reach out at any point if you want to know more or want to pursue these topics.

Whooooooooo!

Done!

Go ahead and submit your .Rmd and .html file to Canvas. If you used an outside dataset, please also submit that, too.