CorrR: This function obtains the correlation matrix of longitudinal...

CorrRR Documentation

This function obtains the correlation matrix of longitudinal data

Description

This function obtains the correlation matrix of longitudinal data

Usage

CorrR(y, x, beta, n, k, corre)

Arguments

y

the longitudinal response.

x

a matrix of predictors, consisting of omics and environment factors, as well as their interactions. In the case study, the omics measurements are lipidomics data.

beta

the coefficient vector.

n

the sample size.

k

a vector that contains the number of repeated measurements for each subject.

corre

the working correlation structure that is used in estimation algorithm. interep provides three choices for the working correlation structure: "a" as "AR-1", "i" as "independence" and "e" as "exchangeable".

Value

the correlation matrix.

Examples

data("dat")
y=dat$y
n=dim(y)[1]
x=dat$x
data=reformat(y,x)
y=data$y
x=data$x
beta=dat$beta
corre='e'
k=rep(dat$k,n)
CorrR(y,x,beta,n,k,corre)

feizhoustat/interep documentation built on Feb. 12, 2024, 8:30 a.m.