Coding With Fun
Home Docker Django Node.js Articles Python pip guide FAQ Policy

SAS card side


May 27, 2021 SAS


Table of contents


The box-side test is used to verify the association between two classification variables. I t can be used to test the degree of dependency and independence of variables. S AS uses the PROC FREQ and chisq options to determine the results of the card side test.

Syntactic

The basic syntax for applying PROC FREQ to card-side testing in SAS is:

PROC FREQ DATA = dataset;
TABLES variables 
/CHISQ TESTP=(percentage values);

The following is a description of the parameters used:

  • Dataset is the name of the dataset.
  • A variable is the variable name of the dataset used in the box square test.
  • The value in the percentage TESTP statement represents the percentage of the level of the variable.

Cases

In the following example, we consider SASHELP for the dataset. T he variable named type in CARS is checked by the card side. T he variable has six levels, and we assign percentages to each level based on the design of the test.

proc freq data = sashelp.cars;
tables type 
/chisq 
testp=(0.20 0.12 0.18 0.10 0.25 0.15);
run;

When we execute the code above, we get the following results:

SAS card side

We also get a bar chart showing the deviation of the variable type, as shown below.

SAS card side

Two-way card side

When we apply a test to two variables in a dataset, we use a two-way card square test.

Cases

In the following example, we apply a card square test to two variables named type and origin. T he results show the table form of all combinations of these two variables.

proc freq data = sashelp.cars;
tables type*origin 
/chisq 
;
run;

When we execute the code above, we get the following results:

SAS card side