Learn R Programming

gsearly (version 1.0.0)

corrUnif: Uniform correlation matrix

Description

Constructs a uniform correlation matrix.

Usage

corrUnif(rho=0, tfu)

Value

Returns an s x s correlation matrix. Where s is the number of occasions (follow-up time points) at which the study outcome is observed.

Arguments

rho

Correlation parameter.

tfu

Follow-up time points, in standardized format from function tfuStandard.

Examples

Run this code

 # Uniform correlation model for outcomes at 3, 6, 12 and 24 months
 # Settings for tref argument of standardtfu do not change correlation matrix
 corrUnif(0.5, tfuStandard(c(3,6,12,24), tref=c(1,2)))

 # Based on correlation 0.5 between outcomes separated by 1 year
 corrUnif(0.5, tfuStandard(c(3,6,12,24), tref=c(3,4)))

Run the code above in your browser using DataLab