meanPlot: Computes standard error and confidence intervals under...

Description Usage Arguments Examples

View source: R/meanPlot.R

Description

Computes standard error and confidence interval under various designs and sampling schemes

Usage

1
2
3
4
5
meanPlot(data, ..., bsfactor = NULL, wsfactor = NULL, factorOrder,
  measure, statistic = "mean", errorbar = "SE", gamma,
  adjustments = list(purpose = "single", popsize = Inf, decorrelation =
  "none"), sep, plot = TRUE, plot.type = "bar",
  error.params = list(width = 0.8), graph.params = list())

Arguments

data

Data frame

bsfactor

The name of your between-subject factor(s)

wsfactor

The name of your within-subject factor(s)

factorOrder

Order of factors as shown in the graph (x axis, groups, panels)

measure

Your dependent variable

errorbar

The content of your error bar. Can either be "CI" or "SE". Defaults to "SE"

gamma

Only necessary if errorbar == "CI". The confidence level.

adjustments

List of adjustments as described below

sep

The separator used to separate dependent variables from within-subject factors in a wide data frame. Only required for wide data frames where wsfactors are separated by a character. Can be skipped if you would like to have groups of within factors in your graph.

plot

Defaults to TRUE. Set to FALSE if you do not want the output to be a plot.

plot.type

The type of object to plot on the graph. Can be either "bar" or "line". Defaults to "bar".

error.params

a list of ggplot2 parameters to input inside geom_errobar (see ?geom_errorbar in ggplot2)

graph.params

a list of ggplot2 parameters to input inside geoms (see ?geom_bar in ggplot2)

popsize

Size of the population under study if known. Defaults to Inf

purpose

The purpose of the comparisons. Defaults to "single". Options: single, difference

decorrelation

For repeated measure designs only. Chooses the decorrelation method ("CM" or "LM"). Defaults to "none".

Examples

1
2
3
4
meanPlot(ToothGrowth, bsfactor = c("dose", "supp"), measure = "len",
statistic = "mean",
xlab = xlab("Dose"), ylab = ylab("Tooth Growth"),
theme = theme_bw())

felixchiasson/meanPlot documentation built on May 7, 2019, 7:16 p.m.