Vous êtes sur la page 1sur 42

SPSS Instructions

SPSS
SPSS
SPSS
SPSS
1|Page
SPSS for WINDOWS

This handout is designed to help you get started with SPSS and will give you the
basic information required to enter data and carry out basic statistical tests. It is
not intended to replace the essential reading.

The first thing you need to do is access SPSS via the following web site:
http://www.uhi.ac.uk/myuhi - this will take you to the following screen:

You login using the same login details as you use for GroupWise. If you have
any issues accessing the site, please contact the UHI Helpdesk. Helpdesk
contact information is available here; http://www.uhi.ac.uk/en/lis/

After login to the system you will be presented with the following screen:

2|Page
The MyUHI service should launch automatically dependent on the type of
browser used, if not click on the monitor icon in the centre of the screen.

When the system fully launches, it will look like this. Click on the start icon and
locate IBM SPSS Statistics form the programs list.

3|Page
We are finally ready to start. We will start by looking at basic navigation between
the two main windows

When the programme opens select type in data. The next window to come up
is the data entry window which looks like this:

4|Page
As you can see it says data view in the bottom left hand corner. To move from
data view to variable view you just click on the variable view. The following
screen will come up:

5|Page
These are the two main pages that you will use when entering data. The data
view is where you enter the data and the variable view is where you set
parameters or guidelines for the data you are going to enter.

You will notice that along the top there is a tool bar and, as with word, when you
run your mouse over the tools it will tell you what it does. You will be unlikely to
use many of these but there is one I would like to draw your attention to. The
one fourth the right (Value Labels) with an A, a number 1 and arrows going to
each is one you may use regularly. This allows you to change numbers to words
and make your data set easier to read. This will become more apparent when
we do an example.

Before we do an example we will explore the main functions of the variable view.

Each row in the variable view relates to a column in the data view and allows us
to set rules for the data. The first one allows us to name our columns so we

6|Page
remember what variable we are dealing with. The second one allows us to
choose the type of data we are entering and gives us the following choices:

In most cases it will be numeric data so you do not need to worry about the rest.

The next two columns (width and decimals) allows you to determine the size of
the data you can enter and the number of decimal places you will probably
never need to adjust this.

The final columns I want to look at is the values column. You will notice above
that I put gender in as the variable name. The values column allows us to turn
numbers in to words as we will see below.

7|Page
When you click on the small grey box a new window opens which alls you to put
in values labels, I gave 1 the value male and 2 the value female. If you now
return to the data view you can enter data.

8|Page
You can see from this that the first column now has a title Gender. I have also
entered some data to represent the males and females in a study. It is very easy
when you are dealing with just two variables to remember what the 1 and 2 stand
for but when you have a great many variable you may want to click on the Value
Labels icon to make it clearer for you. This has been done below.

We will now go through all the SPSS exercises we need to do for this modules.
All the data needed is at the end of the handout.

9|Page
Chi-square.

This section will go through the process of carrying out a Chi-square test. The
Chi-square test we will look at is the chi-square for independence which is used
to establish if two categorical variables are related. In the example we are using
we will look at a fictitious data set for treatment with a new drug and 6 month
survival.

You will see below that data for 50 people have been entered and both types of
data have been given value labels.

10 | P a g e
You ten go to ANALYZE, DESCRIPTIVE STATISTICS, and CROSSTABS.

Once this is done a new box appears and you transfer Gender to the rows and
Car to the Columns.

11 | P a g e
Once this is done you click on the Cells box and click on both observed and
expected.

You then click on continue to get back to the crosstabs box. When this is done
you then click on the Statistics box. From the statistics box you select Chi-
square - see below. You then click on Continue to get back to the crosstabs box
and click on OK to generate your results.

12 | P a g e
The output window then opens with the following results:

Case Processing Summary

Case Processing Summary

Cases
Valid Missing Total
N Percent N Percent N Percent
Treat * Surv iv e 50 100.0% 0 .0% 50 100.0%

13 | P a g e
Treat * Survive Crosstabulation

Surv iv e
Y es No Total
Treat Y es Count 14 11 25
Expected Count 12.5 12.5 25.0
No Count 11 14 25
Expected Count 12.5 12.5 25.0
Total Count 25 25 50
Expected Count 25.0 25.0 50.0

