Application of the Central Limit Theorem

Introduction and Method

As part o fthe NHANES study, the triglyceride levels of 3026 adult women were measured. Triglycerides, the main constiuent of both vegetable and animal fat, have been linked to atherosclerosis, heart disease, and stroke. Let’s considers this whole group of women the population for the purposes of the simulation. We are going to conduct a study of this population by taking a small sample, say of 25 women, from it. We will compare the distribution of triglycerides in our population and in the sample:

 lipids <- read.delim("http://myweb.uiowa.edu/pbreheny/data/lipids.txt")
pop <- lipids$TRG #define population as pop (lipids data set, TRG variable)
sam <- sample(pop, 25) #define sample
hist(pop, col="gray", border="white", breaks=seq(0, 400, length=99), main = "Population Distribution of Triglyeride Levels", xlab = "mg/dL" )  #histogram of the population

summary(pop) #summary statistics for pop
##    Min. 1st Qu.  Median    Mean 3rd Qu.    Max. 
##    19.0    68.0    98.0   116.9   147.0   399.0

Population distribution

The distribution of triglyceride levels for 3026 women is unimodal and skewed right. The center of the distribution is 98 mg/dL. The middle 50% of women have levels of 68 mg/dL and 147 mg/dL. Normal triglyceride levels are below 150 mg/dL, so almost 25% of the population has high levels of triglycerides.

Taking One Sample from the Population

hist(sam, col="gray", border= "white", breaks= seq(0, 400, length = 10), main = "Distribution of Single Sample of 25 Women", xlab = "mg/dL")  #histogram of one sample of 25 women

summary(sam) #summary of the one sample
##    Min. 1st Qu.  Median    Mean 3rd Qu.    Max. 
##    28.0    63.0    81.0   103.6   135.0   251.0

Sample Distribution

The single sample of women drawn from the population is unimodal and skewed right.The center is at 110 mg/dL and the range is from 33-352 mg/dL. According to the outlier rule: There is at least one high outlier. In addition, there is a gap in the data, making 4 measures in the sample seem extreme.

mean(pop) #population mean
## [1] 116.9451
mean(sam) #sample mean
## [1] 103.64
sd(pop)   #population std deviation
## [1] 67.94322

The mean of the sample (130.16 mg/dL) is higher than that of the population (116.95 mg/dL)

It is worth noting that (a) the distribution of tryglycerides in the population is clearly right-skewed, (b) the sample looks representative of the population as it should because it is representative, and (c) the sample means are close, but the sample mean is clearly off a bit in terms of estimating a population mean.

This is just one sample; the means of others randomm samples might be much further or closer to the population mean. To see that distribution, we’ll have to repeat the sampling process many times and obtain sample means.

Using a Loop

TRGmeans<- rep(0, 100)
for (i in 1:100) {
  sam <- sample(pop, 25)
  TRGmeans[i] <- mean(sam)
}                             #running a loop, 100 samples of 25 with mean calculated for each. Vector is called TRFG means
hist(TRGmeans, col= "gray", border = "white", breaks = seq(0, 400, length = 99), main = "Distribution of 100 sample Means", xlab = "sample mean mg/dL")   #histogram of 100 sample means

summary(TRGmeans)
##    Min. 1st Qu.  Median    Mean 3rd Qu.    Max. 
##    80.6   106.7   114.1   115.3   122.0   149.6

Describing the Distribution of 100 Sample Means

The distribution of mean triglyceride levels created from 100 samples of 25 randomly-selected women in the NHANES study is approximately Normal with a mean of 116 mg/dL.

Applying the Normal Model to Sampling Distribution of Sample Means

The distribution of 100 sample means is unimodal and approximately symmetric without any outliers. Therefore, we can model the distribution with a mean at population mean of 117 mg/dL and a standard error of the population standard deviation of 68, divided by the sq root of sample size (n= 25). This computation is shown in the code below

