Category: projects

The 611/612/613 R Revolution!

This post describes the effort to translate the Psychology Department’s graduate level statistics courses into R. The goal is to provide R code for all of the lab handouts for all three courses making up the data analysis sequence: PSY611, PSY612, and PSY613.

See the bitbucket repository to get the handouts for 611, 612, and 613: https://bitbucket.org/rosemm/611-612-613-r-code

To work on this project, please download the handouts and look through for any computation done in SPSS, and figure out how to do it in R instead. Also keep an eye out for simulations and demonstrations (most of which are currently done with Java apps online), and see if you can translate those to R as well – they will probably take the form of R scripts students could run, and then change certain parameters and re-run to see, for example, how changing sample size affects the variance of the sampling distribution of the mean. This code should all be written for an audience with no assumed R experience, so please make sure to include lots of clarifying comments/annotations. For example, it would be super helpful to include one or more comments about the output that the code generates, drawing students’ attention to the relevant pieces and explaining how it differs from the SPSS output.

If you’re working on this project, consider commenting on this post to let others know where you’re directing your efforts (e.g. “I’m working on 611 Lab 1: EDA”). It’s fine for multiple people to work on the same handouts – we might uncover some cool alternate solutions that way! – but we’ll get the most done if we can allocate our efforts efficiently. Please save your code as an R file with the name of the course and handout it belongs to (e.g. “611_Lab1.r”) and post to BitBucket.

If you come across cool resources while you’re working on this or if you have questions/comments/advice/whatever relevant to this project, please comment on this post.

The Plan: Individual Projects

We’ve pretty much gotten through the material in the Intro to R course from UCLA, and covered some neat supplementary content as well (for a one-stop shopping experience of the topics we’ve covered so far, see the Week 6 Review). For the last few weeks of Fall 13 R Club, we’d like to focus on individual projects. The goal is for everyone to come up with an R project for him/herself, and then spend the rest of term trying to do it. Ideally, this should be a task that’s actually useful to you. For example, perhaps you have some analyses you’ve been doing in another environment (SPSS? HLM? MPlus?), but you’d like to try to translate the work to R to check whether the results come out the same. Or maybe there’s a data cleaning procedure in your lab that currently involves work by hand in Excel or something, and you’d like to automate it. Alternatively, if you don’t have any project of your own that you’d like to work on, you can join the effort to translate PSY611/612/613 into R – we’d like to be able to provide clearly annotated R scripts to do all the tasks currently presented in SPSS for the whole sequence. Vive la revolution!

The aim of these individual projects is two-fold: 1) To give you a productive, collaborative space so you can work through a project that’s useful to you and (this is key) have the opportunity to ask questions when you get stuck/frustrated instead of just smashing your computer with a coffee mug alone in your apartment at 3am; and 2) To develop a pool of resources that we all share, so everyone can benefit from our collective problem solving efforts. To facilitate both question-answering and resource-sharing, please post your code online (preferably to BitBucket) and share it with your fellow rclubers. BitBucket provides an excellent environment for people to help you with your code when you get stuck, and also if everyone has access to each other’s code, then we can all learn from the solutions everyone comes up with. Also, it would be great if you could write up a brief summary of what your code does, and include any useful resources you found while working on it, and then add it to the blog as a new post with a link to your code on BitBucket. I’ll add a post category called “projects”, so please tag your post with that label – that way we’ll be able to view all the project posts in one place easily. You might find it useful to create the post early, before your code is done, to give your R Club collaborators some sense of what you’re trying to do so it’s easier for them to help you. I think you should all have “author” access, but if you have trouble figuring out how to post to the blog, send me an email.

If you have trouble getting set up with BitBucket or TortoiseHg (which is not unlikely if you’ve never used programs like this before), the weekly R Club meeting is a great place to troubleshoot with friends. Ask for help.