Last active
June 17, 2016 19:49
-
-
Save tklebel/1e5331be700c6f57e7922176eea03130 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# save test result as object | |
test_res <- t.test(examgrades$MeanGrade ~ examgrades$Semester) | |
# extract t and p values and format them | |
label <- paste(paste("t =", round(test_res$statistic, 2)), | |
paste("p =", format.pval(test_res$p.value, eps = .001)), | |
sep = ", ") | |
# add text with t-test result to figure | |
q1 <- q + annotate("text", x = 1, y = 85, label = label, size = 8) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment