summarySEwithin: Summarize data for within-subjects designs.

summarySEwithinR Documentation

Summarize data for within-subjects designs.

Description

Summarizes data, handling within-subjects variables by removing inter-subject variability. It will still work if there are no within-S variables. Gives count, un-normed mean, normed mean (with same between-group mean), standard deviation, standard error of the mean, and confidence interval. If there are within-subject variables, calculate adjusted values using method from Morey (2008).

Usage

summarySEwithin(
  data = NULL,
  measurevar,
  betweenvars = NULL,
  withinvars = NULL,
  idvar = NULL,
  na.rm = FALSE,
  conf.interval = 0.95,
  .drop = TRUE
)

Arguments

data

A data frame.

measurevar

The name of a column that contains the variable to be summariezed.

betweenvars

A vector containing names of columns that are between-subjects variables.

withinvars

A vector containing names of columns that are within-subjects variables

idvar

The name of a column that identifies each subject (or matched subjects).

na.rm

A boolean that indicates whether to ignore NA's.

conf.interval

The percent range of the confidence interval, 95 percent default.

Note

See : http://www.cookbook-r.com/Graphs/Multiple_graphs_on_one_page_(ggplot2)/

Author(s)

Winston Chang

Examples

x <- rnorm(100,100,15)
y <- sample(c("Group 1","Group 2"),100,TRUE)
z <- sample(c("Low","Med","High"),100,TRUE)
subject <- rep(1:5,20)
df <- data.frame(x,y,z,subject)
summarySEwithin(data=df, measurevar="x", betweenvars="y", withinvars="z", idvar="subject")

chavezlab/csnl documentation built on June 12, 2022, 10:09 a.m.