Professional Documents
Culture Documents
What is a Crosstabulation?
Joint frequency distribution of two or more class (ordinal/nominal) variables. Subdivision of one variable according to the values of another variable.
SPSS Example
Open the data set tastetest.sav. Data set consists of 30 subjects responding to a product called mulch. Mulch is produced in 3 colors: Red, Blue and Black. The 30 subjects were divided into 3 groups of 10 each. The three groups were randomly assigned the colored mulch.
Cont.
Their respective taste of the colored mulch were recorded. Open SPSS go to File > Open > Data. An Open File dialog box opens. Look for tastetest.sav. Double click on it to open it.
Cont.
Cont.
Output
color * taste Crosstabulation u t t 2 2 t 2 7 2 5 2 6 t 5 t
Interpretation
Note that the red colored mulch (red=1) has a lot more respondents saying that its taste is above average than the other colored mulches. Note that the black colored mulch (black = 3) has a lot more below average rating compared to the other colored mulches.
Click OK.
e ra
Bel ar
era a
el
era
un t
ed
B lu e
B la
M u l
Cont.
In this particular example N of cases (red) = N of cases (blue) = N of cases (black) = 10. In the case when these are not the same choose the option % of cases instead. Following that we can adjust the bars to be of equal length so that comparisons can be made.
Cont.
Observed Output
s te s
r b ve b ve ver
le
ver e
ver el
ver
r bel
ver
un t
ed
lu e
M u l
(
(
!% $ # " !
49
E3
E3 D3 GC B 3 A E3 D3 GC 2 E3 D F E3 D3 DCB F D3 DC B 3 3 A @ @
T
el er r r
lu e
ed
ck
Preferred Output
u n t
M u l l r
s te s c
el
er
er
er
le
er
e e
3 2
Cont.
Resultant Graph
M u lc h c o lo r
1 0 .0 % 1 0 0 .0 %
P erce nt
4 0 .0 %
R ed B lu e B la c k
0 .0 %
P I H
0 .0%
0 .0 %
0 .0 % F a r ab o v e a v e ra g e Above a v e r a ge A v e r a ge B e lo w a v e ra g e F a r b e lo w a v e r ag e
T a s te s c a le
Note
The default colors in the graph do not tally with the mulch colors. We need to edit the graph to make the colors the same as that of the product. The bar length are based on overall percentage. We need to change the bar lengths so that they are all the same, i.e. the % breakdown of colors are based on group size.
Edits
Double click on the graph to activate the Chart Editor. Click on the blue key box representing red mulch in the Mulch Color legend. All the blue sections of the bars are highlighted. Double click on the blue key box in the legend. A Properties dialog box opens.
Cont.
Click Apply.
Resulting Edit
UR X
TV
U R TR T SV
o er
U R TR T SR R Q
r er o
`Y Ya
.
`Y Yb
.
`Y Y c
.
`Y YYd
. l
ihR W W g f
ul h
lu e ed
`Y Yad
.
`Y Y
.
er
e lo er
UR TR S RQ
r er
TR W
UR
T ast
scal
e lo e
`Y Y
rce nt
o lo r
Resultant Graph
ul h
R e lu e la
l r
.8
P erce nt
e ra
ar a a era
e e
e ra
e a
el era
ar el a e ra e
T a s te s c a le
v v s t wr q p t wr s v t su s srq u t srq s p y y x y x y x yx x x
yx
Reorientate
lc c o lo r
Re ar e lo a e ra l e la c k e
e lo
era
era
e a
era
ar a
o e a
e ra
nt
Note
Note that the x-axis labels are all wrong. They should be in the form of decimals 0, 0. , 0.4, 0. , 0. and 1. Not 0%, 0. %, , 1%. Relabel them appropriately. You can also use 0%, 0%, , 100%. What can you interpret from this graph?
Resultant Graphs
Red Blue
Taste scale
Far above average Above average Average Below average Far below average Pies show counts
Black
ounts
Black
i k h g i k j i i ih ih g lk
Taste scale
Clustered Pie Charts with Taste as Panel and Color as Slices after Editing.
Far above average Above average Average
Mulch color
ed lue lac Pi
Below average
Measures of Association
Interval variables: Pearson Correlation Coefficient Ordinal variables: Spearman Rho Correlation Nominal & ordinal variables: Chi-Square Statistic
r!
n
nx xi i!1 i!1
n 2 i
n y yi i!1 i!1
n n 2 i
Cont.
16
n ! 16
16
x y
i i =1 16 i !1 16
!126128.1 ! 1621
x
i !1 16
! 1237.8 ! 97178.6
y y
i !1 2 i
x
i !1
2 i
! 165801
Cont.
r!
! 0.484
Interpretation
Body weight and blood glucose level have a weak affinity towards a linear relationship.
/
1 2 0 .0 0
lu c o s e le v e ls ( l
l)
1 0 0 .0 0 8 0 .0 0 6 0 .0 0
w ei
t (
n n n nr
.
nn nq
n n np
nn no
nn nm
SPSS Example
Run this data using SPSS. Type the data in the SPSS Data Editor. Name the first variable x. Label it weight (kg). Name the second variable y. Label it blood glucos level (mg/100ml). File > Save as sugar.sav
Cont.
Go to Analyze > Correlate > Bivariate. A Bivariate Correlations dialog box opens.
Check the Means and standard deviations and Cross-product and covariances boxes under Statistics. Click Continue.
Output
Descriptive St tistics t x t
Cont.
Correlations
x x Pearson Correlation Sig. ( -tailed) Sum of Squares and Cross-products Covariance N Pearson Correlation Sig. ( -tailed) Sum of Squares and Cross-products Covariance N 1 1419. 9 94. 0 1 .4 4 .0 3.4 4 . 3 1 1
y .4 4 .0 3.4 4 . 3 1 1 3.43
104. 9 1
= x
i !1
2 i
1 xi n i !1
n n n 2 i
n Sum of squares of x ! n x xi i !1 i !1
Similarly
um o squares o y
n
um o squares o y
! n y yi i !1 i !1
2 i
and
um o cross product o xy
n
Therefore
Sum o cross n product o xy r! Sum o Sum o n n squares o x squares o y
Next Week
More Measures of Association & Test of Hypothesis