SD<-sd(pop)        #assigning SD for sd deviation of pop
SE <- SD/sqrt(25)  #calculating standard error for sampling                              distribution
sd(TRGmeans)       #calculating std deviation of 100 sample mean
## [1] 12.93831
print(SE)          #show result of SE
## [1] 13.58864
mean(TRGmeans) 
## [1] 115.256

Our model

The sampling distribution of the sample means of triglyceride levels is approximately Normal with a mean of about 117 mg/dL and a standard error of 13.6 mg/dL

Modeling the Distribution with Z-scores

Defining the z-score formula to suit the sampling distribution of the means from above will give us the following code:

z<- (TRGmeans - mean(pop))/SE  #defining z score based on sampling distribution centered at population mean with standard error dependent on sample size
hist(z, col="gray", border = "white", freq=FALSE, breaks = 15, main="Histogram of z scores for Triglyceride Levels")
zz<-seq(-3, 3, length =101)
lines(zz, dnorm(zz))  #histogram of z scores with Normal curve overlay

Using the relative distribution of means to calculate probabilities based on z scores

So, though not a perfect Normal Model, the approximation seems pretty good. Given this, we can make some distributional predictions of sample means of triglyceride levels for sample of 25 women. Remember, this is not a prediction of an individual woman’s triglyceride level and its relation to the mean of the population. Instead it is the probability of the mean of a sample of 25 and how it relates to the mean of the sampling distribution. Note: individual data is more likely to be deviant from a population mean than a sample’s mean is to be deviant from the mean of a sampling distribution. We can use this information for inference testing.

Probability that a sample mean is less than 100 mg/dL if true mean is 117

pnorm(100, mean(pop), SE) #calculating probability of a sample mean less than 100
## [1] 0.1061973

There is a 10.6% chance that a sample mean will be less than 100 if the true mean is 117.

The sample mean triglyceride level representing the 90th percentile - top 10%

qnorm(0.9, mean(pop), SE) #The 90th percentile or top 10% of sample means
## [1] 134.3597

A sample mean triglyceride level of 134.3597 mg/dL represents the cut-off for the top 10%.

The middle 50% of sample means of triglyceride levels vs the middle 50% of the population’s triglyceride levels.

IQR <- qnorm(0.75, mean(pop), SE) - qnorm(0.25, mean(pop), SE)
print(IQR) #IQR of sample means
## [1] 18.3308
IQRpop <- qnorm(0.75, mean(pop),SD)- qnorm(0.25, mean(pop), SD)
print(IQRpop) #IQR of population distribution
## [1] 91.65401

The middle 50% of sample means of triglyceride levels only vary by 18.33 mg/dL, while the population’s middle 50% (by individual) varies by 91.65 mg/dL. This confirms the Central Limit Theorem - sample means will be more Normal and less variable as sample size increases.

Would it be unusual for a sample mean to be greater than 140 mg/dL? Would it be unusual for an individual to have a triglyceride level greater than 140 mg/dL?

pnorm(140, mean(pop), SE, lower.tail = FALSE) #probability sample mean is greater than 140
## [1] 0.04488361
pnorm(140, mean (pop), SD, lower.tail = FALSE) #probability for an individual to have a triglyceride level over 140
## [1] 0.3671823

It would be highly unusual to see a sample mean greater 140 mg/dL. We would only expect to see this mean 4.5% of the time. However, seeing an individual above 140 mg/dL is much more likely. We would see this result 36.7% of the time.

Application - A new medication is undergoing experimental trials. The experimental group taking the medication has an average triglyceride level of 95 mg/dL. Is this evidence that the experimental medication is effective at lowering triglyceride levels in women?

The Hypotheses:

Null Hypothesis:

mean = 117. The average triglyceride level is 117 mg/dL

Alternative Hypothesis: mean < 117. The average triglyceride level is less than 117 mg/dL

pnorm(97, mean(pop), SE)
## [1] 0.07108196

Conclusion:

Though the difference is considerable. We expect to see a sample mean of 97 mg/dL 7.1% of the time. This is higher than the standard significance level of 5%, so we RETAIN THE NULL. There is not enough evidence that the experimental drug lower triglyceride levels in women.