5.8.6.8. scipy.stats.normaltest¶
-
scipy.stats.
normaltest
(a, axis=0, nan_policy='propagate')[source]¶ Tests whether a sample differs from a normal distribution.
This function tests the null hypothesis that a sample comes from a normal distribution. It is based on D’Agostino and Pearson’s [R421], [R422] test that combines skew and kurtosis to produce an omnibus test of normality.
Parameters: a : array_like
The array containing the data to be tested.
axis : int or None, optional
Axis along which to compute test. Default is 0. If None, compute over the whole array a.
nan_policy : {‘propagate’, ‘raise’, ‘omit’}, optional
Defines how to handle when input contains nan. ‘propagate’ returns nan, ‘raise’ throws an error, ‘omit’ performs the calculations ignoring nan values. Default is ‘propagate’.
Returns: statistic : float or array
s^2 + k^2
, wheres
is the z-score returned by skewtest andk
is the z-score returned by kurtosistest.pvalue : float or array
A 2-sided chi squared probability for the hypothesis test.
References