IMSTAT Procedure (Analytics)

Example 7: Crosstabulation with Measures of Association and Chi-Square Tests

Details

To compute measures of association of the row and column variable, you can add the MEASURE option to the CROSSTAB statement. ASSOCIATION is an alias for the MEASURE option. You can also request Chi-Square statistics for the test of independence between row and column variable with the CHISQ option.
The following statements request a crosstabulation of the Cylinders and Origin variables for the CARS data set. The statements also request measures of association and Chi-Square statistics. The NOMISS option is used to exclude levels of the variables that correspond to missing values.
libname example sasiola host="grid001.example.com" port=10010 tag='hps';

data example.cars; set sashelp.cars; run;

proc imstat data=example.cars;
    crosstab cylinders * origin / 1
        measures
        chisq
        nomiss; 2
quit;

Program Description

  1. The variables to use for the columns and rows are specified in the CROSSTAB statement.
  2. The NOMISS option excludes levels that have missing values. Note that by default the FREQ procedure excludes levels with missing values, whereas the IMSTAT procedure includes those as valid levels.

Output

Crosstabulation Results
Crosstabulation of Cylinders by Origin
Measures of Association Results
Measures of association of cylinders by origin
Chi-Square Statistics Results
Chi-Square statistics of cylinders by origin