

However, RECODE has more limitations too.įirst off, RECODE only replaces (ranges of) constants -such as 0, 99 or system missing values- by other constants. In many cases, RECODE is an easier alternative for IF. *IF: respondents meeting both conditions get result_2. *DO IF: respondents meeting both conditions get result_1. The syntax below sketches this idea.ĭO IF - ELSE IF Versus Multiple IF Commands If you use multiple IF commands instead, the last condition met by each case takes effect. If cases meet more than 1 condition, the first condition prevails when using DO IF - ELSE IF.IF is a conditional COMPUTE command whereas DO IF can affect other transformations -such as RECODE or COUNT- as well.IF is a single line command while DO IF requires at least 3 lines: DO IF, some transformation(s) and END IF.The main differences between DO IF and IF are that Some SPSS users may be familiar with DO IF. The minimum for females working fulltime is 36. The maximum for females not working fulltime is below 36. This table -shown below- is a nice way to check the results. Our syntax ends with a MEANS table showing minima, maxima, means and standard deviations per gender per group. means whours by gender by fulltime /cells min max mean stddev. add value labels fulltime 0 'Not working fulltime' 1 'Working fulltime'. if(gender = 1 & whours >= 40) fulltime = 1. if(gender = 0 & whours >= 36) fulltime = 1. *Set fulltime to 1 if whours >= 36 for females or whours >= 40 for males. We then set it to one if the year -extracted from the date of birth- is in the RANGE 1980 through 1989. The syntax below first computes our flag variable -born80s- as a column of zeroes. Let's flag all respondents born during the 80’s. Example 1 - Flag Cases Based on Date Function
Spss code range download#
For getting the most out of this tutorial, we recommend you download the file and try the examples for yourself. Example 3 - Compute Variable Differently Based on GenderĪll examples use bank.sav, a short survey of bank employees.Example 2 - Replace Range of Values by Function.Example 1 - Flag Cases Based on Date Function.In SPSS, IF computes a new or existing variableįor analyzing a selection of cases, use FILTER or SELECT IF instead.

SPSS eTutor by Dee Britton is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported Lic ense.SPSS IF – A Quick Tutorial By Ruben Geert van den Berg under SPSS A-Z & Basics If you have questions, please visit the disability services website Please note: If you need to request accommodations with content linked to on this guide or with your SPSS Software, on the basis of a disability, please contact Accessibility Resources and Services by emailing them at Requests for accommodations should be submitted as early as possible to allow for sufficient planning. Joyce Elliott for her careful edits and thoughtful suggestions. I would like to give special thanks to Dr. If you would like to see the codebook (the variable names and their corresponding questions), you can find this by clicking here. Other users of this guide who wish access the GSS data for practice purposes may do so by clicking here: gss08_1500cases. Undergraduate students studying social science research methods and social science statistics at Empire State College use SPSS and the GSS data for some course assignments.

The examples and screen shots used in this guide are based on the 2008 General Social Survey (GSS) data set, which contains information on 50 variables for a sample of 1500 U.S. I recommend that you keep a good statistics book handy as you conduct your quantitative analyses. Remember, SPSS will calculate what you request it does not determine the appropriateness or limitations of the test. It is essential that you have a good understanding of the statistical tests that you are conducting. I have written this eTutor to provide a brief introduction to SPSS analysis. Click on the tabs above to find links to specific SPSS instructions. SPSS gives the researcher the tools for describing variable statistics, analyzing two variables together, predicting numerical outcomes, and predicting identifying groups. Originally used with large mainframe computers and data punch cards, SPSS (Statistical Package for the Social Sciences) revolutionized quantitative data analysis.
Spss code range software#
SPSS, a statistical software package first released in 1968, continues to be a premier software for analysis of quantitative data.
