Skip to main content Accessibility help
×
Hostname: page-component-5c6d5d7d68-vt8vv Total loading time: 0.001 Render date: 2024-09-01T08:24:02.743Z Has data issue: false hasContentIssue false

7 - Integrating and Storing Data

from PART THREE - FORMATTING AND STORING DATA

Published online by Cambridge University Press:  15 September 2017

Jose Manuel Magallanes Reyes
Affiliation:
University of Washington and Pontificia Universidad Católica del Perú
Get access

Summary

In general, when you collect, clean, and format data, you are working with independent files, but most of the time your analytic work needs to combine files from different sources to answer the questions you define in your research design. It is rarely the case that your research question depends on one particular data set or on several files from one source. Integration is the process of combining your data to produce the file you need. The material on storage focuses on how to code for data retrieval, updating, and sharing; topics that go beyond simply saving your files for later use.

Integrating Data

Preparing the Integration: Cleaning the Keys

To be able to integrate different data sets, you need one column that serves as a key to merge the data. Sometimes, you may even need two columns. That key column is the common column in every data set to be integrated. The headers do not have to be the same (no need for that), but the contents do. For example, if you have two data files of cities from different countries, the key could be the city name. If one file has more cities than the other, it is not a problem, as long as the cities that appear on both files are written using the same spelling. For this example, I will combine some known data sets from different sources to show the issues you face when integrating data.

  1. • Human Development Index (HDI)

  2. • Freedom of the World Index (WORLD)

  3. • Economic Freedom Index (ECO)

  4. • Freedom of the Press (PRESS)

  5. • A table with the country names and their ISO and FIPS (CODES) from America's Open Geocode (http://www.opengeocode.org/) database

The unit of analysis is the country; the column with the country names can be used as the key, but I prefer some kind of country code, so the ISO or FIPS codes are the best option to ease the merging. Notice that I will use the official link to the data this time (the ones provided in the previous footnotes) to avoid scrapping (and mistakes in Wikipedia information). Let's start by getting the ISO and FIPS codes.

Type
Chapter
Information
Introduction to Data Science for Social and Policy Research
Collecting and Organizing Data with R and Python
, pp. 226 - 298
Publisher: Cambridge University Press
Print publication year: 2017

Access options

Get access to the full version of this content by using one of the access options below. (Log in options will check for institutional or personal access. Content may require purchase if you do not have access.)

Save book to Kindle

To save this book to your Kindle, first ensure coreplatform@cambridge.org is added to your Approved Personal Document E-mail List under your Personal Document Settings on the Manage Your Content and Devices page of your Amazon account. Then enter the ‘name’ part of your Kindle email address below. Find out more about saving to your Kindle.

Note you can select to save to either the @free.kindle.com or @kindle.com variations. ‘@free.kindle.com’ emails are free but can only be saved to your device when it is connected to wi-fi. ‘@kindle.com’ emails can be delivered even when you are not connected to wi-fi, but note that service fees apply.

Find out more about the Kindle Personal Document Service.

Available formats
×

Save book to Dropbox

To save content items to your account, please confirm that you agree to abide by our usage policies. If this is the first time you use this feature, you will be asked to authorise Cambridge Core to connect with your account. Find out more about saving content to Dropbox.

Available formats
×

Save book to Google Drive

To save content items to your account, please confirm that you agree to abide by our usage policies. If this is the first time you use this feature, you will be asked to authorise Cambridge Core to connect with your account. Find out more about saving content to Google Drive.

Available formats
×