Learn R Programming

interep (version 0.1.0)

CorrR: 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

the number of repeated measurement.

corre

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

Value

the correlation matrix.

Examples

Run this code
# NOT RUN {
data("dat")
y=dat$y
n=dim(y)[1]
x=dat$x
k=dat$k
data=reformat(k,y,x)
y=data$y
x=data$x
beta=dat$beta
corre="AR-1"
k=rep(dat$k,n)
CorrR(y,x,beta,n,k,corre)
# }

Run the code above in your browser using DataLab