12

In R, the shapiro.test() function cannot run if the sample size exceeds 5000.

shapiro.test(rnorm(10^4))

Why is it so ? Can I overpass this limitation ?

Ben Bolker
  • 211,554
  • 25
  • 370
  • 453
Remi.b
  • 17,389
  • 28
  • 87
  • 168
  • 4
    You should read [**this post**](http://stackoverflow.com/questions/15427692/perform-a-shapiro-wilk-normality-test/15427746#15427746) – Arun Jun 15 '13 at 16:10

1 Answers1

19

This is a safety limitation. Please read this: Perform a Shapiro-Wilk Normality Test

Other tests of normality do not have this limitation such as the Kolmogorov-Smirnov test:

ks.test(x=rnorm(10^4),y='pnorm',alternative='two.sided')
Peter O.
  • 32,158
  • 14
  • 82
  • 96
Remi.b
  • 17,389
  • 28
  • 87
  • 168
  • This works, but I watched someone doing a live code and they passed `shapiro.test()` with 9500 values, I do not know how they did it. – Daniel_j_iii Jul 16 '20 at 19:57