Chi-Square Tests

Asymp. Sig. Exact Sig. Exact Sig.


Value df (2-sided) (2-sided) (1-sided)
Pearson Chi-Square .720(b) 1 .396
Continuity
.320 1 .572
Correction(a)
Likelihood Ratio .722 1 .396
Fisher's Exact Test .572 .286
Linear-by-Linear
.706 1 .401
Association
N of Valid Cases 50
a Computed only for a 2x2 table
b 0 cells (.0%) have expected count less than 5. The minimum expected count is 12.50.

The two lines which I have highlighted are the important ones. The line in yellow
gives you the result off the chi-square test: X2 = 0.720, df, 1, p = .396 (NS). I
have put NS in brackets following the P-value to indicate that the results are not
significant. This tells you that there is not a significant difference between what
was found and what you would expect. When you do a chi-square test with small
samples you sometimes gets cells with a count of less than 5 I have highlighted
this line in blue. When this happens the result of the chi-square test is not robust

14 | P a g e
so you are better giving the results of the Fishers exact test which I have
highlighted in green.

Now read the section on the rationale of a chi-square test in the core text to allow
you to supplement your notes and understanding: Field, A. (2009).
DISCOVERING STATISTICS USING SPSS. Sage, London.

You should now be able to carry out the chi-square test and interpret the data
from the SPSS output. Now carry out the chi-square exercises in the workbooks
the instructor sends you. You will be required to submit one, or more of these, as
part of assessment 2.

15 | P a g e
Correlations

This section will deal with two different types of correlation. A correlation
calculation is carried out to see if a change in one variable results in a change in
another variable. There are two correlation tests that we are going to look at; the
first is Pearsons product-moment correlation an Spearmans correlation
coefficient, the former being a parametric test, the latter a non-parametric one.

Once you have entered the data a Pearsons correlation is a very easy test to
carry out. Before you do so it is always good to generate a graph so you can see
what the data looks like. I have entered some fictitious concerning the number of
churches there are in an area and the number of violent crimes that take place in
an area.

To do this you go to GRAPHS on the menu bar and then down to


SCATTER/DOT and click on that.

16 | P a g e
You then click on SIMPLE and then DEFINE, this will then take to the page that
allows you to select your variables for the Y axis and the X axis of your graph.

Highlight the variable you want on the Y axis and transfer it to the Y axis box and
do the same with the variable for the X axis box and then click on OK.

17 | P a g e
You can see from the graph below that there appears to be a positive correlation
between the two variables. The correlation is positive because when one
variable increases so does the second variable. It would be a negative
correlation if when one variable increases the other decreases.

You can add titles to graphs in SPSS by right clicking on them.

18 | P a g e
To carry out the Pearsons correlation you go to ANALYSE, CORRELATE,
BIVARIATE. (see below)

This will take you to bivariate correlation page where you transfer both variables
into the variables box and then tick the Pearsons box.

19 | P a g e
When you click OK the following output will be generated:

Correlations

Churches Violent
Churches Pearson Correlation 1 .893(**)
Sig. (2-tailed) .000
N 12 12
Violent Pearson Correlation .893(**) 1
Sig. (2-tailed) .000
N 12 12
** Correlation is significant at the 0.01 level (2-tailed).

This gives you two correlations (they are both the same): how a change in the
number of churches affect the number of violent crimes and how a change in the
number of violent crimes affect the number of churches. The value of this
correlation is 0.893. This is a very high correlation coefficient. Correlation
coefficients can range from -1 to +1. The closer the figure is to 1 or -1 the
stronger the correlation. A value of 0 means no correlation. For this result you
would write: r=0.893, n =12, p< .005 (figures highlighted in yellow above). This
result is very significant which means that when one variable increases so does
the second variable.

Now read the section on the rationale of the Pearsons correlation in the core text
to allow you to supplement your notes and understanding: Field, A. (2009).
DISCOVERING STATISTICS USING SPSS. Sage, London.

If either or both of the variables involved in the design are non-parametric then a
Spearmans correlation must be used. Spearmans correlation is often used for
ranked data. For example, A comparison was made between the number of
hours spent playing computer games and sociability as assessed by peers. Both
dimensions were measured on a ten point scale where 10 was more than 10
hours playing computer games and 1 was less than one hour playing computer

