0todd0000 / spm1d

One-Dimensional Statistical Parametric Mapping in Python
GNU General Public License v3.0
61 stars 21 forks source link

Zero variance detected #121

Closed yossy-biomech closed 4 years ago

yossy-biomech commented 4 years ago

When paired t-test was used, following message was appeared.

"Zero variance detected at the following nodes:"

13 pariticipants were attended.
The participants did movements in two conditions.

When the movements in two conditions are nearly same, is the message appeared?

0todd0000 commented 4 years ago

This means that identical values appears in all observations. Usually this happens when there is a time node that has a value of zero in all observations.

To check, try computing the standard deviation of the pairwise differences:

d = yA - yB    # pairwise differences
sd = d.std(axis=0, ddof=1)   # standard deviation of the pairwise differences
print( sd )

You will likely see one or more nan values, implying that these are zero-variance nodes.

It is not possible to conduct statistical inference parametrically when there is zero variance.