To HomePage
One and Two-sample Tests of Hypothesis
General Comparisons Between One and Two-sample Tests
- One-sample Test Test this null hypothesis: the population mean for the treatment group is not
significantly different from known or standard value c. This is stated succintly as
The alternative hypothesis: the population mean is not equal to c or,
Example: The speed of light in a vacuum c is a well-known constant of nature. (In fact it is the same
everywhere in the universe.) Measurements of the speed of light in water are taken. Test the null hypothesis that the speed of light
in water is not significantly different than the speed of light in a vacuum.
- Paired Two-sample Test Use a paired sample test when there is a natural one-to-one pairing between the
subjects in two treatment groups. In this case, the difference scores
di = x2i - x1i can be computed and a one-sample test performed using the
null hypothesis that the mean of the difference is not significantly different than zero:
The alternative hypothesis is
Example: A sample of houses is chosen. For each house, a section is painted with a new
paint and a section is painted with a standard paint. For each house, measure the difference between the lifetime of the new paint minus
the lifetime of the standard paint. Test the null hypothesis that differences are not significantly different than zero.
- Independent Two-sample Test Use the independent two-sample test when there is not a natural one-to-one pairing
between the subjects in two treatment groups. The null hypothesis that the population means of the two groups are not significantly
different:
The alternative hypothesis is
Example: A gasoline additive is supposed to reduce the amount of carbon monoxide in automobile exhaust.
A sample of automobiles are chosen. Half of them are given the additive; half of them are not. Test the null hypothesis that the amount
of CO in the exhaust is not significantly different for the cars with the additive than it is for the cars without the additive.
General Comparisons Between z and t-tests
- When statistics books present tests of hypothesis to students in a first
statistics class, they start with the one-sample z-test for simplicity.
- The z-test uses the test statistic
- If the sample size n is large (n ≥ 30),
the central limit theorem says that x is approximately normally distributed, even if the original population is not.
the estimated standard error sx / √n
of x is close to the true standard error σx / √n of
x.
The expected value of z is then 0, and the variance of z is 1, so we can use the standard normal table to find confidence intervals
and p-values for z.
- If the sample size is small (n ≤ 30), the situation is more complicated. In this case, we use a t-test, which makes the assumption
that the original population is approximately normally distributed, so that the test statistic
has a t-distribution with n - 1 degrees of freedom.
Descriptions of Tests for One or Two Samples with Examples
- Here are six commonly used tests of hypothesis. Follow each link for details and a sample problem.
-
One-sample z-test
Experimental Design: The sample forms a single treatment group.
H0: The population mean of the treatment group is not significantly different from a given constant.
Population Distribution: Arbitrary.
Sample Size: n > 30
SAS and R Examples: Bones
Detailed description of one-sample z-test with sample problem.
-
One-sample t-test
Experimental Design: The sample forms a single treatment group.
H0: The population mean of the treatment group is not significantly different from a given constant.
Population Distribution: Close to normal.
Sample Size: Arbitrary.
SAS and R Examples: CO
Detailed description of one-sample t-test with sample problem.
-
Paired-sample z-test
Experimental Design: There is no natural pairing between subjects in the two groups.
H0: The mean of the sample differences is not significantly different from 0.
Population Distribution: Arbitrary.
Sample Size: n ≥ 30 for both groups.
Detailed description of paired two-sample z-test with sample problem.
-
Paired-sample t-test
Experimental Design: There is no natural pairing between subjects in the two groups.
H0: The mean of the sample differences is not significantly different from 0.
Population Distribution: Approximately normal within each group.
Sample Size: Arbitrary for both groups.
SAS and R Examples: ReadingPaired
Detailed description of paired two-sample t-test with sample problem.
-
Independent Two-sample z-test
Experimental Design: There is no natural pairing between subjects in the two groups.
H0: The population means of two groups are not significantly different.
Population Distribution: Arbitrary.
Sample Size: Total sample size for both groups ≥ 30
Detailed description of independent two-sample z-test with sample problem.
-
Independent Two-sample t-test
Experimental Design: There is no natural pairing between subjects in the two groups.
H0: The population means of two groups are not significantly different.
Population Distribution: Both groups are approximately normal.
Sample Size: Arbitrary for both groups.
SAS and R Examples: ReadingIndep
Detailed description of independent two-sample t-test with example problem.