Learn R Programming

robumeta (version 2.1)

group.mean: Convenience function for calculating group-mean covariates.

Description

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

Usage

group.mean(var, grp)

Value

A column or vector containing the group.mean covariate.

Arguments

var

The covariate cotaining the values to be group averaged.

grp

The group from which the average should be calculated.

Examples

Run this code


# Load data
data(corrdat)

# Create a group mean covariate 
age_m <- group.mean(corrdat$age, corrdat$studynum)


Run the code above in your browser using DataLab