pmean: Centering on person-means

Description Usage Arguments Value Examples

View source: R/pmean.R

Description

This function allows you calculate person-level means. This will create a level-2 variable that can be used in tandem with person-centered means. This is useful if you are interested in both the within-person and between-person effects.

Usage

1
pmean(ID, var)

Arguments

ID

name of ID variable

var

name of variable to be centered

Value

A column in your dataframe (with person-level means)

Examples

1
## Not run: data$centeredVAR<-pmean(data$ID,data$var)

Example output



EMAtools documentation built on Nov. 1, 2021, 1:07 a.m.