Speaking Notes
PADM 5502
October 22, 2009
Dr. Neubauer
The purpose of this classroom exercise is for you to see how to 1) enter data into Excel, 2) import data from Excel into SPSS, 3) clean the data, 4) create new variables in sPSS, 5) tell SPSS about the missing value code, 6) add a variable label, 7) add value labels, 8) run frequencies, and 9) test a hypothesis using the Chi-Square statistic. This example assumes that the DV reflected in a hypothesis was measured using only one question on the survey instrument.
Using the files available by links above, this evening we will test the hypothesis that that gender is not related to willingness to relocate in the face of local economic decline.
First, you must import the entire Excel file into SPSS. Save the data file to the desktop. There is a dialog box that allows you to do this when you open SPSS.
Next, run frequencies on the entire dataset using the syntax editor in SPSS.
- File --> New --> Syntax Editor
- Type the following -- Freq all.
- With the cursor on the line you want to run, run the command as will be explained in class
- Study the result and notice any data that appears to be out of range. The number 99 was used to indicate missing data when the data file was created.
- Identify and correct any problems in the data. I would do this in Excel. I would then exit SPSS and start over, using the corrected data file. WHEN IN DOUBT always look at the coded surveys again to make the correction.
Now, run a freq on the gender variable only. -- freq gender.
- Notice that it needs a variable label and value labels.
- It is a good idea to create "new" variables before you begin working with them. That way you can easily go back to the variable in its original form.
- Type the following commands into the syntax editor and then run them one at a time.
- compute newgender = gender.
- freq newgender.
- variable labels newgender "Gender".
- Value labels newgender 1 'Female' 2 'Male'.
- Freq newgender.
- What has changed as a result of the commands above?
Now, there is a variable named "wouldmove"
It is a Likert with five values of response. We need to reduce the number of responses to three.
- compute newwouldmove = wouldmove.
- missing values newwouldmove (99).
- recode newwouldmove (1=1) (2=1) (3=2) (4=3) (5=3).
- variable labels newwouldmove 'Would relocate for a job".
- value labels newwouldmove 1 'Disagree" 2 'Undecided" 3 'Agree'.
- freq newwouldmove.
Okay. Now we have an independent variable with two values -- gender. We have a dependent variable with three values -- newwouldmove. We will now use the crosstabs command to test the hypothesis, using the Chi-Sq statistic. The general form of the command is as follows.
crosstabs tables = DV by IV/cells=count column/stat=chisq.
In this case the name of the DV is newwouldmove and the name of the IV is gender. tables=count column/
- Type this command into the syntax exitor and run it
- crosstabs tables=newwouldmove by gender/cells=count column/stat=chisq.
- If it runs correctly observe the output. Look at the value of p. The hypothesis says you do not expect to find a relationship. If p is .05 or larger, you have not found evidence of a relationship.
- In most hypotheses you are looking for a relationship. I used this because gender is an easy variable to use for as an example.