group.center: Convenience function for calculating group-centered...

View source: R/group.center.R

group.centerR Documentation

Convenience function for calculating group-centered covariates.

Description

Creates a within-study (or within-cluster) version of the covariate in question.

Usage

group.center(var, grp)

Arguments

var

The covariate to be group centered.

grp

A vector corresponding to the group identification.

Value

A column or vector containing the group.centered covariate.

Examples



# Load data
data(corrdat) 

# Create a group centered covariate 
males_c <- group.center(corrdat$males, corrdat$studyid)



robumeta documentation built on March 31, 2023, 11:48 p.m.