Teaching correlations

I was talking to my friend Nathan (he of the whimsical p value Doge and the informative p value research) about teaching correlations to undergraduates. We thought it might help if the students could see the effects on size and significance of different data quickly – by clicking in data points themselves.

So, I wrote this code.

It opens a user interface figure with x and y axes. Students can then click in data points and watch a positive correlation grow greater in significance as more points are added but with little change to size because the points are all close to the least squares line:

posCor

Or see the effect of an outlier driving a correlation. Here there is no significant correlation between the first nine points but the addition of the tenth suddenly creates a significant correlation with a large magnitude.

outlierCor

This of course reminds students to visualise to check for (amongst other things) outliers in the data and not just report the numbers.

 

Advertisements

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 )

Twitter picture

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

Facebook photo

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

Google+ photo

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

Connecting to %s