Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

1 6 . 1 University Rankings. The dataset miba:: Universities on American College and Uni - verity Rankings contains information on 1 3 0 2

16.1 University Rankings. The dataset miba:: Universities on American College and Uni-verity Rankings contains information on 1302 American colleges and universities ofering an undergraduate program. For each university, there are 17 measurements, including continuous variables (such as tuition and graduation rate) and categorical variables (such as location by state and whether it is a private or public school).
Note that many records are missing some measurements. Our first goal is to estimate these missing values from "similar" records. This will be done by clustering the complete records and then finding the closest cluster for each of the partial records.
The missing values will be imputed from the information in that cluster.
a. Remove all records with missing measurements from the dataset.
b. For all the continuous variables, run hierarchical clustering using complete linkage and Euclidean distance. Make sure to normalize the variables. From the dendro-gram: how many clusters seem reasonable for describing these data?
c. Compare the summary statistics for each cluster, and describe each cluster in this context (e.g., "Universities with high tuition, low acceptance rate..."). Hint: To obtain cluster statistics for hierarchical clustering, use the aggregate function.
d. Use the categorical variables that were not used in the analysis (State and Private/Public) to characterize the different clusters. Is there any relationship between the clusters and the categorical information?
e. What other external information can explain the contents of some or all of these clusters?
f. Consider Tufts University, which is missing some information. Compute the Euclidean distance of this record from each of the clusters that you found above (using only the variables that you have). Which cluster is it closest to? Impute the missing values for Tufts by taking the average of the cluster on those variables.
# a
data - m7ba::Universities
# Remove records with missing measurements
complete_data - na.omit(data)
# b
continuous_vars - complete_data[, c (
"X..app7i..rec.d","X..app1..accepted", "X..new.stud..enro7led",
"X.. new. stud. .from. top.10.","X..new.stud. .from. top.25.","X..FT. undergrad",
"X..PT. undergrad", "in.state.tuition", "out.of.state.tuition", "room",
"board", "add. .fees", "estim. .book. costs", "estim. persona7..",
"x..fac..w.PHD", "stud..fac..ratio", "Graduation.rate"
]
# Normalize the continuous variables
normalized_continuous - scale(continuous_vars)
# Perform hierarchical clustering
hclust_result - hclust(dist(normalized_continuous), method = "complete")
# Plot dendrogram
plot (hclust_result)
# C
num_clusters -4
cluster_assignments - cutree(hclust_result, k= num_clusters)
# Combine cluster assignments with data
clustered_data - cbind(complete_data, Cluster = cluster_assignments)
# Compute summary statistics for each cluster
cluster_stats - aggregate(continuous_vars, by = list(Cluster = cluster_assignments), FUN = summary)
# d
categorical_vars - complete_data[, c("State", "Public..1...Private.. 2.")]
clustered_categorical - cbind(categorical_vars, Cluster = cluster_assignments)
# f
(Top Level)
# f
tufts - complete_data[complete_data$col7ege. Name == "Tufts University", ] tufts_continuous - tufts [, c
"X.. app71...rec.d","X.. app7..accepted", "X..new.stud.. enro77ed",
"X. new. stud. . from. top.10.","X.. new.stud..from.top.25.","X..FT.undergrad",
"X..PT. undergrad", "in.state.tuition", "out. of.state.tuition", "room", "board", "add..fees", "estim. book.costs", "estim..persona7..",
"X..fac..w.PHD", "stud..fac..ratio", "Graduation. rate"
]
tufts_distances - sapply(1:num_clusters, function(i){
cluster_mean - colMeans (continuous_vars [cluster_assignments =i,
image text in transcribed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

The Temple Of Django Database Performance

Authors: Andrew Brookins

1st Edition

1734303700, 978-1734303704

More Books

Students also viewed these Databases questions

Question

How wide are Salary Structure Ranges?

Answered: 1 week ago