20 | P a g e
games. With regard to sociability 10 was very sociable and 1 was not at all
sociable. You follow exactly the same procedure as you did for the Pearsons but
this time you click on the box that says Spearmans. The results generated are
as follows:

Correlations

GAME Social
Spearman's rho GAME Correlation Coefficient 1.000 -.902(**)
Sig. (2-tailed) . .000
N 10 10
Social Correlation Coefficient -.902(**) 1.000
Sig. (2-tailed) .000 .
N 10 10
** Correlation is significant at the 0.01 level (2-tailed).

This time you will see that we have a very large negative correlation: the more
time people spend playing computer games that less sociable they are or at least
the less sociable their friends think they are. These results would be written as:
rho = -0.902, N= 10, p< .005.

Now read the section on the rationale of the Spearmans correlation in the core
text to allow you to supplement your notes and understanding: Field, A. (2009).
DISCOVERING STATISTICS USING SPSS. Sage, London.

You should now be able to carry out the Pearsons and Spearmans correlation
test and interpret the data from the SPSS output. Now carry out correlation
exercises in the correlation work books the instructors sends you. You will be
required to submit one, or more of these, as part of assessment 2.

21 | P a g e
T-test (related) and Wilcoxon

These two tests are used to compare the results generated by the same group of
participants. This is called a repeated measures design, a related design or a
within subjects design. There are three different names but they all mean the
same: the same participants take part in each condition of the experiment or test
being carried out.

First we will look at the t-test. This test compares the means of each group to
see if they are different. In this example I am considering a reading intervention.
I gave each child a reading test to see what their reading ability was and then I
taught them to use phonics when reading and gave them a second reading test
to see their new score. What I want to know is whether using phonics has
improved the reading ability of the children.

To do a related t-test you go to ANALYSE, COMPARE MEANS, PAIRED


SAMPLES T-TEST.

22 | P a g e
This will then bring up the dialogue for the t-test. You transfer both variables over
and click on OK.

The results generated by doing this are as follows:

Paired Samples Statistics

Std.
Std. Error
Mean N Deviation Mean
Pair Before 83.2105 19 25.21591 5.78493
1 Phonic
85.4211 19 26.29811 6.03320
s

Paired Samples Correlations

23 | P a g e
Correlati
N on Sig.
Pair Before &
19 .997 .000
1 Phonics

24 | P a g e
Below is the final part of the of the SPSS output for a related t-test.

Paired Samples Test

Sig. (2-
Paired Differences t df tailed)
Std. 95% Confidence
Std. Error Interval of the
Mean Deviation Mean Difference
Lower Upper
Pair Before - - - -
2.25041 .51628 -4.282 18 .000
1 Phonics 2.21053 3.29519 1.12587

The important values are highlighted in yellow. The value t is the actual value of the calculation and the value you would
use if you had calculated this by hand to look up the statistical tables. The degrees of freedom are indicated by df and
they would also have been used to look up statistical tables. The final figure given is the significance level (0.000) which
is very significant. You need to give all these details in the results section when you right up a report. You would say that
there was a significant difference in reading performance before and after the teaching of phonics (t= -4.282, df = 18, p <
.001, two tailed).

25 | P a g e
Now read the section on the rationale of the related t-test in the core text to allow you to supplement your notes and
understanding: Field, A. (2009). DISCOVERING STATISTICS USING SPSS. Sage, London.

26 | P a g e
Now we will look at the Wilcoxon signed ranks test which is the non-parametric
version of the related t-test. The data is entered into SPSS in the normal way,
You then go to ANALYSE, NONPARAMETIC, LEGACY DIALOGS, 2 RELATED
SAMPLES and click.

This brings up the dialogue box and you transfer both variable over and select
Wilcoxon. You should also select exact as we have a small sample.

27 | P a g e
You then click on OK for the analysis to be carried out and the following output is
given:

Wilcoxon Signed Ranks Test

Ranks

Mean Sum of
N Rank Ranks
Postmedia - Negative
2(a) 4.00 8.00
premedia Ranks
Positive
8(b) 5.88 47.00
Ranks
Ties 0(c)
Total 10
a Postmedia < premedia
b Postmedia > premedia
c Postmedia = premedia

