[R] Normal tests disagree?
GlenB
glnbrntt at gmail.com
Thu Dec 3 09:50:20 CET 2009
rkevinburton wrote:
>
> If I have data that I feed into shapio.test and jarque.bera.test yet they
> seem to disagree. What do I use for a decision?
>
> For my data set I have p.value of 0.05496421 returned from the
> shapiro.test and 0.882027 returned from the jarque.bera.test. I have
> included the data set below.
>
The explanation is quite simple - different tests for normality concentrate
on different aspects of nonnormality and so are sensitive to different kinds
of departures from it.
Your sample is distinctly non-normal looking, but in a way that the
jarque-bera test is insensitive to (the sample skewness and kurtosis are
entirely unremarkable, being well within the typical range of values from a
normal sample). However, the shapiro-wilk test is quite sensitive to this
form of departure form normality.
To see what's going on, do:
(i) a density plot of your data via plot(density(x)). In particular note
that second mode in the upper tail.
(ii) a qq-plot. The departure from linearity evident in the upper right is
caused by that mode. shapiro test sees this nonlinearity (the
shapiro-francia, an approximation to the shapiro wilk, is a function of the
squared correlation of the two variables in this plot).
(iii) compute sample skewness and kurtosis and their standard errors (the JB
combines these into a single measure); formulas easily found via google
search. They're both close to the middle of their distribution for sampling
from a normal with n=59.
Glen
--
View this message in context: http://n4.nabble.com/Normal-tests-disagree-tp932615p947452.html
Sent from the R help mailing list archive at Nabble.com.
More information about the R-help
mailing list