Crosstabs

 

Menu location: Analysis_Crosstabs.

 

This a two or three way cross tabulation function. If you have two columns of numbers that correspond to different classifications of the same individuals then you can use this function to give a two way frequency table for the cross classification. This can be stratified by a third classification variable.

 

For two way crosstabs, StatsDirect offers a range of analyses appropriate to the dimensions of the contingency table. For more information see chi-square tests and exact tests.

 

For three way crosstabs, StatsDirect offers either odds ratio (for case-control studies) or relative risk (for cohort studies) meta-analyses for 2 by 2 by k tables, and generalised Cochran-Mantel-Haenszel tests for r by c by k tables. For 2 by 2 by k tables the second category of the first classifier (rows) is taken as the exposed group, and the second category of the second classifier (columns) as the outcome of interest; with categories coded 0 and 1, for example, 1 is exposed and 1 is the outcome.

 

The categories of each classifier are put in the order of their labels: labels that are numbers in order of size, and after them the other labels in the order of their characters. A record with a missing value in one of the classifiers of a table is left out of the table.

 

If the first and second classifiers have different numbers of categories then you are asked whether to force the table to be symmetrical. If you agree, each classifier is given the categories of the other that it lacks, as empty rows or columns; this is what you want where the same classification has been made twice, as in a study of agreement. Rows and columns without counts take no part in the tests, their degrees of freedom or the measures of association.

 

Example

 

A database of test scores contains two fields of interest, sex (M=1, F=0) and grade of skin reaction to an antigen (none = 0, weak + = 1, strong + = 2). Here is a list of those fields for 10 patients:

 

Sex Reaction
0 0
1 1
1 2
0 2
1 2
0 1
0 0
0 1
1 2
1 0

 

In order to get a cross tabulation of these from StatsDirect you should enter these data in two workbook columns. Then choose crosstabs from the analysis menu.

 

For this example:

 

    Reaction
    0 1 2
Sex: 0 2 2 1
  1 1 1 3

 

We could then proceed to an r by c (2 by 3) contingency table analysis to look for association between sex and reaction to this antigen:

 

Contingency table analysis

 

Observed 2 2 1 5
% of row 40% 40% 20%  
% of col 66.67% 66.67% 25% 50%
         
Observed 1 1 3 5
% of row 20% 20% 60%  
% of col 33.33% 33.33% 75% 50%
         
Total 3 3 4 10
% of n 30% 30% 40%  

 

TOTAL number of cells = 6

 

WARNING: 6 out of 6 cells have EXPECTATION < 5

 

NOMINAL INDEPENDENCE

Chi-square = 1.666667, DF = 2, P = 0.4346

G-square = 1.726092, DF = 2, P = 0.4219

Fisher-Freeman-Halton exact P = 0.5714

 

ANOVA

Chi-square for equality of mean column scores = 1.5

DF = 2, P = 0.4724

 

LINEAR TREND

Sample correlation (r) = 0.361158

Chi-square for linear trend (M²) = 1.173913

DF = 1, P = 0.2786

 

NOMINAL ASSOCIATION

Phi = 0.408248

Pearson's contingency = 0.377964

Cramér's V = 0.408248

 

ORDINAL

Goodman-Kruskal gamma = 0.555556

Approximate test of gamma = 0: SE = 0.384107, P = 0.1481, 95% CI = -0.197281 to 1.308392

Approximate test of independence: SE = 0.437445, P = 0.2041, 95% CI = -0.301821 to 1.412932

 

Kendall tau-b = 0.348155

Approximate test of tau-b = 0: SE = 0.275596, P = 0.2065, 95% CI = -0.192002 to 0.888313

Approximate test of independence: SE = 0.274138, P = 0.2041, 95% CI = -0.189145 to 0.885455