Jeromy Anglim's Blog: Psychology and Statistics

Wednesday, May 28, 2014

Customising ProjectTemplate in R

This post talks about my workflow for getting started with a new data analysis project using the ProjectTemplate package.

Wednesday, December 4, 2013

Using R to replicate common SPSS multiple regression output

The following post replicates some of the standard output you might get from a multiple regression analysis in SPSS. A copy of the code in RMarkdown format is available on github. The post was motivated by this previous post that discussed using R to teach psychology students statistics.

Tuesday, November 19, 2013

Writing a Concise Introduction to a Psychology Journal Article: An Article Deconstruction

I often talk about article deconstruction as a useful method for extracting principles for writing journal articles. The following is an article deconstruction of the introduction section of Fujita and Diener (2005). The writing principles extracted may be relevant to others writing introductions to journal articles in psychology.

Monday, November 11, 2013

How to convert manual APA references to Endnote references in Word

When collaborating on a journal article with colleagues I sometimes get Word documents that have manually formatted references. I often want to convert the manual references to Endnote references. The following post discusses a workflow for doing this.

Thursday, October 10, 2013

Tutorials, Answers, and Data Files for Multivariate Research Methods Course using SPSS and Amos

I recently developed a set of tutorials for teaching research methods using SPSS and Amos to I/O psychology students. I thought they might be useful for other instructors or people learning intermediate multivariate research methods to social and behavioural science students. Thus, I have made the resources available as a downloadable repository.

Wednesday, July 17, 2013

Evaluating the Potential Incorporation of R into Research Methods Education in Psychology

I was recently completing some professional development activities that required me to write a report on a self-chosen topic related to diversity in student backgrounds. I chose to use the opportunity to reflect on the potential for using R to teach psychology students research methods. I thought I'd share the report in case it interests anyone.

Friday, March 15, 2013

Google Reader Replacements: Feedly and The Old Reader

This post discusses the impending demise of Google Reader and configuring Feedly as a replacement.

Monday, July 23, 2012

Beamer presentations using pandoc, markdown, LaTeX, and a makefile

This post discusses the creation of beamer presentations using a combination of markdown, pandoc, and LaTeX. This workflow offers the potential to reduce typing and increase readability of beamer presentation source code. Source code for an example presentation is provided containing markdown and LaTeX source code along with a makefile for building the beamer PDF.

Thursday, July 19, 2012

Video: knitr, R Markdown, and R Studio: Introduction to Reproducible Analysis

This post presents the video of a talk that I presented in July 2012 at Melbourne R Users on using knitr, R Markdown, and R Studio to perform reproducible analysis. I also provide links to a github repository where the R markdown examples can be examined and the slides can be downloaded.

Sunday, June 10, 2012

Converting Sweave LaTeX to knitr LaTeX: A case study

The following post documents the steps I needed to take in order to convert a project using Sweave LaTeX into one using knitr LaTeX.

Monday, June 4, 2012

How to Convert Sweave LaTeX to knitr R Markdown: Winter Olympic Medals Example

The following post shows how to manually convert a Sweave LaTeX document into a knitr R Markdown document. The post (1) reviews many of the required changes; (2) provides an example of a document converted to R Markdown format based on an analysis of Winter Olympic Medal data up to and including 2006; and (3) discusses the pros and cons of LaTeX and Markdown for performing analyses.

Friday, May 18, 2012

Example Reproducible Report using R Markdown: Analysis of California Schools Test Data

This is a quick set of analyses of the California Test Score dataset. The post was produced using R Markdown in RStudio 0.96. The main purpose of this post is to provide a case study of using R Markdown to prepare a quick reproducible report. It provides examples of using plots, output, in-line R code, and markdown. The post is designed to be read along side the R Markdown source code, which is available as a gist on github.

Thursday, May 17, 2012

Getting Started with R Markdown, knitr, and Rstudio 0.96

This post examines the features of R Markdown using knitr in Rstudio 0.96. This combination of tools provides an exciting improvement in usability for reproducible analysis. Specifically, this post (1) discusses getting started with R Markdown and knitr in Rstudio 0.96; (2) provides a basic example of producing console output and plots using R Markdown; (3) highlights several code chunk options such as caching and controlling how input and output is displayed; (4) demonstrates use of standard Markdown notation as well as the extended features of formulas and tables; and (5) discusses the implications of R Markdown. This post was produced with R Markdown. The source code is available here as a gist. The post may be most useful if the source code and displayed post are viewed side by side. In some instances, I include a copy of the R Markdown in the displayed HTML, but most of the time I assume you are reading the source and post side by side.

Thursday, May 3, 2012

How to plot three categorical variables and one continuous variable using ggplot2

This post shows how to produce a plot involving three categorical variables and one continuous variable using ggplot2 in R.

Wednesday, April 11, 2012

Getting Started with JAGS, rjags, and Bayesian Modelling

This post provides links to various resources on getting started with Bayesian modelling using JAGS and R. It discusses: (1) what is JAGS; (2) why you might want to perform Bayesian modelling using JAGS; (3) how to install JAGS; (4) where to find further information on JAGS; (5) where to find examples of JAGS scripts in action; (6) where to ask questions; and (7) some interesting psychological applications of Bayesian modelling.

Friday, February 17, 2012

New Psychology and Cognitive Science Question and Answer Site: COGSCI.SE

There is now a new website for researchers to ask and answer questions on topics related to psychology and cognitive science. The site is From the success of earlier released sites in the Stack Exchange network such as those on programming, statistics, and latex, the site for psychology and cognitive science has the potential be a great resource for researchers. I'm actively contributing on the site. So, if you are a researcher in psychology, I hope you'll check it out. The rest of this post sets out (a) a little history of Stack Exchange question and answer sites as they relate to psychology and statistics; (b) why I think this new site for psychology and cognitive science has so much potential; and (c) why, if you are a professional or student researcher in psychology, you might want to get involved.

Sunday, July 24, 2011

Tips for Undergraduates Interested in a Career in Organisational Psychology: Australian Perspective

Undergraduate psychology students often ask me about careers in organisational psychology. This post aims to provide a few links and resources to assist such students to learn about the profession and the career pathways. The post includes (a) a basic description of organisational psychology, (b) links to Australian educational and professional society resources, (c) discussion of PhD and academic options, and (d) additional resources to learn more about the profession.

Sunday, July 17, 2011

Correlation Resources: SPSS, R, Causality, Interpretation, and APA Style Reporting

This post provides links to a range of resources related to the use and interpretation of correlations. I wanted to provide a page with links to a number of additional resources that would be useful both for those of my students who might be keen to learn more and for anyone else who might be interested. Specifically, this post provides links to: (a) introductory book-style chapters on correlation, (b) resources related to assorted issues in correlation (i.e., discussion of causal inference, correlation with various variable types, range restriction, statistical power, correlation interpretation, and significance testing), (c) tutorials on computing correlations using SPSS and R, and (d) tips for reporting correlations in APA Style.

Monday, May 23, 2011

Transition to Linux and Ubuntu: The Experience of a Quantitative Social Scientist

This post discusses my experience migrating to Ubuntu from Windows from the perspective of a quantitatively oriented researcher in psychology. It discusses (a) my general transition to open source tools for doing research; (b) examination of Cygwin; (c) choosing a Linux distribution; (d) preparing for installation of Ubuntu; (e) initial reflections on installing Ubuntu; and (f) a long list of various solutions to specific problems that I encountered whilst getting started with Ubuntu.

Wednesday, May 4, 2011

Guide to Getting Started with R: 2011 Update

In mid-2009, I wrote a post on getting started with R. A lot has happened in the world of R over the last two years. New books, videos, online documentation, blogs and other resources have emerged. New community structures have emerged. As such I've given the guide a major overhaul both to increase its usability and acknowledge the many exciting changes in the world of R. The updated Guide to Getting Started with R is available here..

Monday, April 25, 2011

Case Study in Customising Syntax Highlighting and Folding in Vim for a Niche Scripting Language Called Inquisit

This post presents my efforts to setup a productive environment for editing Inquisit scripts in Vim. In addition to being relevant to people who write Inquisit scripts, the post is designed as a general case study in customising Vim for a niche programming language. Specifically, the post discusses how to setup in Vim: (a) code folding using a custom expression, (b) custom syntax highlighting, and (c) interactions with the command-line.

Saturday, April 16, 2011

Using Vim and VimOutliner as a Brainstorming and Outlining Tool

This post discuses using Vim as an outlining tool. It focuses particularly on VimOutliner. In particular the post (a) discusses reasons why I like outlining tools, (b) presents some links for getting started and installing VimOutliner, (c) presents my verdict on the personal utility of VimOutliner, and (d) presents an assortment of little issues that I encountered and resolved while learning to use VimOutliner.

Wednesday, March 30, 2011

How to Ask Me a Statistics Question

This post includes instructions on how to ask me a written statistics question.

Monday, February 21, 2011

R Optimisation Tips using Optim and Maximum Likelihood

This post summarises some R modelling tips I picked up at AMPC2011.

R versus Matlab in Mathematical Psychology

I recently attended the 2011 Australasian Mathematical Psychology Conference. This post summarises a few thoughts I had on the use of R, Matlab and other tools in mathematical psychology flowing from discussions with researchers at the conference.

Tuesday, January 11, 2011

