DOI: 10.7910/dvn/dddleq
title: General Social Survey (GSS)

description: &lt;h3 class="post-title entry-title" itemprop="name"&gt; analyze the general social survey (gss) with r &lt;/h3&gt; the general social survey (gss) has served as america's mood ring since 1972. data-driven social scientists can compare political beliefs by demography, look at attitude trends, make emile durkheim and max weber (pronounced durk-veber) proud. in contrast to high-frequency tracking polls that capture newspaper headlines, the gss has sustained a (now biennial) set of questions over four decad
es.&lt;br /&gt; &lt;br /&gt; most analysts start with the cumulative, cross-sectional file (interviews conducted 1972 - present). given the sprawling nature of that cumulative data set, you'd better &lt;a href="http://www3.norc.org/GSS+Website/Documentation/"&gt;read the documentation&lt;/a&gt; and understand the eccentricities of each of the variables you want to use before you send anything off for peer-review. for example, many of the five thousand variables include &lt;a href="http://www.screenr.com/loS8"&gt;missing v
alues&lt;/a&gt; due to &lt;a href="http://publicdata.norc.org/GSS/DOCUMENTS/BOOK/GSS_Codebook_AppendixP.pdf"&gt;split-sample questions&lt;/a&gt;. not to say it's bad data - it's damn useful. you try administering a survey that keeps relevant for almost half a century. otherwise, leave it to &lt;a href="http://www3.norc.org/gss+website/"&gt;the national opinion research center (norc)&lt;/a&gt; at the university of chicago. ..and the national science foundation to foot the bill.&lt;br /&gt; &lt;br /&gt; on the main gss page, norc off
ers two &lt;a href="http://www.kaiseredu.org/Tutorials-and-Presentations/Conducting-Research-with-Online-Data-Query-Tools.aspx"&gt;online query tools&lt;/a&gt; - nesstar and sda - meaning you can point-and-click your way to some basic statistics. &lt;a href="http://www3.norc.org/gss+website/data+analysis/"&gt;the nesstar system&lt;/a&gt; smells like a fixer-upper, but &lt;a href="http://sda.berkeley.edu/"&gt;berkeley's sda&lt;/a&gt; (survey documentation and analysis) site offers a great way to confirm that you're broadly analyzi
ng the data correctly before you start writing r code to laser-focus on your research question.
&lt;br /&gt; &lt;br /&gt; the general social survey only gets asked of noninstitutional adults, because everyone already knows what kids' political beliefs are: more candy, no homework. this new github repository contains two scripts:&lt;br /&gt; &lt;br /&gt; &lt;b&gt;1972-2012 cumulative cross-sectional - analysis examples.R&lt;/b&gt;&lt;br /&gt; &lt;ul&gt; &lt;li&gt;&lt;a href="http://stat.ethz.ch/R-manual/R-patched/library/utils/html/download.file.html"&gt;download&lt;/a&gt;, &lt;a href="http://stat.ethz.ch/R-manual/R-devel/library/foreign/html/read.dta.html"
&gt;import&lt;/a&gt;, &lt;a href="http://stat.ethz.ch/R-manual/R-patched/library/base/html/save.html"&gt;save&lt;/a&gt; the 1972-2012 cross-sectional table onto your local computer&lt;/li&gt; &lt;li&gt;load it back up (so the downloading and importing can be skipped next time)&lt;/li&gt; &lt;li&gt;limit the table to the variables needed for an example analysis &lt;/li&gt; &lt;li&gt;create a &lt;a href="http://sda.berkeley.edu/D3/GSS10/Doc/gs100195.htm#COMPWT"&gt;weight&lt;/a&gt; and &lt;a href="http://sda.berkeley.edu/D3/GSS10/Doc/gs100195.htm#SAMPLERC"&gt;primary samp
ling unit&lt;/a&gt; variable based on berkeley's specifications&lt;/li&gt; &lt;li&gt;construct the &lt;a href="http://faculty.washington.edu/tlumley/survey/html/svydesign.html"&gt;complex sample survey object &lt;/a&gt;&lt;/li&gt; &lt;li&gt;run a treasure trove of political analyses&lt;/li&gt; &lt;/ul&gt; &lt;br /&gt; &lt;b&gt;replicate berkeley sda.R&lt;/b&gt;&lt;br /&gt; &lt;ul&gt; &lt;li&gt;&lt;a href="http://stat.ethz.ch/R-manual/R-patched/library/utils/html/download.file.html"&gt;download&lt;/a&gt;, &lt;a href="http://stat.ethz.ch/R-manual/R-devel/library/foreign/html/read.dta.html"&gt;import&lt;/a&gt;
, &lt;a href="http://stat.ethz.ch/R-manual/R-patched/library/base/html/save.html"&gt;save&lt;/a&gt; the 1972-2010 &lt;i&gt;(no typo there - this is not the more current 1972-2012)&lt;/i&gt; cross-sectional table onto your local computer&lt;/li&gt; &lt;li&gt;load it back up (so the downloading and importing can be skipped next time)&lt;/li&gt; &lt;li&gt;limit the table to the variables needed for an example analysis &lt;/li&gt; &lt;li&gt;create a &lt;a href="http://sda.berkeley.edu/D3/GSS10/Doc/gs100195.htm#COMPWT"&gt;weight&lt;/a&gt; and &lt;a href="http://sda.berkeley
.edu/D3/GSS10/Doc/gs100195.htm#SAMPLERC"&gt;primary sampling unit&lt;/a&gt; variable based on berkeley's specifications&lt;/li&gt; &lt;li&gt;construct the &lt;a href="http://faculty.washington.edu/tlumley/survey/html/svydesign.html"&gt;complex sample survey object &lt;/a&gt;&lt;/li&gt; &lt;li&gt;print statistics and standard errors matching the &lt;a href="https://github.com/ajdamico/usgsd/blob/250224ae9666e8d99e96d14869093eebdee56dd4/General%20Social%20Survey/GSS%201972-2010%20Polviews%20by%20Sex%20from%20Berkeley%20SDA.pdf?raw=true"&gt;target
replication table&lt;/a&gt;&lt;/li&gt; &lt;li&gt;loop through each confidence interval on that table as well, using shiny new software born from &lt;a href="https://stat.ethz.ch/pipermail/r-help/2012-September/324464.html"&gt;this thread&lt;/a&gt;&lt;/li&gt; &lt;/ul&gt; &lt;br /&gt; &lt;br /&gt; &lt;a href="https://github.com/ajdamico/usgsd/tree/master/General%20Social%20Survey"&gt;click here to view these two scripts&lt;/a&gt;&lt;br /&gt; &lt;br /&gt; &lt;br /&gt; &lt;br /&gt; for more detail about the general social survey (gss), visit:&lt;br /&gt; &lt;ul&gt; &lt;li&gt;&lt;a href="http://www3.norc.org/
gss+website/"&gt;norc's gss homepage&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href="http://sda.berkeley.edu/archive.htm"&gt;berkeley's sda archive homepage&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href="http://en.wikipedia.org/wiki/General_Social_Survey"&gt;wikipedia's gss homepage&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href="http://scholar.google.com/scholar?hl=en&amp;q=general+social+survey"&gt;google scholar results for general social survey&lt;/a&gt;&lt;/li&gt; &lt;/ul&gt; &lt;br /&gt; notes:&lt;br /&gt; &lt;br /&gt; berkeley's sda website currently hosts release #1 of the 1972-2012 cross-sectional gss file, w
hich is why the replication code above won't match &lt;a href="http://sda.berkeley.edu/quicktables/quickconfig.do?gss10"&gt;their posted quick tables&lt;/a&gt; exactly. i kept bugging them until they ran the 1972-2010 release #2 data set through their same code, &lt;a href="https://github.com/ajdamico/usgsd/blob/250224ae9666e8d99e96d14869093eebdee56dd4/General%20Social%20Survey/GSS%201972-2010%20Polviews%20by%20Sex%20from%20Berkeley%20SDA.pdf?raw=true"&gt;available in my github repository&lt;/a&gt;. those numbers mat
ch. squeaky wheel, baby.&lt;br /&gt; &lt;br /&gt; &lt;br /&gt; confidential to sas, spss, stata, and sudaan users: why are you still dialing up to the internet after we've discovered fiber optics? time to transition to r. :D