QoG Data in Stata
Stata is one of the most popular statistical software. If you are using it to work with the QoG Data, here is some information you might find useful.
Using the QoG Standard dataset in Stata/IC
The QoG Standard dataset has more than 2000 variables. If you are a Stata/BE user, it means you are not able to load more than 2047 variables. However, you can open a subset of the dataset by clicking on File -> Open data subset - which will provide you a dialog box to browse the dataset and filter selected variables (Stata Tutorial on loading a subset of data).
Users who want to access the QoG standard datasets can also follow these steps:
- Choose the variables you want to read using the QoG Standard Codebook
- Download the file in .dta format to your computer.
- Open Stata/BE and the command window to run the following command:
use list of variables using "C:\Link\to\file\qog_std_cs_jan23"
Example: use ccode cname year icrg_qog using "C:\Link\to\file\qog_std_cs_jan23"
Remember you can state the list of variables in different ways:
- Call all the variables of one or several data sources by indicating the prefix of the data source (e.g. bl_* ciri_*)
- Call specific variables directly by their names (icrg_qog fh_ipolity2 wbgi_cce)
- Call a list of variables in the order currently stated in the dataset (aid_cpnc – vi_ext)
Note: All lists of prefixes and variable names are available in the codebook. We recommend you to always add and open the identification variables: cname, ccode and year (for time-series).
Using QoG Data with the Stata Command qoguse and qogmerge
Christoph Thewes, University of Potsdam, has written the qoguse and qogmerge commands. These allow you to load the latest version of the different datasets with a simple line of code or merge your in-use data with the latest version of any one of the QoG datasets.
To install these commands simply run the following code in Stata:
ssc install qog
Read how to use all the commands available by running in Stata:
help qoguse
help qogmerge