TOEPLITZ: Toeplitz Structure

View source: R/structure.R

TOEPLITZR Documentation

Toeplitz Structure

Description

Variance-covariance structure where the correlation depends on time elapsed between two repetitions. Can be stratified on a categorical variable.

Usage

TOEPLITZ(formula, var.cluster, var.time, type = "LAG", add.time)

Arguments

formula

formula indicating on which variable to stratify the residual variance and correlation (left hand side) and variables influencing the residual variance and correlation (right hand side).

var.cluster

[character] cluster variable.

var.time

[character] time variable.

type

[character] degree of flexibility of the correlation structure within covariate ("UN","LAG","CS"). Will also affect the variance structure when not explicit.

add.time

Should the default formula (i.e. when NULL) contain a time effect.

Details

formula: there can only be at most one covariate for the correlation structure. A typical formula would be ~1, indicating a variance constant over time and a correlation specific to each gap time.

type: for a binary covariate the correlation matrix can be decomposed into four blocs: A, B, B, C. A correspond the correlation within level 0 of the covariate, C within level 1, and B between level 0 and 1. Different correlation structures can be specified:

  • "UN": unstructured matrix except for the diagonal elements of C which are constrained to be equal.

  • "LAG": Toeplitz structure within A, B, and C, i.e. correlation specific to each time lag and covariate level.

  • "CS": block-specific value except for C which has a different value for its diagonal elements.

Value

An object of class TOEPLITZ that can be passed to the argument structure of the lmm function.

Examples

## no covariate
TOEPLITZ(~time, var.cluster = "id", var.time = "time")
TOEPLITZ(gender~time, var.cluster = "id", var.time = "time")
TOEPLITZ(list(~time,~time), var.cluster = "id", var.time = "time")
TOEPLITZ(list(gender~time,gender~time), var.cluster = "id", var.time = "time")

## with covariates
TOEPLITZ(~side, var.cluster = "id", type = "UN",
         var.time = "time", add.time = TRUE)
TOEPLITZ(~side, var.cluster = "id", type = "LAG",
         var.time = "time", add.time = TRUE)
TOEPLITZ(~side, var.cluster = "id", type = "CS",
         var.time = "time", add.time = TRUE)
TOEPLITZ(gender~side, var.cluster = "id", type = "CS",
         var.time = "time", add.time = TRUE)

LMMstar documentation built on Nov. 9, 2023, 1:06 a.m.