Documentation

This is machine translation

Translated by Microsoft
Mouse over text to see original. Click the button below to return to the English verison of the page.

Model Specification for Repeated Measures Models

Model specification for a repeated measures model is a character vector representing a formula in the form

'y1-yk ~ terms',

where the responses and terms are in Wilkinson notation.

For example, if you have five repeated measures y1, y2, y3, y4, and y5, and you include the terms X1, X2, X3, X4, and X3:X4 in your linear model, then you can specify modelspec as follows:

Wilkinson Notation

Wilkinson notation describes the factors present in models. It does not describe the multipliers (coefficients) of those factors.

Use these rules to specify the responses in modelspec.

Wilkinson NotationDescription
Y1,Y2,Y3Specific list of variables
Y1-Y5All table variables from Y1 through Y5

The following rules are for specifying terms in modelspec.

Wilkinson NotationFactors in Standard Notation
1Constant (intercept) term
X^k, where k is a positive integerX, X2, ..., Xk
X1 + X2X1, X2
X1*X2X1, X2, X1*X2
X1:X2X1*X2 only
-X2Do not include X2
X1*X2 + X3X1, X2, X3, X1*X2
X1 + X2 + X3 + X1:X2X1, X2, X3, X1*X2
X1*X2*X3 - X1:X2:X3X1, X2, X3, X1*X2, X1*X3, X2*X3
X1*(X2 + X3)X1, X2, X3, X1*X2, X1*X3

Statistics and Machine Learning Toolbox™ notation always includes a constant term unless you explicitly remove the term using -1.

See Also

Was this topic helpful?