this is the code and data i already have:
library(tidyverse)
t.test(BMIS ~ CONDITION, var.equal =TRUE, data = BMIS_DATA)
descriptive_statistics = BMIS_DATA %>%
group_by(CONDITION) %>%
summarise(
mean = mean (BMIS),
sd = sd (BMIS),
n = n ()
)
view(descriptive_statistics)
mean_difference = descriptive_statistics [1,2] - descriptive_statistics [2,2]
Which gave me:
Two Sample t-test
data: BMIS by CONDITION
t = 3.7455, df = 44, p-value = 0.0005201
alternative hypothesis: true difference in means is not equal to 0
95 percent confidence interval:
4.299781 14.317362
sample estimates:
mean in group HAPPY mean in group SAD
45.88000 36.57143
I used this code to give me a boxplot:
library(ggplot2)
ggplot(BMIS_DATA,aes(x=CONDITION,y=BMIS,col=CONDITION))+geom_boxplot()
But i need it in APA style, i found this code online:
theme_apa(
+ legend.pos = "right",
+ legend.use.title = FALSE,
+ legend.font.size = 12,
+ x.font.size = 12,
+ y.font.size = 12,
+ facet.title.size = 12,
+ remove.y.gridlines = TRUE,
+ remove.x.gridlines = TRUE
+ )
However the error "Error in theme_apa() : could not find function "theme_apa"
" came up.
How can i fix this? or is there another way to integrate APA style