serr: Computes the standard error of the mean over an id variable.

Description Usage Arguments Examples

View source: R/serr.R

Description

Note: this package is deprecated. Please use sem instead. This function will compute the standard error of the mean given a raw (trial-by-trial) dataset, a dependent variable of interest, an id variable (e.g., "subjects" or "items"), and a set of grouping variables (e.g., "condition"). It also outputs several statistics: SD, N, and confidence intervals.

Two versions of the function are provided. The standard serr function will accept dplyr-like arguments (without quotes) for column names. The other serr_ function works on quoted strings, and all grouping variables must be supplied as a vector of characters to the grouping argument.

Usage

1
2
3
4
serr(data, dv, id, ..., confint_serr = 1, return_interim_data = F)

serr_(data, dv, id, grouping, confint_serr = 1,
  return_interim_data = F)

Arguments

data

A dataframe or datatable

dv

Variable representing your dependent variable. Use the bare variable name when using serr.

id

Variable representing an id variable (e.g., "subject" or "item"). Use the bare variable name when using serr.

...

Variables to group by (e.g., conditions) when using serr. Use bare variable names separated by commas.

confint_serr

Size (in standard errors) for confidence intervals. Default confidence intervals are 1 SERR. To get 95% confidence intervals, enter 1.96.

return_interim_data

TRUE or FALSE, whether to return the interim dataset (e.g., subject-level data) as well as the grand mean dataset (via a list object). By default (FALSE), only the grand mean dataset is returned.

grouping

Character vector of the set of variables to group by (e.g., conditions) when using serr_.

Examples

1
2
3
4
library(languageR)
lexdec.rt <- lexdec[lexdec$Correct=="correct",]
serr_summary.rt <- serr(data = lexdec.rt, dv = RT, id = Subject, Class, Complex)
print(serr_summary.rt)

jasongullifer/convenience documentation built on May 21, 2019, 10:31 a.m.