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

Description Usage Arguments Value Examples

View source: R/group.mean.R

Description

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

Usage

1

Arguments

var

The covariate cotaining the values to be group averaged.

grp

The group from which the average should be calculated.

Value

A column or vector containing the group.mean covariate.

Examples

1
2
3
4
5
# Load data
data(corrdat)

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

robumeta documentation built on May 1, 2019, 8:21 p.m.