Convenience function for calculating group-centered covariates.
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)
Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.