Load the sample data.

The table `between`

includes the between-subject
variables age, IQ, group, gender, and eight repeated measures *y*1
to *y*8 as responses. The table `within`

includes
the within-subject variables *w*1 and *w*2.
This is simulated data.

Fit a repeated measures model, where the repeated measures *y*1
to *y*8 are the responses, and age, IQ, group, gender,
and the group-gender interaction are the predictor variables. Also
specify the within-subject design matrix.

Compute the marginal means grouped by the between-subjects
factor `Group`

and the within-subject factor `Time`

.

M =
Group Time Mean StdErr Lower Upper
_____ ____ _______ ______ ________ _______
A 1 20.03 11.966 -4.7859 44.846
A 2 5.8101 8.0942 -10.976 22.597
A 3 20.694 5.1928 9.9247 31.463
A 4 16.802 5.1693 6.0813 27.522
A 5 13.157 6.2678 0.15862 26.156
A 6 0.38527 5.8028 -11.649 12.42
A 7 8.1398 6.4472 -5.2309 21.51
A 8 11.057 7.6083 -4.7213 26.836
B 1 23.768 11.816 -0.73653 48.273
B 2 16.846 7.9927 0.26973 33.422
B 3 -4.0888 5.1276 -14.723 6.5453
B 4 2.0001 5.1045 -8.5858 12.586
B 5 8.6458 6.1892 -4.1898 21.481
B 6 -9.3054 5.73 -21.189 2.578
B 7 8.8204 6.3663 -4.3825 22.023
B 8 9.4889 7.5129 -6.0918 25.07
C 1 19.951 12.236 -5.4261 45.327
C 2 23.63 8.2771 6.4646 40.796
C 3 -22.121 5.3101 -33.133 -11.109
C 4 -14.307 5.2861 -25.27 -3.3443
C 5 -20.138 6.4094 -33.43 -6.8456
C 6 -28.583 5.9339 -40.889 -16.277
C 7 -25.273 6.5928 -38.946 -11.6
C 8 -21.836 7.7801 -37.971 -5.7009

Display the description for table M.

ans =
Estimated marginal means
Means computed with Age=13.7, IQ=98.2667

Load the sample data.

The column vector, `species`

, consists of iris
flowers of three different species, setosa, versicolor, virginica.
The double matrix `meas`

consists of four types of
measurements on the flowers, the length and width of sepals and petals
in centimeters, respectively.

Store the data in a table array.

Fit a repeated measures model, where the measurements
are the responses and the species is the predictor variable.

Compute the marginal means grouped by the factor species.

ans =
species Mean StdErr Lower Upper
____________ ______ ________ ______ ______
'setosa' 2.5355 0.042807 2.4509 2.6201
'versicolor' 3.573 0.042807 3.4884 3.6576
'virginica' 4.285 0.042807 4.2004 4.3696

`StdError`

field shows the standard errors
of the estimated marginal means. The `Lower`

and `Upper`

fields
show the lower and upper bounds for the 95% confidence intervals of
the group marginal means, respectively. None of the confidence intervals
overlap, which indicates that marginal means differ with species.
You can also plot the estimated marginal means using the `plotprofile`

method.

Compute the 99% confidence intervals for the marginal
means.

ans =
species Mean StdErr Lower Upper
____________ ______ ________ ______ ______
'setosa' 2.5355 0.042807 2.4238 2.6472
'versicolor' 3.573 0.042807 3.4613 3.6847
'virginica' 4.285 0.042807 4.1733 4.3967