group.center {robumeta} | R Documentation |
Creates a within-study (or within-cluster) version of the covariate in question.
group.center(var, grp)
var |
The covariate to be group centered. |
grp |
A vector corresponding to the group identification. |
A column or vector containing the group.centered covariate.
# Load data
data(corrdat)
# Create a group centered covariate
males_c <- group.center(corrdat$males, corrdat$studyid)