One of the first tasks in any research project is reading in data. import spss allows us to bring IBM® SPSS® files (version 16 or higher) and compressed IBM SPSS files (version 21 or higher) into Stata. We can import the entire dataset or only a subset of it. Dates, value labels, and missing values are all converted properly from SPSS to Stata format.
We want to use the General Social Survey (GSS) for 2018, which we have in SPSS (.sav) format. The GSS gathers demographic and socioeconomic information about individuals and also records their perceptions about social, cultural, and economic issues.
The dataset we are interested in is GSS2018.sav. To bring it into Stata, we open the dialog box by clicking on File > Import > SPSS data (*.sav). We select the GSS2018.sav dataset and get
We can now import all the data or only a subset.
In this case, we are interested in data about people's confidence in different institutions. We would like to see confidence in the military (CONARMY), business and industry (CONBIZ), Congress (CONCONG), and the courts and legal system (CONCOURT).
Note that the variables have uppercase names in this SPSS file. We want all of them to be in lowercase. Under Variable case:, we select the option Lower.
Now we have
After clicking OK, our data are in Stata and are ready for us to analyze.
As always, we could have used the command line instead of the dialog box. Here is what we would have typed:
. import spss CONARMY CONBIZ CONCONG CONCOURT using GSS2018, case(lower)
Smith, T. W., M. Davern, J. Freese, and S. L. Morgan. 2019. General Social Surveys, 1972–2018 [GSS2018.sav]. Sponsored by National Science Foundation. Chicago: NORC.
1 data file (64,814 logical records) + 1 codebook (3,758 pp.). (National Data Program for the Social Sciences, no. 25).
Classroom and web training
Teaching with Stata
Statalist: The Stata Forum
Last updated: 16 November 2022
StataCorp LLC (StataCorp) strives to provide our users with exceptional products and services. To do so, we must collect personal information from you. This information is necessary to conduct business with our existing and potential customers. We collect and use this information only where we may legally do so. This policy explains what personal information we collect, how we use it, and what rights you have to that information.
These cookies are essential for our website to function and do not store any personally identifiable information. These cookies cannot be disabled.
Please note: Clearing your browser cookies at any time will undo preferences saved here. The option selected here will apply only to the device you are currently using.