powered by
Creates a within-study (or within-cluster) version of the covariate in question.
group.center(var, grp)
A column or vector containing the group.centered covariate.
The covariate to be group centered.
A vector corresponding to the group identification.
# Load data data(corrdat) # Create a group centered covariate males_c <- group.center(corrdat$males, corrdat$studyid)
Run the code above in your browser using DataLab