Annotating Statistics onto Plots Recitation

Week 9

Author

Jessica Cooperstone

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.

library(tidyverse)
library(NHANES)
library(rstatix)
library(ggpubr)
library(glue)
library(rcompanion)

Is total cholesterol (TotChol) different by age (AgeDecade)?

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.

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.

Back to top