Universit´e Joseph Fourier L2/STA230
TP6: Statistical tests based on two samples
The objective of this lecture is to realize several standard statistical tests based on two samples. First, we consider two independent samples; then the case of two paired samples.
1 Comparison tests from two independent samples
1. Open the data “BB.csv”. We work on the baby’s weight bwt. We want to compare the weights when the mothers smoke or not.
2. Extract the two samples of the baby’s weight for the two populations smokers and non-smokers.
3. Introduce random variables to describe the variable weight and the two samples.
What are the unknown parameters ?
4. First, we test if the two variances are equal in the two populations (a) Define the null and alternative hypotheses.
(b) What is the name of this test ?
(c) What is the statistic used for this test ? What is its distribution under H0 ? Under H1 ?
(d) Describe the decision rule to reject H0, corresponding to a first kind risk α.
(e) Application to the real data. Compute the quantity involved in the decision rule.
(f) Decide if H0 is rejected or not with your data.
(g) Compute the p-value.
5. Now, we want to test if the expectation parameters of the weight are the same in the two populations (smokers and non-smokers).
(a) Define the null and alternative hypotheses.
(b) What is the name of this test ?
(c) What is the statistic used for this test ? What is its distribution under H0 ? Under H1 ?
(d) Describe the decision rule to reject H0, corresponding to a first kind risk α.
(e) Application to the real data. Compute the quantity involved in the decision rule.
(f) Decide if H0 is rejected or not with your data.
(g) Compute the p-value.
2 Comparison tests from two paired samples
1. Open the data ”secretin.csv”. This study contains data from a glucose response experiment. Secretin is a hormone of the duodenal mucous membrane. An extract was administered to patients with arterial hypertension. Double registrations of blood glucose were quantified for each patient with two different determination tools.
2. We want to answer the question ”Is there a difference between the two registrations
?” We construct a statistic test withtwo paired samples. Each patient is described by two variables (first and second registrations of blood glucose). We compare the behavior of these two variables within the same population.
3. For each patient, compute the difference between the two registrations. Let us denoteDthis variable. We assume thatDis normally distributed, with expectation µD and variance σ2D.
4. Estimate the expectation and the variance parameters.
5. Construct the test of comparison.
(a) Define the null and alternative hypotheses.
(b) What standard test can be used ?
(c) Application to the real data. Compute the quantity involved in the decision rule.
(d) Decide if H0 is rejected or not with your data.
(e) Compute the p-value.
2