wtn_sbj_c: Within-subjects centering

View source: R/wtn_sbj_c.R

wtn_sbj_cR Documentation

Within-subjects centering

Description

Centers a number of behaviours within-subjects by subtracting the subject's mean value from each observation value.

Usage

wtn_sbj_c(x, behaviours, subject_var)

Arguments

x

A data frame with different behaviours as different columns.

behaviours

Behaviours/variables to calculate mean and center within-subjects

subject_var

Unquoted name of subjects column in x

Value

A data frame with new columns with means and centered values for each behaviour.

References

van de Pol and Wright (2009). A simple method for distinguishing within- versus between-subject effects using mixed models.


avrincon/phdfuns documentation built on Nov. 13, 2022, 10:34 a.m.