you're reading...
Technical Topics

Where do our students come from, with Heat Maps

Our new President wanted to know where our students are coming from, geographically. We have reports that break down our New Entering Freshmen by geographic region, but they aren’t very compelling or easy to consume quickly. We thought it would be neat to map the information somehow.

I decided to use the R statistical package. It is free, has great graphical capabilities and powerful statistical tools (needed to generate distributions for the heat maps). It’s not that user-friendly though, unless you are the type that loves to immerse themselves in code. If you are that type of person, it’s a pretty fun software package to work with.

I found an example that I really just mimicked at:


Also, I found a library of ZIP codes with their associated latitude/longitude coordinates available for R at:


So, I pumped a list of ZIP codes I took from our new student’s permanent address in ISRS (our student record system) over the past ten years into R. From those I was able to generate lat/long coordinates, and display them over a map downloaded from Google:


Winona NEF map

A heat map of the home (permanent) address from New Entering Freshmen admitted to our Winona Campus over the past 10 years.


Rochester NET Map

A heat map of the home (permanent) address from New Entering Transfer students admitted to our Rochester Campus over the past 10 years.


You can quickly see that while we draw many students to our Winona campus locally, we also draw heavily from the twin cities area. The transfer students coming to our Rochester campus are mostly from that immediate area.

The code I used to generate these maps is at R_HeatMap_Script_20121005. There are a couple helpful comments embedded in that code, but don’t hesitate to contact me with any questions. This code will not work with the most recent version of R, because the graphical library it relies on (ggplot2) has been re-written. But, this script will run using R version 2.12.2 available at http://cran.r-project.org/bin/windows/base/old/2.12.2/.

The ggmap R library (https://sites.google.com/site/davidkahle/ggmap) might be an even better solution, I’m going to explore that next.

About Ed Callahan

I am IT staff assigned to Institutional Planning, Assessment and Research (IPAR) at Winona State University. On the best days my title is Data Analyst and I get to answer high level questions by exploring data and write-up an thorough analysis. Other appropriate titles, depending on our workload at the time, would be Reporting Specialist, Database Developer or Ad Hoc Data Request Satisfier. I'm also a boy scout leader, school board president and have an unnatural obsession with riding my motorcycle.


No comments yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

IPAR Posts

October 2012
« May   Jan »


Enter your email address to follow this blog and receive notifications of new posts by email.

Join 6 other followers

%d bloggers like this: