# coeftest

Class: RepeatedMeasuresModel

Linear hypothesis test on coefficients of repeated measures model

## Description

example

tbl = coeftest(rm,A,C,D) returns a table tbl containing the multivariate analysis of variance (manova) for the repeated measures model rm.

## Input Arguments

expand all

Repeated measures model, returned as a RepeatedMeasuresModel object.

For properties and methods of this object, see RepeatedMeasuresModel.

Specification representing the between-subjects model, specified as an a-by-p numeric matrix, with rank ap.

Data Types: single | double

Specification representing the within-subjects (within time) hypotheses, specified as an r-by-c numeric matrix, with rank crnp.

Data Types: single | double

Hypothesized value, specified as a scalar value or an a-by-c matrix.

Data Types: single | double

## Output Arguments

expand all

Results of multivariate analysis of variance for the repeated measures model rm, returned as a table containing the following columns.

 Statistic Type of test statistic used Value Value of the corresponding test statistic F F-statistic value RSquare Measure of variance explained df1 Numerator degrees of freedom for the F-statistic df2 Denominator degrees of freedom for the F-statistic pValue p-value associated with the test statistic value

## Examples

expand all

The table between includes the between-subject variables age, IQ, group, gender, and eight repeated measures y1 through y8 as responses. The table within includes the within-subject variables w1 and w2. This is simulated data.

Fit a repeated measures model, where the repeated measures y1 through y8 are the responses, and age, IQ, group, gender, and the group-gender interaction are the predictor variables. Also specify the within-subject design matrix.

rm = fitrm(between,'y1-y8 ~ Group*Gender + Age + IQ','WithinDesign',within);

Test that the coefficients of all terms in the between-subjects model are the same for the first and last repeated measurement variable.

coeftest(rm,eye(8),[1 0 0 0 0 0 0 -1]')
ans=4×7 table
Statistic     Value       F       RSquare    df1    df2    pValue
_________    _______    ______    _______    ___    ___    _______

Pillai        0.3355    1.3884    0.3355      8     22     0.25567
Wilks         0.6645    1.3884    0.3355      8     22     0.25567
Hotelling    0.50488    1.3884    0.3355      8     22     0.25567
Roy          0.50488    1.3884    0.3355      8     22     0.25567

The $p$-value of 0.25567 indicates that there is not enough statistical evidence to conclude that the coefficients of all terms in the between-subjects model for the first and last repeated measures variable are different.

## Tips

• This test is defined as A*B*C = D, where B is the matrix of coefficients in the repeated measures model. A and C are numeric matrices of the proper size for this multiplication. D is a scalar or numeric matrix of the proper size. The default is D = 0.