library(tidyverse)
library(NHANES)
library(rstatix)
library(ggpubr)
library(glue)
library(rcompanion)
Annotating Statistics onto Plots Recitation
Week 9
Introduction
Today you will be practicing what we learned in today’s class on adding statistics to your plots.
Load data
We will be using the NHANES data again from the package NHANES
.
Belwo are the packages that I used to make my plot.
Is total cholesterol (TotChol
) different by age (AgeDecade
)?
Need a hint? (Click to expand)
Hint - you want to test your assumptions to see what tests to do. You might need to use different posthoc comparison methods than we did in class.
Need another hint? (Click to expand)
Another hint - the function rcompanion::cldList()
will convert the resulting comparison table from a posthoc Dunn test to create a column with the letters indicating which groups are significantly different from each other.