»  Home »  Products »  Stata 16 »  Import data from SPSS

Import data from SPSS

Highlights

  • Import an IBM SPSS file or a subset of it into Stata
  • Import a compressed IBM SPSS file or a subset of it into Stata
  • Convert dates and times from SPSS to Stata format
  • Import value labels
  • Properly handle missing values
See all features

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.

Let's see it work

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

importspss2.png

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

importspss3.png

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)

References

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).

Tell me more

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.

ORDER STATA   UPGRADE NOW

Stata

Shop

Support

Company


The Stata Blog: Not Elsewhere Classified Find us on Facebook Follow us on Twitter LinkedIn YouTube Instagram
© Copyright 1996–2019 StataCorp LLC   •   Terms of use   •   Privacy   •   Contact us