library(tidyverse)
library(openintro)
top20actual <- read_csv("data/top20.csv")
Many of the approximately 4,500 degree-granting colleges and universities in the United States have financial endowments that generate income on behalf of their institutions. In 2024, the financial endowments of the ten wealthiest private universities were: 52.0, 41.4, 37.3, 34.1, 24.6, 22.3, 17.9, 14.8, 14.2, and 13.1 (in billion US dollars). The endowments of the ten wealthiest public universities were: 47.5, 20.4, 19.2, 19.1, 10.2, 7.9, 5.9, 5.7, 4.8, and 4.4 (also in billion US dollars).
We will be using this information from a data set of the top 20 private and public university endowments to answer the following questions and/or complete the following tasks:
head(top20actual)
dim(top20actual)
## [1] 20 2
names(top20actual)
## [1] "type" "endowment"
privatedata <- subset(top20actual$endowment, top20actual$type == "private")
publicdata <- subset(top20actual$endowment, top20actual$type == "public")
par(mfrow=c(1, 2))
# create side-by-side histogram
hist(privatedata,
main="Histogram of
Private Endowments",
xlab="Amount in Billions USD",
ylab="Frequency",
)
abline(v = mean(privatedata), col = "blue")
abline(v = median(privatedata),col = "red", lty = "dashed")
hist(publicdata,
main="Histogram of
Public Endowments",
xlab="Amount in Billions USD",
ylab="Frequency",
)
abline(v= mean(publicdata), col = "blue")
abline(v= median(publicdata), col = "red")
mean(privatedata)
## [1] 27.17
median(privatedata)
## [1] 23.45
mean(publicdata)
## [1] 14.51
median(publicdata)
## [1] 9.05
the relative endowments of the top 10 private universities have a higher mean, maximum, minimum, and median than the top 10 public universities. Between each corresponding top 10 institution, there is approximately 5-10 billion dollars of difference. The private endowments mean is 27.17 billion dollars, contrasted to public endowments of 14.51. This is a mean difference of 12.66 billion dollars, on average. The median difference is 14.4 billion dollars. The mean and median are approximate to one another in this case. The median would be a more accurate visualisation of the data. The endowments still skew slightly “top heavy” in the public universities. The lowest endowments of the top 10 public/private universities have the biggest differences.
sd(privatedata)
## [1] 13.35465
IQR(privatedata)
## [1] 20.925
range(privatedata)
## [1] 13.1 52.0
sd(publicdata)
## [1] 13.23551
IQR(publicdata)
## [1] 13.425
range(publicdata)
## [1] 4.4 47.5
The standard deviations are very similar. The range reveals that public universities have lower minimum and maximum endowments than private universities. The range does not show the skew of the data. The interquartile range shows the dispersion very well that the private endowments have a wider range, and public endowments are much narrower, 20 to 13 billion dollar contrast. This is very useful especially considering the median and measures of center, that most of the data is narrower, at a lower point, in public endowments. It also shows that most the data is wider at a higher point in private endowments.
par(mfrow=c(1, 2))
# create side-by-side boxplot
boxplot(privatedata,
main="Boxplot of
Private Endowments",
col="blue",
ylab="Billions, USD",
xlab="Private Universities")
boxplot(publicdata,
main="Boxplot of
Public Endowments",
col="red",
ylab="Billions, USD",
xlab="Public Universities")
The boxplots reveal there is a measure of center difference between public and private endowments. The span of endowments, the interquartile range, is much narrower for public universities. It also reveals that there is one particular outlier beyond the third quartile, the box, in public universities.
max(scale(privatedata))
## [1] 1.859277
min(scale(privatedata))
## [1] -1.053565
max(scale(publicdata))
## [1] 2.492537
min(scale(publicdata))
## [1] -0.7638541
a there is an outlier in the group of 10 public universities. This is also revealed by the z score of positive 2.49. One of the public universities had an endowment of 47.5 billion USD, which is 20 billion higher than the next highest value.
In this analysis, private institutions have more average endowments, higher maximum endowments, higher minimum endowments. There is a much lower median, average, maximum, and minimum of financial endowments at public universities. This implies that financial endowments are much higher at private universities. Some of these social implications may be that private universities can afford more/better equipment, and higher salaried faculty. It also may imply that there is a higher cost, and a higher economic threshold to gain acceptance. This also may be tied to generational wealth for more wealthy individuals to be able to attend, and later bestow larger endowments unto private institutions.