Crosstabulations

he Crosstabulations dialog produces a table of counts for all combinations of specified categorical (factor) variables and returns the results as an ASCII formatted table. In addition, it calculates cell percentages and performs a Chi-square test for independence.

To construct a table of counts for use in further analyses, use the Tabulate dialog available from the Data menu.

To generate a contingency table

Choose Statistics __image\arrow5.gif Data Summaries __image\arrow5.gif Crosstabulations. The dialog shown below appears.

Model page

On the Model page, specify parameters to be used in the crosstabulation.

__image\crostab1.gif

In the Crosstabulations dialog, the Model page has the following options:

Data Set

Specify the name of the data set containing the columns and rows to be exported.

Variables

Use this only if each row represents multiple observations. Select the column that specifies the number of replications corresponding to each row.

Counts Variable

Use this only if each row represents multiple observations. Select the column that specifies the number of replications corresponding to each row.

Subset Rows

Enter an S-PLUS expression that identifies the rows to use in the analysis. To use all the rows in the data set, leave this field blank.

Method to Handle Missing Variables

Select an option to handle missing data. Click on the link for more information.

Results

Save As

Enter the name for the object in which to save the results of the analysis.

Print Results

Select this to print out the results of the analysis in the designated output window.

Options page

On the Options page, all of the options are selected by default. To clear any of the options, click the corresponding check box.

__image\crostab2.gif

In the Crosstabulations dialog, the Options page has the following options:

Drop Unused Levels

Suppress the display of any unused factor level in the contingency table.

Show Cell Proportions

Display the count in each cell as a proportion of the row total, the column total, and the grand total.

Show Marginal Totals

Display the row and column totals with the contingency table.

Run Chi-Square Test

Check this box to perform a Chi-Square test.

Decimal Places

Enter the number of decimal places with which to display each proportion.

Related S-Plus language functions

crosstabs, print.crosstabs