Let's look at a population of values with a normal distribution, mean = 5 and standard deviation = 1.

We draw 4 samples without replacement:

A t test for

*one sample*tests the null hypothesis that the mean μ for the population from which the sample is drawn is equal to μ

_{0}. For example it could be that we have many observations of untreated cells (from which we get μ

_{0}), and now we wish to estimate whether the mean values of treated cells are detectably different.

The argument alternative = 'two.sided' is the default, so we don't need to specify it here.

Even with only four samples and a difference in means of (6-5) / 6 the result of the t test tells us that we

*can*reject the null hypothesis that μ = μ

_{0}= 6, with p=0.018.

Now, it might have been the case that before we saw the data (and that proviso is crucial), we expected from the nature of the treatment that the mean of treated population would be less than the untreated population. In that case, we would be justified in specifying a one-sided test:

We note the p-value is:

In reality, because of biological variation (as well as unintended variation in experiment conditions) we would always include a control group for such an experiment.

Now it is much more difficult to see a result with significance. If there 25 samples in the control group we can see a difference: