This seems like it should be very simple but I just can't wrap my mind around it. Other questions/examples on here have dozens of variables, and I only have two, so I've been trying to figure out how to adapt them to my data but to no avail.
df <- data.frame(month = month.abb, amount.x = runif(12), amount.y = runif(12))
I want to run 12 t-tests, one for each month. The ideal output would be 12 p-values, or at the very least a list of 12 so I can see the results of each test. I've tried various forms of map()
and it keeps either throwing errors or just comparing each amount variable to itself instead of comparing each pair.
Any help would be appreciated!