Learn R Programming

mlmpower (version 1.0.9)

correlations: Specify the Correlation Structure for the Model

Description

Creates a list of correlations to be added to a mp_model.

Usage

correlations(within, between, randeff)

Value

A list that corresponds to each correlation value.

Arguments

within

a single numeric value or mp_corr_func that specifies random correlations. Corresponds to the level-1 correlation among predictors.

between

a single numeric value or mp_corr_func that specifies random correlations. Corresponds to the level-2 correlation among predictors.

randeff

a single numeric value or mp_corr_func that specifies random correlations. Corresponds to the random effects correlation among predictors.

Details

The default values are random(0.1, 0.3). Currently randeff are required to be zero if more than one random slope is in the model.

See Also

random() fixed()

Examples

Run this code
(
    outcome('Y')
    + within_predictor('X')
    + effect_size(
        icc = c(0.1, 0.2),
        within = 0.3
    )
    # Defaults
    + correlations(
        within  = random(0.1, 0.3),
        between = random(0.1, 0.3),
        randeff = random(0.1, 0.3)
    )
)

Run the code above in your browser using DataLab