Learn R Programming

gsearly (version 1.0.0)

corrExp: Exponential correlation matrix

Description

Constructs an exponential correlation matrix.

Usage

corrExp(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

 # Exponential correlation model for outcomes at 3, 6, 12 and 24 months
 # Based on correlation 0.5 between outcomes separated by 3 month
 corrExp(0.5, tfuStandard(c(3,6,12,24), tref=c(1,2)))

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

Run the code above in your browser using DataLab