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).
Learn more about importing IBM SPSS files into Stata in the Stata Data Management Reference Manual; see [D] import spss.
Learn more about Stata's data importing tools in the Stata Data Management Reference Manual; see [D] Overview of importing data into Stata.
Learn
Free webinars
NetCourses
Classroom and web training
Organizational training
Video tutorials
Third-party courses
Web resources
Teaching with Stata
© Copyright 1996–2024 StataCorp LLC. All rights reserved.
×
We use cookies to ensure that we give you the best experience on our website—to enhance site navigation, to analyze usage, and to assist in our marketing efforts. By continuing to use our site, you consent to the storing of cookies on your device and agree to delivery of content, including web fonts and JavaScript, from third party web services.
Cookie Settings
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.
This website uses cookies to provide you with a better user experience. A cookie is a small piece of data our website stores on a site visitor's hard drive and accesses each time you visit so we can improve your access to our site, better understand how you use our site, and serve you content that may be of interest to you. For instance, we store a cookie when you log in to our shopping cart so that we can maintain your shopping cart should you not complete checkout. These cookies do not directly store your personal information, but they do support the ability to uniquely identify your internet browser and device.
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.