# T test and P value [duplicate]

Possible Duplicate:
What is the meaning of p values and t values in statistical tests?

I currently start epidemiology class, I am very confuse of p value and t test, what do they mean? how to use them ? can anyone explain the differences between these two values in specific case. Thank you in advance

• Have you done any research towards answering your question? Wikipedia? A search of our site? At what point have you encountered difficulties understanding? – whuber Sep 21 '12 at 22:42

This is a very elementary and basic statistics question and you could find good explanations in so many places. But I think a short and sweet answer can be given. So I will attempt it. In the simplest case a t test is used to test that a sample has a mean of zero for the population the sample was drawn. The distirbution theory applies when the samples have a normal distribution with an unknown variance. The variance can be estimated from the data. If you take a sample of size n and the population mean were truly 0 the mean divided by the sample variance. The statistic you get by dividing the estimate of the mean by the sample standard deviation will have what is called a Student t distribution with a parameter n-1 that is called the degrees of freedom. It will have a distribution that looks like a normal distribution but has a wider spread. Its distribution was discovered by Gosset (I think around 1911). He published his result using the pseudonym Student and that is how it got named Student's t. Gosset guessed at the distribution by finding a distribution in one of Karl Pearson's family of parametric distributions. Amazingly it was exactly the right distribution which R. A. Fisher proved some years later.

When we do this one sample test formally we use the tables of the distribution to find the points in the tails of the t distribution where the probability is small. We pick a value T$_0$ called the critical value, such that if the test statistic is bigger than T$_0$ or less than -T$_0$ the probability is small. That is to say that the area under the density function for the t distribution from -∞ to -T$_0$ plus the area from T$_0$ to +∞ is eual to a small value α. The quantity represents the probability that a value in the integrated region would be obtained for the observed T statistic when the population mean is actually 0. Small values for α that are commonly used are 0.1, 0.05 and 0.01 with 0.05 taken most often in practice (just by custom). Because getting a value of T greater then T$_0$ or smaller than -T$_0$ we reject the notion that the mean is 0. If the true mean were actually 0, this procedure would lead to an error in only 100 α % of the cases.

That is the basics of the T statistic and hypothesis testing for a mean in a nutshell. Now we are ready to explain the p-value. Suppose we get a t statistic that is greater than 5 T$_0$. We will of course reject the null hypothesis but there is more information that we can give to this result. we can compute the area beyond

5 T$_0$ plus the area below -5 T$_0$ for our t distribution. This probability is called the p-value. It can be interpreted as the percentage of of cases when you repeat the sampling procedure many time that when the population mean is truly 0 you would observe a value as extreme or more extreme in absolute value than your observe t statistic (which in the example would be 5 T$_0$). Note the important distinction. The observed test statistic is a number that we compare to other possible numbers. The p-value is a probability that something more extreme in absolute value could have been observed (under the null hypothesis). When the test statistic is very large the p-value would be very small and any p-value less than or equal to α would lead to rejection of the null hypothesis.

This is the basic idea. There is a lot more to hypothesis testing and it can get more complicated (two or more samples instead of just one, one-sided testing instead of two,equivalence of two treatments instead of superiority of one over the other etc.)

You can compute p-values for one-sided tests giving it a slightly diferent definition. The t test applies only in special circumstances (testing a mean or mean difference when the data have normal distributions or close approximations to the normal). Books have been written on this. This is a long enough answer. Now you should be able to read up and learn the rest on your own with the help of your text and instructor.

The t-test is a method of answering the question, "What is the probability the data looks as it does if the true mean equals the hypothesized value?" The t-test does two things. First, it lets you avoid having to know calculus. Second, it rescales the problem so that there is one answer to the question rather than an infinite number of answers.

There are several variants of the t-test, depending on what you want to be able to do. It is actually one of the more robust tests out there in that it can be used for a wider variety of purposes than most people think about.

The t-test itself does exactly what integral calculus does, it tells you how much area is under a curve over an interval. You look up the value from the t-test and it gives you the area from 0 to 1. That area is the p-value. The value from the t-test is a rescaling of the problem from the observed values to a standard value that you can use a table to look up the solution.

The p-value is the probability that the hypothesis you tested is false. What makes the p-value important is that it is the method you can know something is false. Do you have a belief about the world that can be tested as false, if so this is one way to do it.

Prior to doing the experiment, you need to decide what p-value you will accept. For example, if you do not trust your data then you will set a very high p-value. Likewise, if it is not very important you can set a low p-value. A p-value is the probability that the data would have aligned itself as it did actually happen, if you were correct about the way the world works. Custom usually sets p-values, which is rather unfortunate. There is a trade off between false positives and false negatives.

The t-test tells you the p-value by using that value to look up the p-value in a table.

Remember, the purpose of the t-test is to tell you the probability(data|hypothesis). It does not tell you the probability(hypothesis|data). The p-value is the probability the data is as it is if you understand the world correctly.

There is a different branch of statistics, which you will not learn in this course, which studies the opposite question. Bayesian statistics studies, "what is the probability the hypothesis is true given the data is as it is?" Most people actually want the second question answered and not the first. Most disciplines tend to use the long run frequency based methods for reasons that are beyond the scope of this first course you are taking.

A low p-value say 5% would mean that there is a 5% probability that the data could look like this, if your understanding of the world is correct.