The column in yellow gives you the number of positive ranks, the number of
negative ranks and the number of tied ranks you can check these against the
table in section 9 if you wish. The next column gives you the mean rank and the
final column gives you the sum of ranks, again, you can check them against the
table in section 9.

28 | P a g e
a
Test Statistics

Postmedia -
Premedia
b
Z -2.019
Asymp. Sig. (2-tailed) .043

a. Wilcoxon Signed Ranks Test


b. Based on negative ranks.

The first figure I have highlighted here in blue is the z-score. Many non-
parametric tests give a z-score rather than a W-score (for Wilcoxon) SPSS
does this as it is a more appropriate score, you do not see it in many text books
as it involves extra calculations but SPSS does it automatically. The important
figures here are highlighted in green. You can see that the first one is Asymp sig
(2-tailed) this is the assumed level of significance for a two tailed test if your
hypothesis was one-tailed you would just divide this number by two to give the
one-tailed significance. As it was a small sample we have here we clicked on the
exact box so the two figures below the Asymp sig (2-tailed) are the exact
significance for a two-tailed and one-tailed hypothesis.

This result should be written as: There was a significant difference in the
participants opinion of catching swine flu following media reports (z = - 2.019, N-
ties = 10, p = .023, one-tailed).

Now read the section on the rationale of the Wilcoxon signed-ranks test in the
core text to allow you to supplement your notes and understanding: Field, A.
(2009). DISCOVERING STATISTICS USING SPSS. Sage, London.

29 | P a g e
You should now be able to carry out the related t-test and the Wilcoxon signed-
ranks test and interpret the data from the SPSS output. Now carry out the
related t-test and Wilcoxon signed-ranks test exercises sent to you by your
instructor. You will be required to submit one, or more of these, as part of
assessment 2.

Unrelated t-test and Mann Whitney

These are the final two tests we will be looking at in RM 2. The first one we will
look at is the unrelated t-test. For this you enter the data in the normal way and
apply the appropriate value labels. You then go to ANALYZE, COMPARE
MEANS, INDEPENDENT SAMPLE T-TEST.

This brings up the dialogue box where you put the test variable (expenses) into
the test variable box and the grouping variable (party) into the grouping variable
box. You then define the groups with the number used to code the different
groups, in this case it was 1 and 2. You then click on continue and OK for the
output page to appear.

30 | P a g e
31 | P a g e
The following output will be produced:

Group Statistics

Std.
Std. Error
Party N Mean Deviation Mean
Expens Conservat 148885 9307.6954 2081.2
20
es ive .3500 6 6398
Labour 146388 15110.048 3378.7
20
.5500 69 0960

32 | P a g e
Independent Samples Test

Levene's Test for


Equality of
Variances t-test for Equality of Means
95% Confidence
Std.
Interval of the
Mean Error
Difference
Sig. (2- Differenc Differenc
F Sig. t df tailed) e e Lower Upper
Expens Equal -
2496.80 3968.29 10530.1
es variances 3.705 .062 .629 38 .533 5536.58
000 161 8638
assumed 638
Equal -
2496.80 3968.29 10583.9
variances not .629 31.604 .534 5590.31
000 161 1690
assumed 690

The first table gives you the means and standard deviations for both conditions and as you can see there is quite a
difference between the standard deviations. You will recall that one of the assumptions of parametric tests is

33 | P a g e
homogeneity of variance and one of the advantages of this test is that it tells you if the data is appropriate. The number
highlighted in yellow tells you that it is fine on this occasion to use this test as this figure is greater than .05.
The important figures for reporting this result are highlighted in green, these are the t-value, the degrees of freedom and
the significance level. The significance reported here is for a two-tailed test. If you want to get the significance level for a
one-tailed test you would just divide this figure by 2. We would right these results as follows: there are no significant
differences between the expenses claimed by the two main parties (t = 0.629, df = 38, p =.533 NS).

Now read the section on the rationale of the unrelated t-test in the core text to allow you to supplement your notes and
understanding: Field, A. (2009). DISCOVERING STATISTICS USING SPSS. Sage, London.

