Universit´e Joseph Fourier L2/STA230
Lab 8: Statistical testing with single samples
Objectives: Compute statistical testing for single samples from real data.
1 Statistical testing of the empirical mean
Exercise 1
1. Upload the dataset HER.txt. Assign BMI (body mass index) to the vector B. Give the type of variableBMI. Suggest a random variable to modelBMI.
2. Compute the summary of BMIand plot the distribution.
3. Compute a confidence interval of the expectation of BMI. Comment.
4. Test if the expectation of BMIis greater than µ0= 25, at a level 5%, assuming a known standard deviation σ= 5. Define the null and alternative hypothesis. Is it a two-tailed or one-tailed test ? Construct the decision rule to rejectH0, for a given α. Decide if H0 is rejected or not. Give the p-value. Comment.
5. Test if the expectation of BMIis greater than µ0 = 25 or not, at level 5%, assuming the standard deviation unknown with
t.test(B, mu=25, alternative="greater")
6. Repeat question 3 with µ0= 24.5 andα= 10%,5%,1%. Comment.
7. Test if the expectation of BMIis equal to 25 or not, at a level 5%. Define the null and alternative hypothesis. Is it a two-tailed or one-tailed test ? Compute the result with thet.testfunction.
8. Test if the expectation of BMIis lower than 25 or not. Define the null and alternative hypothesis.
Is it a two-tailed or one-tailed test ? Compute the result with the t.testfunction.
9. Do you think the three conclusions are coherent ? Exercise 2
1. Upload the datasetHER.txt. Assignht(height) to the vectorH.
2. Compute the summary of Hand plot the distribution.
3. Compute a confidence interval of the expectation of H. Comment.
4. Test if patients height expectation is greater than 166. Give the p-value and comment.
5. Apply this test only to girls.
6. Same question with boys. Comment.