# Association Analysis for Count Data Using SAS

In SAS, association analysis methods for count data/contingency tables is typically performed using the `PROC FREQ`

procedure. This procedure has options for Chi-Square and Fisher’s Exact tests.

# Example: Lung Cancer Data

The following tabulation was used for the SAS Chi-Square and Fisher’s testing. This tabulation was derived from the same `lung`

dataset used for the R function testing. The dataset is defined as follows:

```
data test_case;
input treatment $ Count Weight $;
datalines;
Trt_A 22 0
Trt_B 39 0
Trt_A 39 1
Trt_B 113 1
;
```

## Tests of Association

The following SAS code produces both the Chi-Square and Fisher’s Exact tests of association. Note that the results contain many statistics not produced by the corresponding R function. The relevant sections of the output have been outlined in red.

```
proc freq data = test_case;
weight Count;
tables treatment * Weight / chisq fisher;
exact or;
run;
```

Output: