R, RStudio, knitr, apa6, citations and LaTeX minimal working example

Nota bene: Original post thrown up quickly to promote usage. Some helpful edits have been made, but as usual, continue at your own risk.

I detest copy-pasting analysis results (laziness is a virtue), so my current statistical analysis workflow uses the knitr package to convert results from R into a LaTeX file and then into a PDF report (by pressing one button). After months of using this power only for Beamer presentations and statistics homework assignments, I’ve figured out how to add the apa6 package and automatic bibliography generation to the process for building a reproducible manuscript. This post shares the framework, in hopes that free some readers of the torture that is copy-pasting from SPSS to Excel to Word–and then needing to update the analysis.

(more…)

Read More

Collecting Data with Flash in Qualtrics, via Javascript

For online, reaction-time based experiments I use Adobe Flash programs to collect data (ala Simcox & Fiez, 2013). So far, this has meant hosting the Flash program on a private server, exporting the data as an XML object to a PHP script that then converts it into a CSV file for download. My PHP scripts are an ActionScript 3 (AS3) version of the (very helpful) AS2 code developed by Jeff Galak for his “Flash for Behavioral Researchers” workshops.

However, as I also use Qualtrics to host and distribute surveys, I worked out how to collect data from an embedded Flash program using JavaScript, instead of PHP. I have not tested it, but this method might also be adaptable for Flash programs on Amazon Mechanical Turk.

I’ve explained the method in detail for anyone who wants to get started. Nota bene: Follow my advice at your own risk, and make sure to do your own homework.

[This post has been updated as of 9/13/2014, after several implementations of this method in actual studies.]

(more…)

Read More