Exploring statistics via visual simulation

As the start of the research methods module I teach is fast approaching, I have been exploring new ways to try and get students more engaged with statistics. One aspect I believe increases student understanding—and dare I say it, enjoyment—of statistics is to get their hands dirty with lots of examples.

Although it would be great to get students to go off and collect lots of different data sets, each suitable for exploring a particular statistical test, a quicker alternative is perhaps to provide the data via computational simulation. Then, students can quickly explore new data sets in interesting ways.

I have been using the statistical software R together with Shiny to develop some visual simulations of key statistical concepts. The video below demonstrates me quickly messing around with a correlation simulation I have programmed.

In this simulation, students select how many subjects (or observations) they would like to simulate on two arbitrary measures; then—and this is the neat part, in my mind—they can set how strongly they would like the two measures’ outcomes to be correlated. Want to know what a correlation of r=.75 would look like? Want to visualise a negative .5 correlation and then a positive one? Simple! Just plug in the numbers and go!

The computer generates a random set of N observations for Measure 1 (with a mean of zero and standard deviation of 1); it then generates N more random observations, with the constraint the new observations are correlated to the degree r (N and r are provided by the user). It then plots the results, together with a regression line (in red) and the exact correlation coefficient calculated for this data. (As the simulations are stochastic, the exact correlation will differ from the desired correlation, but not by much.)

The simulation can be found here: http://jimgrange.shinyapps.io/Correlations/

In the coming weeks I aim to produce simulations for most statistical concepts covered on our course in Keele psychology. It is hoped that this will help students explore statistics more, and get more of a feel for what the statistics are telling them. I would welcome any comments on these apps!

Tagged , ,

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

%d bloggers like this: