Navigate to the folder containing sample data.

Load the sample data.

The matrix `Y`

contains response data for 16
individuals. The response is the blood level of a drug measured at
five time points (time = 0, 2, 4, 6, and 8). Each row of `Y`

corresponds
to an individual, and each column corresponds to a time point. The
first eight subjects are female, and the second eight subjects are
male. This is simulated data.

Define a variable that stores gender information.

Store the data in a proper table array format to do repeated
measures analysis.

Define the within-subjects variable.

Fit a repeated measures model, where the blood levels
are the responses and gender is the predictor variable.

Perform repeated measures analysis of variance.

ranovatbl =
SumSq DF MeanSq F pValue pValueGG pValueHF pValueLB
______ __ ______ _______ __________ __________ __________ __________
(Intercept):Time 881.7 4 220.43 37.539 3.0348e-15 4.7325e-09 6.2859e-11 2.6198e-05
Gender:Time 17.65 4 4.4125 0.75146 0.56126 0.4877 0.515 0.40063
Error(Time) 328.83 56 5.872

There are 5 time points, 2 genders, and 16 observations. So,
the degrees of freedom for time is (5–1) = 4, for gender-time
interaction it is (5–1)*(2–1) = 4, and for error it
is (16–2)*(5–1) = 56. The small *p*-value
of 2.6198e–05 indicates that there is a significant effect
of time on blood pressure. The *p* -value of 0.40063
indicates that there is no significant gender-time interaction.