Teaching with TwoRavens:
The Quality of Government Data


The Quality of Government is a fantastic resource for researchers of all levels of qualitative and quantitiative expertise (Teorell et al.2015). It contains country-level variables, some from data collections such as the World Values Survey, and others from well-known articles such as Bueno de Mesquita et al. (1999). The variables contain information on the economy, health and social services, government institutions, the environment, conflict, and more. There is both a time-series dataset and a cross-sectional dataset using mostly data from 2010.
This document will guide you through some simple regressions testing plausible hypotheses with TwoRavens. We will be using the QoG cross-sectional data.

1 Access the Data

Follow the link to the Teaching with TwoRavens dataverse. Click on the Quality of Government dataset. Inside this dataset are two files: qog_std_cs_jan15.tab and qog_std_jan15.pdf. Download and open the PDF; this is the QoG codebook. Next to the “Download” button for the file qog_std_cs_jan15.tab, click “Explore.” This should open a page in your browser, as shown in figure 1.1


Figure 1: TwoRavens loaded with the Quality of Government data.

2 Testing Simple Hypotheses

Due to its breadth of variables, the Quality of Government dataset can be used to assess hypotheses across many fields of social science. In the following section, one hypothesis is proposed and tested in preliminary, exploratory fashion.

2.1 Religiosity and Foreign Aid

Studies such as Reitsma, Scheepers and Grotenhuis (2006), Graham and Haidt (2010), and Sablosky (2014) have examined the relationship between religiosity and charity in the individual. Others, such as Paxton and Knack (2011) and Hook (2008), have examined the role between religion and foreign aid. Suppose a student has developed a theory relating findings in this literature, and is now interested in exploring the statistical relationship between religion and foreign aid.

Alternatively, perhaps a politician states that individuals who are more religious give more to charity, and by extension religious countries are more charitable. Suppose an individual wishes to fact-check that politician.

In either situation, a first step is likely a simple statistical test. In the QoG data, there is an aid variable aid_cpsc, and a measure of religiousness wvs_rel. These variables are easily discoverable in the QoG codebook. Let’s estimate a simple regression to test this hypothesis.

After loading the data:


Figure 2: TwoRavens results for religiousness and aid

The results from this regression appear in figure 2. As we can see, the effect of religiousness is positive and significant at the 0.1 level, but not significant at the 0.05 level. Exploring the relationship a bit further, we might also include variables for a country’s GDP and population.


Figure 3: TwoRavens results for religiousness and aid

The results from this better-specified model appear in figure 3. As we can see, the effect of religiousness is still positve, but not statistically significant at any conventional level.

3 Classroom Exercise

The following classroom exercises are designed to encourage quantitative reasoning in the classroom. Begin by breaking the class into groups and providing the class with a link to the TwoRavens dataverse.

3.1 Theory and Hypothesis Testing

  1. Ask each group to identify two variables in the QoG data, and to propose a causal relationship among the two variables
  2. Point students to the information available on mouseover in the Model Selection panel, and to http://zeligproject.org/, and ask them to estimate the relationship using an appropriate statistical model
  3. Why did they choose that particular statistical model? Is their group’s hypothesis supported? In what ways might they extend their model?

3.1.1 Model Robustness

  1. Ask each group to locate three additional variables that may be associated with the dependent variable
  2. Include those variables in the model and re-estimate
  3. Has the coefficient on your independent variable of interest changed? Why did they select those three variables?

3.2 Sensitivity Analysis

  1. Ask the students to estimate the effect of democracy on some outcome of interest—perhaps GDP growth
  2. Ask students to describe their models, and write down what they say on the board
  3. What does it mean that we have observed different effects? Which one should we believe?

3.3 Omitted Variable Bias

  1. Ask each group to hypothesize the effect of a country’s religiousness on how much aid it gives. How did they come up with this hypothesis?
  2. Instruct each group to estimate the effect of religiousness on aid
  3. Next, ask the students to estimate the same model but include GDP and population as independent variables
  4. What happened to the coefficient on religiousness?


   Bueno de Mesquita, Bruce, James D. Morrow, Randolph M. Siverson and Alastair Smith. 1999. “An Institutional Explanation of the Democratic Peace.” American Political Science Review 93(4):791–807.

   Graham, Jesse and Jonathan Haidt. 2010. “Beyond beliefs: Religions bind individuals into moral communities.” Personality and Social Psychology Review 14(1):140–150.

   Hook, Steven W. 2008. “Ideas and change in US foreign aid: Inventing the millennium challenge corporation.” Foreign Policy Analysis 4(2):147–167.

   Paxton, Pamela and Stephen Knack. 2011. “Individual and country-level factors affecting support for foreign aid.” International Political Science Review p. 0192512111406095.

   Reitsma, Jan, Peer Scheepers and Manfred Te Grotenhuis. 2006. “Dimensions of individual religiosity and charity: cross-national effect differences in European countries?” Review of Religious Research pp. 347–362.

   Sablosky, Roy. 2014. “Does religion foster generosity?” The Social Science Journal 51(4):545–555.

   Teorell, Jan, Stefan Dahlberg, Sren Holmberg, Bo Rothstein, Felix Hartmann and Richard Svensson. 2015. “The Quality of Government Standard Dataset, version Jan15.”. University of Gothenburg: The Quality of Government Institute, http://www.qog.pol.gu.se.