My coding goals for this week:
My group has been absolutely amazing, as we have finished reproducing our data and plots, so we are mainly focusing on preparing for our presentation this Friday. So my main coding goal for this week was to keep practising and adding to my coding skills!
Since the focus of this week’s Q and A sessions was introducing us to statistics in R, I thought I would try and apply I what learnt with some data that I made up about a memory test. Doing stats in R this week was actually really fitting since most, if not all, of us are doing PSYC3001 this term!
Successes and challenges:
I was really happy to successfully produce the descriptive statistics for my data, as well as make a bar graph and a box plot. I wanted to make a violin plot from my data, but it looked SUPER ugly, so I stuck with doing a box plot. I also managed to run an ANOVA, which was pretty exciting!
However, the main challenge I faced throughout this process was the fact that I made an incredible amount of silly mistakes!! It was quite frustrating, but given that my sleep schedule has been very out of whack lately, I wasn’t really at the top of my game. I also came across a few errors, such as:
Error in f(…) : Can only handle data with groups that are plotted on the x-axis
However, I eventually discovered that this error kept occurring because I had not yet changed my study conditions from numeric variables into factors. Once I made that change, my code ran perfectly fine!
# descriptive statistics
memory_performance <- memory_performance %>%
na.omit
test_score_summary <- memory_performance %>%
group_by(Group) %>%
summarise(mean = mean(Test_score), sd = sd(Test_score), n = n(), se = sd/sqrt(n))
test_score_summary %>%
gt() %>%
fmt_number(columns = 2:5,decimals = 3)| Group | mean | sd | n | se |
|---|---|---|---|---|
| 1 | 14.000 | 1.949 | 11.000 | 0.588 |
| 2 | 16.000 | 1.949 | 11.000 | 0.588 |
| 3 | 23.000 | 1.949 | 11.000 | 0.588 |
| 4 | 21.000 | 2.191 | 11.000 | 0.661 |
| 5 | 18.000 | 2.191 | 11.000 | 0.661 |
# Visualisation
## boxplot
plot_1 <- memory_performance %>%
group_by(Group) %>%
ggplot(aes(x=Group, y=Test_score, fill= Group)) +
geom_boxplot(alpha = 0.5) +
geom_jitter(alpha = 0.8)
print(plot_1)## bar plot
test_score_summary <- memory_performance %>%
ggplot(aes(x=Group, y=Test_score, fill=Group)) +
geom_col() +
scale_y_continuous(expand = c(0,0),
limits = c(0, 30))
print(test_score_summary)## Warning: Removed 49 rows containing missing values (geom_col).
# ANOVA
my_comparisons <- list(c("1", "2", "3", "4", "5"))
plot_1 + stat_compare_means(comparisons = my_comparisons,
method = "t.test")anova_test(memory_performance,Test_score ~ Group) # I went with the rstatix ANOVA code because it looked a lot neater## Coefficient covariances computed by hccm()
## ANOVA Table (type II tests)
##
## Effect DFn DFd F p p<.05 ges
## 1 Group 4 50 34.833 6.78e-14 * 0.736
Next steps in my coding journey:
Jenny said that we will be continuing the Intro to Stats in R topic in next week’s Q and A sessions, so I am very excited for that! I love how this content kind of overlaps with what we are learning in PSYC3001, yet it is nice to use another program other than SPSS and being able to make pretty graphs!
In the meantime, I plan to continue refining my coding skills so that I don’t get rusty too quickly. If I manage to get some free time, I might even try and find some interesting R tutorials to work through, but I’ll mainly be focusing on completing my reproducibility report.
I will also continue to work with my group on our presentation. The powerpoint slides we have put together are really and I am looking forward to sharing our reproducibility journey with our peers. I might sound like a broken record, but I am truly lucky to be in the group that I am in, as we worked really well together, all pulled our own weight and everyone had such amazing attitudes throughout this process. It really made this journey more enjoyable and this internship experience all the more valuable.
I am also really excited to listen to the other group’s presentations, as I am curious about how similar/different our experiences were, as well as be amazed by how far everyone has come in their coding journeys!
I thought it was worth mentioning that I was super encouraged by other people’s learning logs I have read, as it looked like the other groups also worked really well together. One learning log (I believe it was Alison’s) included a group photo and I couldn’t get over how wholesome it was! :)