Thanks for providing the data. I will jump ahead and say that I'd be
uncomfortable saying, at the 5% level, that the two samples come from populations with different locations. At the 6% level, Yes. If you intended a one-sided test
that population 2 is centered above population 1, Yes at the 5% level.
So this is a case where there is not enough data to claim significant difference
of a two-sided test at the 5% level. The main difficulties are that
x1 is so
small and has four "low" values along with two "high" ones: the location of the center of its population is unclear.
In such situations, the principled course of action is no admit that there is not
quite enough data for a convincing result. If the issue at hand is of great importance,
perhaps there is enough evidence of a possible difference to warrant a second
study, perhaps with more observations.
A less-principled course of action is to 'shop around' among borderline plausible
tests until you find one that gives a P-value barely below 5%. This is a path that
has led to many published "false discoveries" that no one has been able to replicate
with an appropriately powered subsequent study.
x1 = c(0.35894, 0.38882, 0.36004, 0.37289, 0.54223, 0.50994)
x2 = c(0.44332, 0.82616, 0.65995, 0.30866, 0.36630, 0.31708, 0.83976, 0.75948, 0.45998,
0.62960, 0.87457, 0.57932, 0.68573, 0.54461, 0.76902, 0.39784, 0.99413, 0.38794)
Examining the data, I notice that even though
x1 has only six observations, it
fails a Shapiro-Wilk test of normality with P-value around 3.6%.
One should be wary of using t tests (pooled or Welch) with such a small non-normal dataset. That might suggest using a nonparametric 2-sample Wilcoxon (rank sum) test. But an assumption of a straightforward use of this test is that the two samples have
similar 'shapes', which includes having roughly equal variances. However, your
x1 obviously has
a much smaller variance than does you
stripchart(list(x1,x2), ylim=c(.5,.2.5), pch="|")
So we can use the Wilcoxon signed rank test to check for 'stochastic dominance' but not specifically for unequal medians. At the 6% level one can say that one population dominates the other. At the 3% level one can say that
x2 has significantly larger values than
This dominance is illustrated by empirical CDFs (ECDFs) of the two samples: The plot for
x2 lies (mostly) below and to the right of the plot for
plot(ecdf(x2), col="brown", main="ECDF Plots of X1 (blue) and X2 (brown)")
Other than for 'P-hacking', I find no reason to use a Welch two-sample t test, on
account of the (aggressive) non-normality of
x, mentioned above. However, for
full disclosure, here are its (significant) results:
Welch Two Sample t-test
data: x1 and x2
t = -3.0067, df = 21.159, p-value = 0.00668
true difference in means is not equal to 0
95 percent confidence interval:
mean of x mean of y
If one tries to argue that the population that produce
x1 might be normal after all, then the issue is whether it's normal with mean around 3.7 or around 5.2 (and with what variance?), and what results those scenarios might yield. We simply don't know much about population 1.
It would be difficult to argue that any one analysis of such a dataset is the correct one, and there are enough issues with your data that others may recommend alternative analyses. Possibly, different analyses may appear on this page. However, I would not want to claim a significant difference between the two populations at the 5% level based on your data.