subjectCenteringTransform
is a transformation that can
be applied to a matrix of data. the resulting matrix have means
that are centered on the grand mean, subject-wise (Cousineau 2005)
.
subjectCenteringTransform(dta, variables)
a data.frame containing the data in wide format;
a vector of column names on which the transformation will be applied. the remaining columns will be left unchanged
a data.frame of the same form as dta with the variables transformed.
This function is useful when passed to the argument preprocessfct
of superb()
where it performs a modification of the data matrix.
Cousineau D (2005). “Confidence intervals in within-subject designs: A simpler solution to Loftus and Masson's method.” Tutorials in Quantitative Methods for Psychology, 1, 42 -- 45. doi:10.20982/tqmp.01.1.p042 .