CS: Compound Symmetry Structure

View source: R/structure.R

CSR Documentation

Compound Symmetry Structure

Description

Variance-covariance structure where the residuals have constant variance and correlation, possibly only within certain covariate levels. Can be stratified on a categorical variable.

Usage

CS(formula, var.cluster, var.time, heterogeneous = TRUE, 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.

heterogeneous

[logical] when covariates are used for the correlation structure, should correlation parameters should be specific to each level of the covariate?

add.time

not used.

Details

A typical formula would be ~1, indicating a variance constant over time and the same correlation between all pairs of times.

Value

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

Examples

CS(~1, var.cluster = "id", var.time = "time")
CS(gender~1, var.cluster = "id", var.time = "time")
CS(list(~time,~1), var.cluster = "id", var.time = "time")
CS(list(gender~time,gender~1), var.cluster = "id", var.time = "time")


LMMstar documentation built on Jan. 7, 2023, 1:20 a.m.