# The assumptions regarding the t-test

The t-test has an assumption that the sample provided has to be random in nature. Do we test our sample for randomness before carrying out the t-test ?

• @Carl Idon't get it, the Shapiro-Wilk test tests whether a sample comes from a normal distribution, not whether the observations in the sample are random? I believe that was the OP's question. Commented Dec 13, 2018 at 8:00
• I think the OP is using randomness and independence synonymously when they aren't. samples are generally random but the question to ask is whether the samples are independent. that is one assumption that the t-test uses. there are others but they vary depending on the specific t-test used and specific situation. but independence of observations is assumed no matter what the specifics. Commented Dec 13, 2018 at 8:01
• @Carl I am not talking about distributions, I am talking about random / independent observations of the sample as I believe that was the OP's question, not whether the sample comes from a normal distribution. I believe the OP is asking how to test whether the observations are drawn at random (for ex. checking correlation). Commented Dec 13, 2018 at 8:22
• One doesn't test a sample for randomness: that determination (however broadly one might conceive of "randomness") is made by understanding how the sample was obtained or by making modeling assumptions. "Randomness" and statistical distribution are completely different issues, making me concerned that the comments by @Carl may be misleading rather than clarifying.
– whuber
Commented Dec 13, 2018 at 15:28
• @whuber Too much imagination, perhaps. My mistake, I was trying to help the OP without being concerned if anyone else understands either the OP or my comment. The OP likely does not know exactly what "randomness' means in this context or the question would not have been classifiable as ambiguous by anyone, and no, it does not seem ambiguous to me. So, let's ask with a bit of prompting, "Apoorwa Srivastava, What do you mean by "randomness"? Did you mean "Some test or other to guarantee one has met the assumptions needed for assurance that the t-test has been applied correctly?"
– Carl
Commented Dec 13, 2018 at 20:19