Professional Documents
Culture Documents
Session 8 SPSS Practical
Session 8 SPSS Practical
Let’s take a look at our sample questionnaire. It starts off with demographic questions, followed by 6
items on Life Orientation Test (optimism scores) and 20 items on Positive and Negative Affect Scale
(PANAS). The top right box shows a respondent number 703 who has answered this questionnaire.
Before diving into SPSS, it is always best to have a code book to be clear of the variable names to
give for the items as well as the coding instructions for it.
Now that the codebook is ready, we can enter the data to SPSS. An SPSS file has the file extension
.sav. You can open this file only if you have SPSS.
3) Data View shows the data that has already been entered. If you scroll down, you will see
that most of the data has already been entered except for respondent number 703.
4) Variable View shows the variables in the questionnaire and the characteristics of the
variables.
5) Let’s say we wish to check the values of marital status. At the marital status row, click at the
cell that intersect with the values column. Click at the little button.
6) You will see this.
Now that the data has been entered, it is best to always check that there are no errors before
analysing the data. This is known as cleaning the data.
Cleaning data
sex
Cumulative
Frequency Percent Valid Percent Percent
Valid MALES 186 42.4 42.4 42.4
FEMALES 253 57.6 57.6 100.0
Total 439 100.0 100.0
Look at the frequency tables to look out for weird data. Eg. Highest educ completed. There is a value
22. Another one is Optimism 3. Make the relevant corrections by typing the correct values in the
data view.
Once the data is cleaned, check what you wish to analyse. Refer to the table below.
Let’s take a look at the second research question. We need age groups and average optimism score.
Currently, the respondents write down their ages. As for optimism score, the questionnaire has 6
optimism items. So we need to make some modification known as data transformation.
We need to transform the data to put ages into 3 categories and to find the average optimism
scores.
Data Transformation
A new column called Age_cat is created. Click at Variable View and put the Values as
Check the questionnaire for any negative items. Op2, Op4 and Op6 are negatively worded. To
reverse code these 3 items, perform the following.
1) Transform ➔ Recode into Same Variable. Select Op2. Click Old and New Values.
2) At Old Value, type the Value as 1. Then at New Value, type the Value as 5. Repeat for the
others like below.
Now that the 6 optimism items are in the same direction, we would then need to find the average
optimism scores. The steps are in the next page.
Average Optimism Scores
2) Click Type & Label. For the Label, type Average Optimism Scores.
3) Type the Numeric Expression as seen above. Click OK.
H2: There is a significant difference in the optimism scores for the three age groups.
H3: There is no significant difference in the average optimism scores for males and females.
Null hypothesis
Chi-square test
2) Put one variable as the row variable and the other as the column variable.
3) Click on Statistics. Tick Chi-square and Phi and Cramer’s V. Click Continue.
4) Click on the Cells button. In the Counts box, tick Observed. In the Percentage section, click Row,
column and Total boxes.
Chi-Square Tests
Asymptotic
Significance (2- Exact Sig. (2- Exact Sig. (1-
Value df sided) sided) sided)
Pearson Chi-Square .122a 1 .726
Continuity Correctionb .052 1 .820
Likelihood Ratio .123 1 .726
Fisher's Exact Test .808 .411
Linear-by-Linear Association .122 1 .727
N of Valid Cases 439
a. 0 cells (0.0%) have expected count less than 5. The minimum expected count is 36.44.
b. Computed only for a 2x2 table
Sample Interpretation:
19.6% of the sample are smokers, 80.4% of the sample are non-smokers.
Sig value for Pearson chi square is 0.726 > 0.05 => do not reject null hypothesis. There is no
significant difference between gender and smokers.
Second research question
Null hypothesis
There is no difference in the optimism scores for the three age groups.
ANOVA
4) Click Options. Select Descriptive, Homogeneity of variance test, and Means Plot.
5) For missing values, make sure there is a dot in the option marked Exclude cases analysis by
analysis. Click Continue.
7) Continue. OK.
SPSS Output
Descriptives
Average Optimism Score
95% Confidence Interval for
Std. Mean
N Mean Deviation Std. Error Lower Bound Upper Bound Minimum Maximum
18 - 29 147 3.5601 .75850 .06256 3.4365 3.6837 1.17 5.00
30 - 44 153 3.6841 .69121 .05588 3.5737 3.7945 1.67 5.00
45+ 136 3.8125 .76105 .06526 3.6834 3.9416 1.33 5.00
Total 436 3.6823 .74171 .03552 3.6125 3.7522 1.17 5.00
Sample Interpretation
According to the Descriptives table, respondents who are at least 45 years old have the highest
average optimism score of 3.81.
- Tests whether the variance in optimism scores is the same for all three groups
- Sig. value of 0.360 > 0.05 => did not violate the homogeneity of variances assumption
ANOVA
Multiple Comparisons
Dependent Variable: Average Optimism Score
Tukey HSD
Mean 95% Confidence Interval
(I) Age categories (J) Age categories Difference (I-J) Std. Error Sig. Lower Bound Upper Bound
18 - 29 30 - 44 -.12401 .08505 .312 -.3240 .0760
45+ -.25241* .08761 .012 -.4585 -.0464
30 - 44 18 - 29 .12401 .08505 .312 -.0760 .3240
45+ -.12840 .08679 .302 -.3325 .0757
45+ 18 - 29 .25241* .08761 .012 .0464 .4585
30 - 44 .12840 .08679 .302 -.0757 .3325
*. The mean difference is significant at the 0.05 level.
The mean score for Group 1 (18 – 29 years) was significantly different from Group 3 (45+ years).
Third research question
Null hypothesis
There is no significant difference in the average optimism scores for males and females
Independent t-test
4) Click Define groups. Type in the numbers (code) for each group. For example, let 1 = males, 2 =
females. Then in Group 1 box, type 1, and in Group 2 box, type 2.
5) Continue → OK.
SPSS Output
Group Statistics
sex N Mean Std. Deviation Std. Error Mean
Average Optimism Score MALES 186 3.6604 .67191 .04927
FEMALES 250 3.6987 .79059 .05000
Sample Interpretation:
1) Levene’s test sig value is 0.041 < 0.05 => equal variances are not assumed
2) The sig value for Equality of Means is 0.586 > 0.05. ➔ do not reject null hypothesis ➔ There
is no statistical difference in the average optimism scores for males and females.