normData: normData

View source: R/psychReportData.R

normDataR Documentation

normData

Description

Aggregate data returning the mean, standard deviation, and standard error

Usage

normData(data, idvar, dvs)

Arguments

data

A dataframe

idvar

Column indicating the individual participants

dvs

List of numeric data columns to normalise

Value

dataframe

Examples


# Example 1:
library(dplyr)
dat <- createDF(nVP = 50, nTrl = 50, design = list("Comp" = c("comp", "incomp")))
dat <- addDataDF(dat,
  RT = list(
    "Comp comp" = c(500, 80, 100),
    "Comp incomp" = c(550, 80, 140)
  ),
  Error = list(
    "Comp comp" = 5,
    "Comp incomp" = 10
  )
)
datAggVP <- dat %>%
  group_by(VP, Comp) %>%
  summarize(
    N = n(),
    RT = mean(RT[Error == 0]),
    ER = (sum(Error) / N) * 100
  )
datAggVP <- normData(datAggVP, "VP", c("RT", "ER"))

psychReport documentation built on Sept. 9, 2022, 5:08 p.m.