34 | P a g e
The final test that we are going to look at is Mann Whitney which is the non-
parametric version of the unrelated t-test. For this test we will use the example
from section 10 concerning recall of important facts from a pamphlet, one with
just a narrative and one with pictures and bullet points. The data is entered in the
normal way. You then click on ANALYSE, NONPARAMETRIC, LEGACY
DIALOGS, 2 INDEPENDENT SAMPLES.

This will bring up the dialogue box. You enter the test variable (recall) into the
test variable box and you enter the grouping variable (presentation) into the
grouping variable box. You then define the grouping variables as 1 and 2, click
on continue and finally click on OK to produce the output.

35 | P a g e
The following output will be produced:

Ranks

Presentati Mean Sum of


on N Rank Ranks
Reca Narrative 10 7.75 77.50
ll picture 10 13.25 132.50
Total 20

Test Statistics(b)

Recall
Mann-Whitney U 22.500
Wilcoxon W 77.500
Z -2.108

36 | P a g e
Asymp. Sig. (2-
.035
tailed)
Exact Sig. [2*(1-
.035(a)
tailed Sig.)]
a Not corrected for ties.
b Grouping Variable: Presentation

The important figures are highlighted in yellow. The first one is the Mann
Whitney value, this is the value you would use if you were looking up statistical
tables and the value that you would report in your results section. The second
one is the two-tailed significance level. You would report these results by saying:
there is a significant difference in recall for important items depending on the
presentation of these items (U = 22.500, N1 = 10, N2 = 10, p = .035, two-tailed).

Now read the section on the rationale of the Mann Whitney in the core text to
allow you to supplement your notes and understanding: Field, A. (2009).
DISCOVERING STATISTICS USING SPSS. Sage, London.

You should now be able to carry out the Mann Whitney and interpret the data
from the SPSS output. Now carry out the unrelated t-test and Mann Whitney
exercises sent to you by your instructor. You will be required to submit one, or
more of these, as part of assessment 2.

37 | P a g e
Data for Chi-square.

Treatment Survival
1 1
1 1
2 1
2 1
1 2
2 2
1 1
2 1
2 2
2 1
1 1
2 2
1 2
2 2
2 2
2 1
1 2
1 1
2 2
1 1
2 2
1 1
1 2
1 2
2 2
1 2
1 1
1 2
2 1
2 1
2 1
2 2
2 2
1 2
1 1
2 2
2 1
1 2
1 1
2 2
1 1
2 2

38 | P a g e
2 2
1 2
2 1
1 1
1 1
2 1
1 1
1 2

Data for Pearsons correlation

Churches Violent
6 36
19 60
27 92
42 115
17 61
12 36
23 63
30 88
28 88
25 74
26 50
23 55

Spearmans data

Games Social
10 2
10 3
7 4
9 1
2 8
2 7
1 9
6 5
5 5

39 | P a g e
4 4

DATA for related t-test

Before Phonics
50 53
89 87
115 117
70 73
79 77
105 110
115 119
86 90
66 67
99 101
57 57
59 59
71 72
85 86
72 76
45 48
66 68
133 139
119 124

DATA for Wilcoxon signed ranks test

Premedia Postmedia
6 10
8 10
6 4
1 5
10 8
2 5
3 5
8 9

40 | P a g e
1 5
3 5

DATA for unrelated t-test where 1= Conservative and 2 = Labour

Party Expenses
1 138415.00
1 137748.00
1 135695.00
1 146192.00
1 150370.00
1 147498.00
1 160630.00
1 140359.00
1 143106.00
1 158669.00
1 153378.00
1 159121.00
1 131899.00
1 160198.00
1 161300.00
1 141963.00
1 149397.00
1 160005.00
1 148448.00
1 153316.00
2 146530.00
2 134515.00
2 173556.00
2 157094.00
2 164458.00
2 145285.00
2 151975.00
2 134309.00
2 133933.00
2 112338.00
2 147572.00
2 131324.00

41 | P a g e
2 164699.00
2 156209.00
2 165621.00
2 149036.00
2 131574.00
2 153906.00
2 132884.00
2 140953.00

DATA for Mann Whitney test.

Condition A Condition B
6 6
7 8
4 5
8 8
5 7
4 9
6 9
7 10
8 8
3 6

42 | P a g e

Vous aimerez peut-être aussi