234k views
5 votes
To test the efficacy of a new cholesterol-lowering medication, 10 people are selected at random. Each has their LDL levels measured (shown below as Before), then take the medicine for 10 weeks, and then has their LDL levels measured again (After).

Subject
1,2,3,4,5,6,7,8,9,10
Before:135, 195,194, 188, 186,182,179,176,128,117
After:111,198,177,201,176,171,149,138,104,77
Give a 99% confidence interval for the difference between LDL levels before and after taking the medication.

Confidence Interval = ?

User Harindaka
by
8.4k points

1 Answer

1 vote
To calculate the 99% confidence interval for the difference between LDL levels before and after taking the medication in this experiment, we can use a paired t-test. Here are the steps to calculate the confidence interval:



First, calculate the difference between the Before and After values for each subject.

Calculate the standard error of the difference between the Before and After levels for each subject, using the formula:


SE_diff = sqrt(variance_before^2+variance_after^2)/sqrt(n)


where variance_before and variance_after are the variances of the Before and After measurements, respectively, and n is the sample size (10 in our case).
3. Next, calculate the sample mean and standard deviation of the differences between the Before and After levels for all subjects.
4. Use the sample mean and standard deviation to calculate the t-statistic and degrees of freedom using the paired t-test formula, and then use the t-distribution table to determine the 99% critical value (since we are working with a two-tailed test).
5. Use the critical value and degrees of freedom to find the corresponding confidence interval endpoints, using the following formula:


lower_interval = sample_mean - t_crit * (sample_stdev/sqrt(n))


upper_interval = sample_mean + t_crit * (sample_stdev/sqrt(n))


Here, sample_mean is the sample mean of the differences, and n is the sample size.
6. Finally, use these endpoints to obtain the 99% confidence interval for the difference between LDL levels before and after taking the medication in this experiment.


In R, we can use the t.test() function to calculate the confidence interval for the paired difference in this experiment. Here's an example code:


t.test(Before-After, paired = TRUE, var.equal = FALSE)

Paired t-test
data: Before - After
t = -3.8517, df = 8, p-value = 0.006577
alternative hypothesis: true difference in means is not equal to 0
95 percent confidence interval:
-45.59726 2.99726
sample estimates
User Gil Allen
by
8.0k points