Learn R Programming

mlmpower (version 1.0.9)

mp_corr_func: Functions for Generating Correlations

Description

Specify a random correlation that is uniform between lower and upper

Usage

random(lower, upper)

fixed(value)

Value

A mp_corr_func that generates the desired correlation

Arguments

lower

the lower bound of the distribution.

upper

the upper bound of the distribution.

value

the fixed value for the correlation.

See Also

correlations()

Examples

Run this code
# Create Model with random and fixed correlations
(
    outcome('Y')
    + within_predictor('X')
    + between_predictor('Z')
    + effect_size(icc = 0.1)
    # Defaults
    + correlations(
        within  = random(0.1, 0.3),
        between = fixed(0.2)
    )
)

Run the code above in your browser using DataLab