Before the realizations of the random variables $X_1,\dots,X_n$ become known, their sample mean can be regarded as a random variable.
This statement confuses me. Can you give me an example?
Cross Validated is a question and answer site for people interested in statistics, machine learning, data analysis, data mining, and data visualization. It only takes a minute to sign up.
Sign up to join this communityBefore the realizations of the random variables $X_1,\dots,X_n$ become known, their sample mean can be regarded as a random variable.
This statement confuses me. Can you give me an example?
Without mathematical notation, and to elaborate on @dsaxton didactic comment...
In a probability "problem" (read, space) there is a random experiment. This is something that happens out there in the physical world: the tossing of a coin, the rolling of a die, or the temperature in Philadelphia in the morning. For God (sorry, just a construct to move the argument along) the experiment is not random; and it wouldn't be random for us if we could account for every single minute factor that comes into play (direction of the wind, force exerted on the die, exact material composite of the die, height reached upon tossing, acceleration,... you get the gist). But all we can do is observe.
What we observe is the outcome. And we assign (read, "map") this outcome to a numeric value in the real line. This function from the observation of something happening to the assignment of a numerical value to it is the random variable. And the map or function would be defined like this: "we look at the die, and we notice which side is facing up." Yes, kind of silly, but we could have decided to note the velocity of the die upon impacting the table - that would be a different random variable (a continuous one) on the same random experiment: rolling the die.
Now we have a the random variable defined. The actual realizations, say $1$ or $6$, are not the random variable - they are individual outcomes.
A different random variable that we can choose to define is on a sample - not a single experiment, but a group of experiments: multiple die rolls, say. We can define it as: "Note the number facing up in $5$ die rolls; add them; and divide by $5$". The sample mean.
This is another random variable - a statistic on the sample.
They are related, and when we have a realization of the group of experiments ($5$ die rolls), say, $\{5, 5, 6, 1,2\}$ the mean will be determined - no longer a random variable. I believe that is what (loose terminology aside) the sentence: "Before the realizations of the random variables $X_1,\dots,X_n$ become known, their sample mean can be regarded as a random variable" implies.
The sample mean is just a statistic tying this answer to the more rigorous post by @fcop. To quote a key passage of his/her answer:
So, to answer your question, a test statistic is a special case of a random variable. The test statistic is thus a random variable, related to the random variable from which the sample (used to compute the test statistic) was drawn.