coeftest

Class: RepeatedMeasuresModel

Linear hypothesis test on coefficients of repeated measures model

Syntax

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.

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.

Input Arguments

expand all

rm — Repeated measures modelRepeatedMeasuresModel object

Repeated measures model, returned as a RepeatedMeasuresModel object.

For properties and methods of this object, see RepeatedMeasuresModel.

A — Specification representing between-subjects modela-by-p matrix

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

Data Types: single | double

C — Specification representing within-subjects hypothesisr-by-c matrix

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

Data Types: single | double

D — Hypothesized value0 (default) | scalar value | a-by-c matrix

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

Data Types: single | double

Output Arguments

expand all

tbl — Results of multivariate analysis of variancetable

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

StatisticType of test statistic used
ValueValue of the corresponding test statistic
FF-statistic value
RSquareMeasure of variance explained
df1Numerator degrees of freedom for the F-statistic
df2Denominator degrees of freedom for the F-statistic
pValuep-value associated with the test statistic value

Examples

expand all

Test Coefficients for First and Last Repeated Measures

Load the sample data.

load repeatedmeas

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 = 

    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.

See Also

|

Was this topic helpful?