get_correlation_matrix: Calculate the subject-level (ICC) correlations among time...

View source: R/VPC.r

get_correlation_matrixR Documentation

Calculate the subject-level (ICC) correlations among time points

Description

Calculate the subject-level (ICC) correlations among time points

Usage

get_correlation_matrix(object)

## S3 method for class 'plcp_multi'
get_correlation_matrix(object)

Arguments

object

An object created by study_parameters

Details

The correlation between time point T_i and T_{i+1} within the same subject is also called the intraclass correlation (ICC) at level two. If the random slopes are non-zero this ICC change over time.

Value

A n1 x n1 matrix with the marginal subject-level correlations between time points.

Examples

paras <- study_parameters(n1 = 11,
                          n2 = 10,
                          n3 = 3,
                          T_end = 10,
                          icc_pre_subject = 0.5,
                          icc_pre_cluster = 0,
                          icc_slope = 0.05,
                          var_ratio = 0.03)
get_correlation_matrix(paras)

rpsychologist/powerlmm documentation built on May 11, 2023, 12:24 a.m.