Description Usage Arguments Details Author(s) Examples
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.
1 | plotSmoothingANOVA(data, x, y, id, y.axis.limits = c(0.2, 0.8))
|
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. |
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).
Luke W. Johnston
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')
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.