Lesson 1 assistance: Using StatCrunch

The hardest part of this lesson will be incorporating StatCrunch for the first time.

You have access to StatCrunch in a few ways:

(1) You may have purchased MyStatLab by buying the textbook bundle and then were granted automatic access to StatCrunch or (2) You purchased StatCrunch separately. (3) You are sharing access (please make sure you aren't in the same section because this will make the lab exam tricky…) (4) You are borrowing access.

The cholera data used in this lesson can be found in Week 2. It can also be found in http://www.stat.ucla.edu/~vlew/datasets/Cholera.csv if you somehow can't access CCLE.

To read it into StatCrunch, go to the MyStatCrunch tab on the StatCrunch website (logging in should get you there) and you will see a section that reads “My Data”:

mydata

The easiest thing to do is save the cholera data to your hard drive and then click on the “Select a file on my computer”. If you are successful, you should see the following as a new tab on your browser (most likely). The columns are COUNT (count of deaths at that location) LON (longitude of the location) LAT (latitude of the location), LOCATION (latitude and longitude separated by a comma)

choleradata

To use compute a mean, choose the menu bar box labeled “STAT”, then choose “SUMMARY STATS” and then choose “COLUMNS”. We do this because the variables are organized as columns and the rows are the observations. When the mean (average) is computed, it is done on all of the values in a column if you choose column.

mean1

You will be asked to compute the mean for both the lon and lat variables. The results will be used in mapping data. You might want to note or write down the values, but as long as you don't close the pop up windows which result from computing the means, you can copy and paste values.

mean2

On mapping, in StatCrunch, mapping is just a graph. It's the last option of the graphing menu, choose “Google Map”. You will need to use the variable LOCATION and not lat and lon. This is how Google and Statcrunch need location to be formatted in order to map it. If you do it correctly, a map should result.

The only option I would worry about is making sure that the plot DOES NOT cluster the points. Annotation is optional, I annotated it with the count of Cholera deaths in my example, but it isn't required to get this lesson right.

map1 map2 map3

Here is the hard part – I'd like you to add the mean lat and mean lon to the map and color it red. This is where you need the means for lat and long. You need need to add this information to the last part of the input window in the plot. If you look at the highlighted input box (blue emphasis just below). The last line reads “your mean lat, your mean lon | #ff0000|count: 0” this needs to be changed:

add1

So you substiute something like “51.514417, -0.13776543 | #ff0000|count: 0” (no quotes and these are not the right latitude or longitude but #ff0000 means “red”), a red marker should pop up in the middle of the points after you click “plot locations” at the bottom of the map results.

add2

Last thing is to use street view to find the pump (it's not real, it's a memorial). Drag the little man to the red marker and release:

sw1 sw2

You might need to spin around in streetview to see the pump, but if you computed the means correctly and plotted, it should work. This is basically repeating Dr. Snow's analysis of Cholera deaths. He mapped the deaths, located the central point, visited the location, looked around and saw the Broad Street pump. From that, he took samples of the water and discovered Cholera.

The remainder of this lesson is relatively easy and probably does not need StatCrunch.