Cross tabulation (including matching) and Frequencies

Tables variable1 [variable2  variable#] [/options]
Tab

v2.0 Examples Options Reference Other Commands How to...

Description:

The TABLES command does a cross-tabulation or a frequency of the specified variable(s). The behaviour of the command and the output you get will depend basically of the option part.
If only ONE variable is specified and no option are given, TABLES will count each category for the specified variable and give the absolute and relative frequencies for each category.
If only TWO variables and no option are given, values of the first variable will appear across the top of the table, and those of the second variable will be on the left margin of the table. Cells contain counts of records matching the values in the corresponding marginal labels.
If more than two variables are provided, the command will produce stratified cross tabulation of the first two by all possible combination of the rest.
The command TABLES * /F will produce frequencies for all the variables in your questionnaire, a convenient way to begin the analysis of a new data set.
FREQ with a series of variable names following, separated by spaces, will do separate frequencies for each of the variables listed if you use the /F option.

For outbreak investigation you can use the option /OA.
With that option, TABLES will create a summary table displaying attack rates for exposed and non exposed, Relative Risks (asuming you are in a Cohort Study), Chi Square and p values. You can also ask for Odds Ratio, a 2x2 table for each exposure variable and other statistics. (see list of options above).
The general syntaxis for that specific use of TABLES is:
TAB OUTCOME EXP1 [EXP2...EXP#] /OA [other options]
where:
OUTCOME is the variable where you classify your cases (default value for case is the highst in that variable). Use /SD to reverse that order.
EXP# is a list of exposure variables.



TopOutput:


			Sex:
_______________________________________________________
Ill?	F	%	M	%	Total	%
N	14	{48.3}	15	{51.7}	29	{100.0}
Y	30	{65.2}	16	{34.8}	46	{100.0}
_______________________________________________________
Total	44	{58.7}	31	{41.3}	75	{100.0}
_______________________________________________________
Chi2= 2.11 Df(1) p = 0.1468Fisher exact: p= 0.1588
 


The real output can be different depending on the options used (see below)


Examples and Hints
TABLES SEX                          (A frecuency of SEX)
TABLES SEX ILL /RP /CP                      (A cross tabulation of SEX by ILL with row and column percentages)
TABLES FOOD ILL SEX /t /o              (A cross tabulation of FOOD by ILL stratified by SEX, with testing and odds ratios)
TABLES OBESITY SMOKER /q            (A cross tabulation that will perform the calculations without showing the output table)
Notice:
TABLES and TAB are equivalent
To get Odds Ratios, RR use options (see below)
Related Commands:
Stattable describe boxplot

Options: Top
/F
/CUM
/CI
/S
/FV
/CT
/OA
/OBS
/W=var
/v
/vl
/vn
/vnl
/M or /Missing
/Q or /Quiet
/NT
/NC
/T
/EX
/GAM
/ADV
/RR
/O
/SA
/R /C /TP
/D#
/PCT
/Sxxxx[=#]
 
Calculates Frecuency Distribution if more than one variable are specified
Includes Cumulative Percents in a Frecuency Distribution
Calculates 95% Confidence Intervals in a Frequency table or for Attack rates if /OA option is used(see below)
Display a summary table of N and relevant statistics (?)
Show table as a compact table of first versus variable versus remaining
Show compact table
Calculate Attack rates and Relative Risks during Outbreak Analysis.
Displays a 2x2 table for each "exposure" variable if /OA is used
Uses the specified variable in the option as weigth variable
Displays values only (no labels)
Displays values and value label
Displays variable name only
Shows variable name and variable label
Includes observations with missing data (.) or defined missing values
Add an extra table with a summary of Chi square, p values, etc.
Do not show tables at all
Hide Subtables (if stratified analysis)
Hide crude - unstratified table (if stratified analysis)
Chi square
Exact test
Goodmann and Kruskals Gamma
Extended and advanced tests
Risk Ratio
Odds Ratios (calculated as EpiInfo 6 MLE estimates)
Reverse tables for 2x2 estimation, outcome== and Exposure=0 top left when codes are 0 and 1
Percentages of Row (/R or /RP), column (/C or /CP) and Total (/TP)
Number of decimals in percentages, where # can be 0,1 or 2
Place each type of percentages in separated columns (default is all in the same column)
Sorting, where x can be:SA SD SLA SLD SRA SRD SCA SCD SRAT SCAT CDR=row or C=column;A=Ascending or D=Descending;L=Label columns;T=Total columns; #Column number

Output variables: Top
$RR#
$RRUL#
$RRLL#
$Df#
$Fisher#
$Chi#
$pChi1#
$pExact#
$Gamma#
$partGamm#
$pGamma#
$ppartGamm#
$McChi
$summRR
$sumRRUL
$sumRRLL
$sumChi
$psumChi
$Total#
$TBLWEIGHT
$TABLES
$TABLETYPE
$TABLE - try: ? $table($rows,$cols-1) totals, e.g.: $table(0,1) grand total: $table(0,0)
$LABELS - try: ? $labels(0,1)
$ROWS
$COLS
Relative Risk for table # (1 for first table and so on)
Upper limit of 95% CI for RR in table #
Lower limit of 85% CI for RR in table #
Degree of freedom in table #
p value for Fisher exact test in table #
Chi square value for table #
p value corresponding to the Chi square value in table #
P value for exact test in table #
Gamma Value in table #
Partial Gamma value in table #
p value of Gamma in table #
p value of Partial Gamma in table #
Chi square for Motecarlo in table #
RR for summary table
Upper limit of 95% CI of RR in summary table
Lower limit of 95% CI of RR in summary table
Chi square for summary table
p value of Chi square of summary table
Total number of individuals in table #
NOTE: You can get the values of those variables using var results after a TABLES command

Output definition:
set table design =line[box][filled][system]
set table design summary =line[box][filled][system]
set table definition
Main tables design will be acording with this command. The default value is line
Summary table design will be acording with this command. The default value is line
See the set table definition help for more information about Column and Row percents

References: No specific references Top