Does anyone know a good way or test to check the independence of observation assumption? I need to check this assumption, for example, when running an ANOVA or a t-test, and I usually use Rachas, but I don't think it's the best way.
My design did not involve any matching (the groups were independent) , but it did not have random assignment to the groups and so I wanted to check statistically this assumption.
Well, if you systematically assigned observations to the groups, then there is no point to test independence. Moreover, ANOVA is only valid if your data follows a normal distribution. Otherwise, Kruskal-Wallis is the non-parametric alternative and you will not need to worry about independence of observations in groups.
In the 4th edition of Applied Nonparametric Statistical Methods, Professor Sprent and I introduced a simple method for investigating whether or not a data set might contain non-independent observations based on the runs test for multiple samples. This is described in ANSM4 Section 7.6.2 and illustrated in Example 7.9 (pp. 217-219).