plotSmoothingANOVA: Smoothing line plot, with ANOVA

Description Usage Arguments Details Author(s) Examples

Description

Generate a bivariate plot of a factor variable (x-axis) and a continuous variable (y-axis) that overlays a smoothing line (loess), which also prints an ANOVA p-value.

Usage

1
plotSmoothingANOVA(data, x, y, id, y.axis.limits = c(0.2, 0.8))

Arguments

data

Dataset with the variables of interest.

x

The factor variable on the x-axis. Generally is the time variable in a longitudinal setting. Must be a string/character.

y

The continuous variable on the y-axis. Must be a string/character.

id

The grouping variable, generally the ID for the participant in a longitudinal setting.

y.axis.limits

Limits of the y-axis. Must be two numbers.

Details

Generally I use this for plotting longitudinal data, where the x-axis is the timepoints and the ANOVA is testing the significance across time (which may be arguably inappropriate... FIXME).

Author(s)

Luke W. Johnston

Examples

1
2
3
4
5
6
7
data(state)
cbind(state.region, state.x77) %>%
  as.data.frame() %>%
  mutate(f.Pop = Population %>%
      quantile(., c(0, .333, .666, 1), na.rm = TRUE) %>%
      cut(Population, ., include.lowest = TRUE)) %>%
  plotSmoothingANOVA(., 'f.Pop', 'Illiteracy', id = 'state.region')

lwjohnst86/rstatsToolkit documentation built on May 21, 2019, 9:15 a.m.