Question: Lab - Confidence Intervals 1 PHTH 2210 Module 7 Welcome to the Lab for Module 7. In this lab we'll start learning how to create


Lab - Confidence Intervals 1 PHTH 2210 Module 7 Welcome to the Lab for Module 7. In this lab we'll start learning how to create confidence intervals using Normal- and t- distribution results. Some of the functions you may need are: pnorm(x, mean =mu,sd= sigma, lower, tail = TRUE ) This is the function to calculate the area under a normal curve where XN(,). Recall that "areas" of probability distributions correspond to probabilities. Therefore, if you specify lower.tail=TRUE, you are finding the P(Xx). pt(x,df=n1, lower tail = TRUE ) This is the function to calculate the area under a t curve where Xtdf=(n1). For this lab we will again be using the tidyverse and NHANES packages. Use library(tidyverse) and library (NHANES) to load these packages. If you receive an error, you may need to reinstall the package from the bottom right pane of the R Studio window (e.g. Packages > Install > "tidyverse") 1. In this exercise, we'll be practicing how to construct and interpret confidence intervals using the Gapminder data. Remember to load the Gapminder library first. A. Using a random sample of 25 countries from the Gapminder data, calculate and interpret a 95% confidence interval for true population average life expectancy in 2007, using a Normal distribution. What standard deviation will you use? B. Calculate the true population mean life expectancy in 2007 and determine if your interval actually contained the population parameter. C. Given that there are about 80 people in class, how many 95% confidence intervals do you expect to NOT cover the true population mean? D. From your same sample, calculate a 90% Confidence interval (using a Normal distribution) and compare the widths of the intervals. E. How many of these 90% confidence intervals do you expect to not contain the true mean. F. Calculate and interpret a 95% confidence interval for the population average life expectancy using a t-distribution. How does this interval compare to the normal distribution interval? 2. In a length of hospitalization study conducted by several cooperating hospitals, a random sample of 64 peptic ulcer patients was drawn from a list of all peptic ulcer patients ever admitted to the participating hospitals and the length of hospitalization per admission was determined for each. The mean length of hospitalization was found to be 8.25 days, and the standard deviation is 3 days. A. What is the population of interest? B. Produce and interpret a 95% confidence interval for the true population mean length of hospitalization. C. Produce and interpret a 90% confidence interval for the true population mean length of hospitalization. D. How do the widths of these intervals compare? 1 3. Diastolic blood pressure for diabetic women has a normal distribution with unknown mean and a standard deviation equal to 10mmHg. A sample of 8 diabetic women is selected and their mean DBP is calculated as 85mmHg. A. Calculate and interpret a 95% confidence interval for the true population mean diastolic blood pressure for diabetic women. B. Researchers want to know if the mean DBP of diabetic women is equal to the mean DBP among the general public, which is known to be 76mmHg. Based on your confidence interval, what would you suggest? 4. Load the babies.csv dataset in R. This data set has been posted with lab 7 in Canvas and it includes information on a sample of 100 preterm births. In this problem we will build a confidence interval for the mean birthweight of a preterm birth (birthwt). A. Calculate the sample mean birthweight. B. Since the population standard deviation for the birthweight is unknown, calculate your sample statistic, s, which estimates the population standard deviation. C. Using the information from A and B, create and interpret a 99% confidence interval for the true population mean birthweight. 5. Suppose you are interested in estimating the mean Body mass index (BMI, reported in kg/m2 ) in the NHANES population. A. Select a sample of 40 individuals who have a BMI measure recorded in the dataset and calculate and interpret the 95% confidence interval corresponding to your sample. B. Now select a sample of 100 individuals who have a BMI measure recorded in the dataset and calculate and interpret the 95% confidence interval corresponding to your sample. C. Compare the intervals from A and B. D. Calculate the actual population parameter by finding the average BMI for all NHANES participants. Do your intervals contain the true population mean