TOEPLITZ | R Documentation |
Variance-covariance structure where the correlation depends on time elapsed between two repetitions. Can be stratified on a categorical variable.
TOEPLITZ(formula, var.cluster, var.time, type = "LAG", add.time)
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 ( |
add.time |
Should the default formula (i.e. when |
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.
An object of class TOEPLITZ
that can be passed to the argument structure
of the lmm
function.
## 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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.