STAT 1080 - Fall 2026
  • Course Info
    • Overview
    • Syllabus
    • Support
    • Schedule
    • Useful links
  • Weekly Materials
    • W1. Introduction
    • W2. RStudio
    • W3. Correlation
    • W4. Programming
    • W5. Tidyverse
    • W6. Dates/Times and Distributions
    • W7. Data Visualization
    • W8. Statistics & Probability
    • W9. Data & Probability
    • W10. Random Variables
    • W11. Parameters & Estimates
    • W12. Statistical Inference
    • W13. Regression
    • W14. Regression
    • W15. Project Meetings

On this page

  • 1 Problem
  • 2 Problem
  • 3 Problem
  • 4 Problem
  • 5 Problem
  • Report an issue

11.2.i Activity - Central Limit Theorem

Be sure to run the following code chunk before continuing with the assignment.

library(tidyverse)
library(stat1080r)

We are going to use the colleges dataset from the stat1080r package for this assignment. Run the following code to make that dataset available in your environment.

colleges <- stat1080r::colleges

This dataset contains 831 American colleges that:

  • Offer four-year degree programs
  • Have more than 2,000 students
  • Have endowments larger than $10 million

We are going to call this group the population of “large four-year schools”. Note that this population does NOT represent ALL schools of higher education in the United States, but rather the “population of interest”. We wish to explore the average endowment size of schools within this population.

1 Problem

Rarely do we have access to all the observations in our population. Normally, we must take a much smaller sample of observations to get insight into our population. However, in this case, we are able to calculate the population parameter of interest (which we will call \(\mu\)), which is the average size of a university endowment. Please use a tidyverse summarize() statement to calculate the population average endowment size. Use the endowment size at the end of the fiscal year for this calculation.

## pop_mu <- colleges |>
##   summarize(#...#) |>
##   pull(#...#)
##
## pop_mu

Note that the result is less than one, but it is NOT a proportion — it represents billions of dollars. Thus, a value of 0.5 in this context does not mean a 50% chance of “yes”, but rather means an endowment size of $500 million.

2 Problem

Remember that the expected value of a sample average is equal to the population average. This means that the expected value of a sample size of n schools will be equal to pop_mu, regardless of the value of n.

Unlike with proportions, where the standard error relies on the calculation \(\sqrt{p*(1-p)/n}\), the standard error of a sample average (when the population standard deviation (\(\sigma\)) is known) is \(\frac{\sigma}{\sqrt{n}}\). In other words, the standard error for our samples can be written in R as:

pop_sd <- colleges |>
  summarize(sd_endow = sd(endowment_end)) |>
  pull(sd_endow)

n <- 10 # replace with your sample size.

s_x <- pop_sd / sqrt(n) 
s_x
[1] 1.098603

This in mind, please calculate the standard error of the average endowment size when the sample size is 100. How large is the standard error of a sample size of 100 relative to a sample size of 10? Calculate this as a percentage. Note that sample code is provided for this calculation, assuming you assign the standard error for a sample size of 100 to the variable s_x_100.

#...#

# Code to calculate the relative difference between the two standard errors. 
## (s_x_100 / s_x) * 100

3 Problem

The provided function takes a sample of 50 colleges without replacement from the colleges dataset and calculates a sample average endowment. Using that function, please use the replicate() function to simulate 1,000 sample averages for sample sizes of 10, 100, and 200 respectively. The provided code will then let you compare histograms for the original observation and each of the sample averages.

# The argument n determines the number of colleges to sample. 
get_public_college <- function(n){
  colleges |>
    slice_sample(n = n) |> 
    summarize(mean_endow = mean(endowment_end)) |>
    pull(mean_endow)
}

set.seed(123) # set seed for reproducibility
## sample_avg_10 <- #...#
## sample_avg_100 <- #...#
## sample_avg_200 <- #...#

# Uncomment this code once you have completed lines 94-96. 
## data.frame(value = c(colleges |> pull(endowment_end), 
##                      sample_avg_10, 
##                      sample_avg_100,
##                      sample_avg_200),
##            name = c(rep("original", nrow(colleges)),
##                     rep("n = 10", length(sample_avg_10)),
##                     rep("n = 100", length(sample_avg_100)),
##                     rep("n = 200", length(sample_avg_200)))) |>
##   mutate(name = factor(name, levels = c("original", "n = 10", 
##                                         "n = 100", "n = 200"))) |>
##   ggplot(aes(x = value)) + 
##   geom_histogram(breaks = seq(0, 100, 0.1), color = "black") + 
##   coord_cartesian(xlim = c(0, 10)) + 
##   facet_wrap(~name, ncol = 1, scales = "free_y") 

Note that the x-axis scale has been restricted to omit some of the largest original values. For example, there are 15 colleges with endowments larger than 10 billion dollars that are not reflected in these histograms, with the largest endowment being $50.75 billion.

What do you notice about the shape of the histograms as the sample size increases? Please discuss this with a partner and/or write your answer below.

Replace this text with your answer. Optional if discussing in groups and required if working on your own.

4 Problem

The following code calculates the 90th percentile endowment size for schools.

pop_q90 <- colleges |>
  summarize(q90_endow = quantile(endowment_end, 0.9)) |>
  pull(q90_endow) |>
  unname()

pop_q90
[1] 1.45

Calculate the proportion of sample averages from a sample size of 100 that exceed this 90th percentile (HINT: You should be using the variable sample_avg_100 and the mean() function to answer this question).

#...#

5 Problem

Now repeat the probability calculation using the normal approximation. You should be using the expected value and standard error of a sample size of 100, along with pnorm() to answer this question.

#...#

Note that your answer highlights one of the issues with averages: when data are highly right-skewed, meaning that when you have a few observations with substantially higher values than the typical observation, the average value is not representative of the “typical” value. In this case, there is a fairly good chance that our sample average will be larger than 90% of the observed values in our dataset! Averages work best for data that are not so skewed.

© Copyright 2026, Susan Vanderplas

 
  • Report an issue