# epsilon

Epsilon adjustment for repeated measures anova

## Syntax

``tbl = epsilon(rm)``
``tbl = epsilon(rm,C)``

## Description

example

````tbl = epsilon(rm)` returns the epsilon adjustment factors for repeated measures model `rm`.```
````tbl = epsilon(rm,C)` returns the epsilon adjustment factors for the test based on the contrast matrix `C`.```

## Examples

collapse all

`load fisheriris`

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.

```t = table(species,meas(:,1),meas(:,2),meas(:,3),meas(:,4),... 'VariableNames',{'species','meas1','meas2','meas3','meas4'}); Meas = dataset([1 2 3 4]','VarNames',{'Measurements'});```

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

`rm = fitrm(t,'meas1-meas4~species','WithinDesign',Meas);`

Perform repeated measures analysis of variance.

`ranovatbl = ranova(rm)`
```ranovatbl=3×8 table SumSq DF MeanSq F pValue pValueGG pValueHF pValueLB ______ ___ ________ ______ ___________ ___________ ___________ ___________ (Intercept):Measurements 1656.3 3 552.09 6873.3 0 9.4491e-279 2.9213e-283 2.5871e-125 species:Measurements 282.47 6 47.078 586.1 1.4271e-206 4.9313e-156 1.5406e-158 9.0151e-71 Error(Measurements) 35.423 441 0.080324 ```

`ranova` computes the last three $p$-values using Greenhouse-Geisser, Huynh-Feldt, and lower bound corrections, respectively.

Display the epsilon correction values.

`epsilon(rm)`
```ans=1×4 table Uncorrected GreenhouseGeisser HuynhFeldt LowerBound ___________ _________________ __________ __________ 1 0.75179 0.76409 0.33333 ```

You can check the compound symmetry (sphericity) assumption using the `mauchly` method.

## Input Arguments

collapse all

Repeated measures model, returned as a `RepeatedMeasuresModel` object.

For properties and methods of this object, see `RepeatedMeasuresModel`.

Contrasts, specified as a matrix. The default value of `C` is the Q factor in a QR decomposition of the matrix M, where M is defined so that Y*M is the difference between all successive pairs of columns of the repeated measures matrix Y.

Data Types: `single` | `double`

## Output Arguments

collapse all

Epsilon adjustment factors for the repeated measures model `rm`, returned as a table. `tbl` contains four different adjustments for `epsilon`.

CorrectionDefinition
`Uncorrected`No adjustments, epsilon = 1
`Greenhouse-Geisser`Greenhouse-Geisser approximation
`Huynh-Feldt`Huynh-Feldt approximation
`Lower bound`Lower bound on the p-value

For details, see Compound Symmetry Assumption and Epsilon Corrections.

Data Types: `table`

## Algorithms

`ranova` computes the regular p-value (in the `pValue` column of the `rmanova` table) using the F-statistic cumulative distribution function:

p-value = 1 – fcdf(F,v1,v2).

When the compound symmetry assumption is not satisfied, `ranova` uses a correction factor epsilon, ε, to compute the corrected p-values as follows:

p-value_corrected = 1 – fcdf(F,ε*v1,ε*v2).

The `epsilon` method returns the epsilon adjustment values.

## Version History

Introduced in R2014a