Midwest Colleges with High Default Rates
Midwest Colleges with High Default Rates
The <- operator is used to store values. For example, x<-10 stores the value of 10 in
x , meaning the value 10 is saved in the object x .
To get a quick view of the dataframe ( dat ), we can use the head command to print
out its first several rows.
In [11]: ## Run this code but do not edit it. Hit Ctrl+Enter to run the code
# This command prints out the first several rows of the dataset
head(dat)
The horizontal rows of the dataframe are called observations . For example, the first
observation is Alabama A & M University , which is located in AL (Alabama), in
the city of Normal , and has a median student debt of $15,250 . For this dataframe,
each observation describes a specific college.
1.1 - Of the variables displayed, identify one that is quantitative, one that is
categorical, and one that is a unique identifier.
4435 · 26
Check yourself: Your code should have printed out two numbers: 4435 and 26.
The first number outputted by dim is the number of horizontal rows in the dataframe.
This represents the number of observations (number of colleges). The second number is
the number of vertical columns in the dataframe. This represents the number of
variables. What are all these variables? See the description of the dataset below, along
with links to descriptions of all the variables.
The Dataset
General description - The US Department of Education's College Scorecard
Database shows various metrics of cost, enrollment, size, student debt, student
demographics, and alumni success. It describes almost every University, college,
community college, trade school, and certificate program in the United States. The
data is current as of the 2020-2021 school year.
Description of all variables: See here
Detailed data file description: See here
With such a large dataset, to make your life easier, you may want to work with only a few
variables at a time. In the following code, we use the select command to select only
the variables name , median_debt , ownership , admit_rate , and hbcu and
save them in a new dataframe called example_dat .
In [13]: ## Run this code but do not edit it
# Select certain columns from dat, store into example_dat
example_dat <- select(dat, name, median_debt, ownership, admit_rate, hbcu)
A [Link]: 6 × 5
name median_debt ownership admit_rate hbcu
<chr> <dbl> <chr> <dbl> <chr>
1 Alabama A & M University 15.250 Public 89.65 Yes
2 University of Alabama at 15.085 Public 80.60 No
Birmingham
3 Amridge University 10.984 Private NA No
nonprofit
4 University of Alabama in Huntsville 14.000 Public 77.11 No
5 Alabama State University 17.500 Public 98.88 Yes
6 The University of Alabama 17.671 Public 80.39 No
A [Link]: 6 × 5
name region default_rate ownership pct_PELL
<chr> <chr> <dbl> <chr> <dbl>
1 Alabama A & M University South 12.1 Public 70.95
2 University of Alabama at South 4.8 Public 33.97
Birmingham
3 Amridge University South 12.9 Private 74.52
nonprofit
4 University of Alabama in Huntsville South 4.7 Public 24.03
5 Alabama State University South 12.8 Public 73.68
6 The University of Alabama South 4.0 Public 17.18
In addition to filtering out columns (variables), we can also filter out rows (observations).
For example, if I only wanted to analyze colleges that are HBCUs and that have an
admissions rate below than 40%, I can use the subset command on example_dat
like this:
A [Link]: 7 × 5
name median_debt ownership admit_rate hbcu
<chr> <dbl> <chr> <dbl> <chr>
461 Delaware State University 18.264 Public 39.34 Yes
473 Howard University 19.500 Private 38.64 Yes
nonprofit
491 Florida Agricultural and 18.750 Public 32.98 Yes
Mechanical University
503 Florida Memorial University 17.155 Private 38.41 Yes
nonprofit
1376 Alcorn State University 16.895 Public 37.72 Yes
1401 Rust College 11.226 Private 29.47 Yes
nonprofit
2747 Hampton University 18.500 Private 36.00 Yes
nonprofit
A total of 7 colleges fit these conditions.
Note that R has different conventions for comparative statements. For example...
== means equals exactly
!= means does not equal
< means less than
> means greater than
<= means less than or equal to
>= means greater than or equal to
1.4 - Use the subset command to find the colleges in my_dat that are located in
the Midwest region of the United States and have more than a third of their
students (greater than 33%) default on their loans.
In [16]: # Your code goes here
subset(my_dat, region=="Midwest" & default_rate>33)
A [Link]: 2 × 5
name region default_rate ownership pct_PELL
<chr> <chr> <dbl> <chr> <dbl>
815 West Michigan College of Midwest 34.4 Private for- 42.47
Barbering and Beauty profit
4382 Kenny's Academy of Barbering Midwest 44.4 Private for- 72.33
profit
Check yourself: You should find that 2 schools match your selection criteria.
1.5 - What do you notice about the observations that fit your selection criteria? What
do you wonder?
Double-click to type a response:
Suppose you're interested in a particular college, such as Howard University. We can use
the subset command to filter the example_dat dataframe and focus solely on the
information pertaining to that college.
In [17]: ## Run this code but do not edit it
# Subset example_dat to only show Howard University
subset(example_dat, name == "Howard University")
A [Link]: 1 × 5
name median_debt ownership admit_rate hbcu
<chr> <dbl> <chr> <dbl> <chr>
473 Howard University 19.5 Private nonprofit 38.64 Yes
1.6 - Select a college that interests you. Then use the subset command to locate
and extract information about the college from my_dat . Note: The exact spelling of
the names of all the colleges in the dataset can be found here.
In [18]: # Your code goes here
subset(my_dat, name=="Amridge University")
A [Link]: 1 × 5
name region default_rate ownership pct_PELL
<chr> <chr> <dbl> <chr> <dbl>
3 Amridge University South 12.9 Private nonprofit 74.52
One further way to explore a dataset is to reorder its observations. For example, we can
use the arrange command to order the colleges in example_dat by their admission
rate:
In [14]: ## Run this code but do not edit it
# Arrange data in order of their admission rates
arrange(example_dat, admit_rate)
A [Link]: 4435 × 5
name median_debt ownership admit_rate hbcu
<chr> <dbl> <chr> <dbl> <chr>
Curtis Institute of Music 16.250 Private 2.44 No
nonprofit
Harvard University 12.072 Private 5.01 No
nonprofit
Stanford University 11.000 Private 5.19 No
nonprofit
Princeton University 10.355 Private 5.63 No
nonprofit
Yale University 12.000 Private 6.53 No
nonprofit
Columbia University in the City of New 19.250 Private 6.66 No
York nonprofit
California Institute of Technology 9.867 Private 6.69 No
nonprofit
Massachusetts Institute of Technology 12.000 Private 7.26 No
nonprofit
University of Chicago 13.000 Private 7.31 No
nonprofit
The Juilliard School 25.000 Private 7.64 No
nonprofit
Brown University 12.000 Private 7.67 No
nonprofit
Duke University 12.500 Private 7.74 No
nonprofit
Pomona College 10.000 Private 8.62 No
nonprofit
University of Pennsylvania 14.000 Private 8.98 No
nonprofit
Swarthmore College 14.000 Private 9.06 No
nonprofit
Bowdoin College 14.000 Private 9.16 No
nonprofit
Dartmouth College 14.500 Private 9.22 No
nonprofit
Northwestern University 14.000 Private 9.31 No
nonprofit
Colby College 17.500 Private 10.27 No
nonprofit
A [Link]: 4435 × 5
name median_debt ownership admit_rate hbcu
<chr> <dbl> <chr> <dbl> <chr>
University of Arkansas Community 6.250 Public 100 No
College-Morrilton
Design Institute of San Diego 31.000 Privateprofit
for- 100 No
Naropa University Private
16.390 nonprofit 100 No
VanderCook College of Music Private
27.000 nonprofit 100 No
Saint Elizabeth School of Nursing Private
20.291 nonprofit 100 No
Maharishi International University Private
13.085 nonprofit 100 No
Grace Christian University Private
9.708 nonprofit 100 No
Sacred Heart Major Seminary Private
7.343 nonprofit 100 No
JFK Muhlenberg Harold B. and Dorothy Private
15.750 nonprofit 100 No
A. Snyder Schools
Arnot Ogden Medical Center Private
11.744 nonprofit 100 No
Neighborhood Playhouse School of the Private
12.000 nonprofit 100 No
Theater
Samaritan Hospital School of Nursing Private
14.250 nonprofit 100 No
Trinity Bible College and Graduate Private
12.835 nonprofit 100 No
School
Trinity Health System School of Nursing Private
13.625 nonprofit 100 No
Warner Pacific University Private
24.382 nonprofit 100 No
New Castle School of Trades 8.729 Privateprofit
for- 100 No
Saint Charles Borromeo Seminary- Private
16.500 nonprofit 100 No
Overbrook
Universidad Adventista de las Antillas Private
11.850 nonprofit 100 No
Greene County Career and Technology 16.325 Public 100 No
Center
1.7 - Use the arrange command to organize the colleges in my_dat such that the
colleges with the highest student loan default rates are at the top.
In [20]: # Your code goes here
arrange(my_dat, desc(default_rate))
A [Link]: 4435 × 5
name region default_rate ownership pct_PELL
<chr> <chr> <dbl> <chr> <dbl>
Tomorrow's Image Barber And South 57.1 Private for- 88.89
Beauty Academy of Virginia profit
Bull City Durham Beauty and South 57.1 Private for- 53.33
Barber College profit
No Grease Barber School South 57.1 Private for- 94.12
profit
Barber Institute of Texas Rockies & 56.4 Private for- 100.00
Southwest profit
Natural Images Beauty College Rockies & 53.1 Private for- 56.79
Southwest profit
Nuvani Institute Rockies & 51.6 Private for- 96.55
Southwest profit
B-Unique Beauty and Barber South 48.4 Private for- 62.50
Academy profit
Kenny's Academy of Barbering Midwest 44.4 Private for- 72.33
profit
Louisiana Academy of Beauty South 43.7 Private for- 15.00
profit
Denmark Technical College South 43.1 Public 47.82
Vibe Barber College South 41.1 Private for- 78.31
profit
Champ's Barber School Northeast 40.0 Private for- 92.11
profit
Bennett Career Institute Northeast 39.7 Private for- 45.75
profit
Bos-Man's Barber College South 38.2 Private for- 100.00
profit
Virginia University of Lynchburg South 35.7 Private
nonprofit 89.08
Lane College South 34.5 Private 87.13
nonprofit
Jacksonville College-Main Campus Rockies & 34.5 Private 34.87
Southwest nonprofit
West Michigan College of Midwest 34.4 Private for- 42.47
Barbering and Beauty profit
Barber Tech Academy South 34.1 Private for- 60.71
profit
1.8 - What patterns do you notice among the programs that have the highest student
loan default rates? What do you wonder?
Double-click to type a response:
Reference Guide for R (student resource) - Now that you've seen a number of
different commands in R, check out our reference guide for a full listing of useful R
commands for this project.
A few interesting facts about admit_rate that are revealed by this summary:
As expected, no schools have a 0% admissions rate (the minimum admissions rate
is 2.4%).
The maximum admissions rate was 100%. So, there's at least one school that
admits every applicant.
The first quartile (Q1) is a 59.79% admissions rate. This means only 25% of
schools have admissions rates lower than 59.79%.
For 2,731 schools, we have missing data. R uses the sybmol NA to represent
missing values. If we use admit_rate in future analyses, we should pay
attention to which schools have missing data and, ideally, investigate why their
data is missing.
2.1 - Use the summary command to get summary statistics for the
default_rate variable in the dat dataframe.
In [22… # Your code goes here
summary(dat$default_rate)
1464 of the institutions in our dataset are Universities that offer graduate degrees. On
the other end of the spectrum, 1374 of the institutions aren't Universities at all. Rather,
they are career-oriented programs that offer trade certificates.
To get a better sense of scale, we can turn these raw counts into proportions by
dividing them by the total:
In [24… ## Run this code but do not edit it
# Sum all counts in table, store in object 'total'
total <- sum(degree_counts)
4435
In [25… ## Run this code but do not edit it
# Divide the table by the total to get proportions
degree_counts / total
As you can see, you can use R just like a calculator. Addition, subtraction,
multiplication, division ... it's all there. Universities offering graduate degrees make up
about 33% of the institutions in our dataset. These are about three times more
prevalent than 4-year colleges (Bachelors) that don't offer graduate degrees.
2.3 - Use the table command to get the value counts for the ownership
variable.
In [26… # Your code goes here
own <- table(dat$ownership)
own
2.4 - Find the proportion of all institutions that are public, private nonprofit, and
private for-profit.
In [28… # Your code goes here
total1 <- sum(own)
own/total1
Check yourself: About 34.7% of the schools in the dataset are public schools
Warning message:
“Removed 2731 rows containing non-finite outside the scale range (`stat_bin
()`).”
Note: A warning message was displayed about removing rows. This is R telling us that
it's choosing not to visualize the missing data values ( NA ) that we discovered for
admit_rate earlier in the notebook.
As we suspected from the summary statistics, it appears that most programs have
admissions rates well above 50%, and only a small subset of programs have highly
selective admissions rates. In statistics, we call this distribution left skew, since
there's a tail on the left side. So, institutions with low values (low admissions rates) are
relatively unusual compared to most of the other institutions in our dataset.
3.1 - Create a histogram to visualize all the default_rate values in the dat
dataframe.
In [30… # Your code goes here
gf_histogram(~admit_rate, data=dat)
Warning message:
“Removed 2731 rows containing non-finite outside the scale range (`stat_bin
()`).”
As shown here, most of the institutions in our dataset are Universities that graduate
degrees or trade programs that offer professional certificates. There are about 500
colleges that only offer bachelors degrees (without offering graduate degrees).
3.3 - Create a bar plot to visualize the ownership values from the dat
dataframe.
Warning message:
“Removed 2731 rows containing non-finite outside the scale range
(`stat_boxplot()`).”
We see that admission rates tend to be lower (lower medians) for colleges /
Universities that grant bachelors and graduate degrees. However, it's worth noting that
for every institution-type, the first quartile is higher than a 50% admissions rate. So,
most programs admit more than half their applicants, regardless of insitution-type.
Indeed, we see that the most prestigious Universities with admissions rates lower than
25% are outliers (visualized as dots on the boxplot) among other Universities that offer
graduate degrees.
3.5 - Create boxplots to visualize the relationship between ownership and
default_rate from the dat dataframe.
3.6 - Using your boxplot visualization, describe the relationship between institution
ownership and studen loan default rates.
Double-click to type a response: Shows that private for-profit colleges typically have
the highest student default loan rates, followed by public institutions. Meanwhile,
private non-profit have the lowest rate. This implies students at for profit schools are
more likely to default on their loans.