Reasons for Transitioning to Vim: Bringing LaTeX, R, Sweave and More under One Roof

This post describes the reasons for my transition to Vim.

Tuesday, December 28, 2010

2010 in Review: 99 Most Popular Pages on Jeromy Anglim's Blog

In the spirit of taking stock of the year that's been, and in the spirit of festive television repeats, this post reviews 2010 for this blog.

Question and Answer Sites on Statistics, Computing, Research, and Psychology

This post sets out some of my favourite question and answer sites on topics related to statistics, computing, research, and psychology.

Monday, December 13, 2010

Video of Reproducible Research with R: Melbourne R Users 1st Dec 2010

As previously mentioned I gave a talk at Melbourne R Users Group titled "Reproducible Research and R Workflow". It covered technologies including LaTeX, Sweave, R, make, Eclipse, and git. This post shares the video.

Thursday, December 2, 2010

R Workflow: Slides from a Talk at Melbourne R Users (1st Dec 2010)

I gave a presentation at Melbourne R Users on the topic of R Workflow. The presentation covered R code organisation, and useful R related tools including Eclipse, StatET, Git, make, Sweave and LaTeX. Also, the slides from the presentation provide links to four complete examples of using R, Sweave, LaTeX, and make.

Tuesday, November 30, 2010

Sweave Tutorial 3: Console Input and Output - Multiple Choice Test Analysis

This post provides an example of using Sweave to perform an item analysis of a multiple choice test. It is designed as a tutorial for learning more about using Sweave in a mode where console input and output is displayed. Copies of all source code and the final PDF report is provided.

Monday, November 29, 2010

Sweave Tutorial 2: Batch Individual Personality Reports using R, Sweave, and LaTeX

This post documents an example of using Sweave to generate individualised personality reports based on responses to a personality test. Each report provides information on both the responses of the general sample and responses of the specific respondent. All source code is provided, and selected aspects are discussed, including makefiles use of \Sexpr, figures, and LaTeX tables using Sweave.

Getting Started with Git, EGit, Eclipse, and GitHub: Version Control for R Projects

This post provides information on
(a) installing Git using the Eclipse plugin Egit. (b) uploading repositories to GitHub, and (c) links to resources on Git, Git and LaTeX, and Git and R. The focus is on version control for people working on R, Sweave, and LaTeX related projects.

Saturday, November 27, 2010

Sweave Tutorial 1: Using Sweave, R, and Make to Generate a PDF of Multiple Choice Questions

In this post I present an example of using Sweave to prepare a PDF of formatted multiple choice questions. More broadly the example shows how to use Sweave to incorporate elements of a database into a formatted LaTeX document. It aims to be useful to anyone wanting to learn more about the almost magical powers of make, Sweave, and R.

Tuesday, November 23, 2010

makefiles for Sweave, R and LaTeX using Eclipse on Windows

This post provides a brief introduction to make and makefiles. In particular it describes how to set up make on Windows with an emphasis on using make in Eclipse on projects involving R, Sweave, and LaTeX.

Friday, November 12, 2010

Getting Started with Markdown: Benefits, Installation, Learning, and Conversion

I've recently adopted Markdown as a markup language for editing my blog posts. This post discusses (a) the benefits of Markdown, (b) installing a Markdown editor, (c) learning Markdown, and (d) converting between formats.

How to calculate confidence intervals of correlations with R

This post sets out how to calculate confidence intervals for correlations using R. Because I often get this question from people unfamiliar with R, it assumes no prior knowledge of R.

Saturday, October 23, 2010

Getting Started with Writing Mathematics in LaTeX

LaTeX and mathematics go well together. At the risk of preaching to the converted, this post sets out (a) reasons to learn to write mathematics in LaTeX, (b) a few free internet guides on learning to write mathematics in LaTeX, (c) several internet resources which can facilitate writing mathematics in LaTeX.

Wednesday, August 25, 2010

Getting Started with Beamer: Tips and Tricks for LaTeX Presentations

This post provides a guide to getting started with Beamer, a popular LaTeX package for preparing slide presentations. The post: (a) Lists some of the benefits of Beamer in comparison to PowerPoint; (b) Links to tutorials and suggestions for learning Beamer for both people who do and do not know LaTeX; (c) Documents problems that I encountered when learning to use Beamer and the solutions that I developed to overcome them.

Simple Beamer Template for Getting Started and Reducing Typing

For those who don't already know, Beamer is a useful package in LaTeX for preparing slide presentations. I have a Beamer template of preamble and slide templates. I found having a template was useful: (a) when first learning Beamer commands, and (b) in order to save typing. Thus, this post shares and explains the template in case it was of interest to others. It includes both my standard preamble and templates for individual slides. It is designed so that it is easy to compile both a presentation and a 2 x 2 handout.