A modern take on how to formulate and answer a research question experimentally and empirically

Science is there to answer questions, and it is a powerful tool at that. In this post I outline how I approach the task of coming up with research questions, how to answer them and how to create a publishable manuscript describing this procedure. It is very idiosyncratic, but I hope that it might be useful for some readers, especially students.

A text mining function for websites

For one of my projects I needed to download text from multiple websites. I did this with rvest and dplyr. While this can be relatively easy if the sources come from the same websites, it can be pretty tedious when the website hosts are various. The reason is how the content is kept in the HTML of the website. Assume that you want to extract the title, author information, publish date, and of course the main article text. You can access that information via CSS or XPath. The following text will walk you through an example and provide the relevant code.

Using RStudio and LaTeX

This post will explain how to integrate RStudio and LaTeX, especially the inclusion of well-formatted tables and nice-looking graphs and figures produced in RStudio and imported to LaTeX. To follow along you will need RStudio, MS Excel and LaTeX.

Nudging or coercing people to protect the climate?

Even though there is some disagreement as to who is responsible for climate change, it is beyond substantial scientific doubt that climate change is a major threat for humanity in the 21st century. However, there still is doubt among the public. Why? There is an intuitively appealing theory why this is the case: Solution aversion. The theory attempts to explain why Republicans are much more likely to deny the reality of man-made climate change, while Democrats tend to accept it as fact. The model proposes that people deny the existence of a problem partly or primarily because they disagree with the solutions that have been proposed to solve the problem. In the case of climate change these proposed solutions would be regulations that disagree with what conservatives favor: market solutions.

Mean differences or mean changes?

While analyzing data from an experiment, I found myself writing things like ‘The treatment changes the outcome variably by…’ or ‘the treatment leads to changes in the outcome variable’. However, I often thought that talking about changes sounded too ‘dynamic’. After all, I was referring to two different groups of subjects (between-subjects design). What I was doing was to statistically compare means of the outcome variable of different groups. I was ok to talk about changes when referring to within-subject differences, i.e. changes in outcomes for the same subject due to an intervention, but for the between-subjects case, shouldn’t I rather talk about differences instead of changes?

The perfect refugee

I stumbled across a recent research article published in Science magazine, called ‘How economic, humanitarian, and religious concerns shape European attitudes toward asylum seekers’ by Kirk Bansak, Jens Jainmueller, and Dominik Hangartner. This article struck my attention because I find the topic very interesting, because it was an experiment and not ‘just’ an empirical investigation of data, and because they decided to present their findings not only in a boring regression table, but in a colorful ropeladder plot.