Learn R Programming

robumeta (version 2.1)

group.center: 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)

Value

A column or vector containing the group.centered covariate.

Arguments

var

The covariate to be group centered.

grp

A vector corresponding to the group identification.

Examples

Run this code


# 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