> set.seed(100)

> x < - rt(5000,100)
> shapiro.test(x)

Shapiro-Wilk normality test

data: x

W = 0.9993, p-value = 0.04019

I disagree with your use of shapiro.test and bartlett.test to decide what statistical procedure to use. Both of these are tests _against_ the assumption in question, thus you will end up always thinking you are okay at small sample sizes and always using robust methods at large sample sizes.

Instead look at the histograms and qq-plots instead of calculating shapiro.test, and look at the sample variances instead of using bartletts.test. If you are worried by what you see, run some simulations of the procedure under the null hypothesis with the observed variances and see if the p-value distribution is sufficiently close to uniform.

]]>An other point is that you are comparing two different tests the shapiro.test and the ad.test, mainly because I suppose by using 500000 you could not use shapiro which is limited to 5000 value, however if you use the shipiro test but limit your sample size to 5000

> x shapiro.test(x)

HO is not rejected

W = 0.9997, p-value = 0.8337

I usually use both shapiro.test (Normality) and bartlett.test (Homocedasticity) and then I am able to decide whether I use an ANOVA or Kruskal_test.

I do not know much about the ad.test so I cannot comment on it.

]]>