eelbrain.normalize_in_cells¶
-
eelbrain.
normalize_in_cells
(y, for_dim, in_cells=None, ds=None, method='z-score')¶ Normalize data in cells to make it appropriate for ANOVA 1
- Parameters
y (
Union
[NDVar
,str
]) – Dependent variable which should be normalized.for_dim (
str
) – Dimension which will be included as factor in the ANOVA (e.g.,'sensor'
).in_cells (
Union
[Factor
,Interaction
,NestedEffect
,str
,None
]) – Model defining the cells within which to normalize (normally the factors that will be used as fixed effects in the ANOVA).ds (
Optional
[Dataset
]) – Dataset containing the data.method ('z-score' | 'range') – Method used for normalizing the data:
z-score
: for the data in each cell, subtract the mean and divide by the standard deviation (mean and standard deviation are computed after averaging across cases in each cell)range
: for the data in each cell, subtract minimum and then divide by the maximum (i.e., change the range of the data to(0, 1)
; range is computed after averaging across cases in each cell).
Notes
This method normalizes data by z-scoring. A common example is a by sensor interaction effect in EEG data. ANOVA interaction effects assume additivity, but EEG topographies depend on source strength in a multiplicative fashion, which can lead to spurious interaction effects. Normalizing in each cell of the ANOVA model controls for this (see [1] for details).
Examples
See Compare topographies.
References
- 1
McCarthy, G., & Wood, C. C. (1985). Scalp Distributions of Event-Related Potentials—An Ambiguity Associated with Analysis of Variance Models. Electroencephalography and Clinical Neurophysiology, 61, S226–S227. 10.1016/0013-4694(85)90858-2
- Return type
NDVar