Three Flavors of Chi-Square: Pearson, Likelihood Ratio, and Wald

Here is a short SAS program and annotated output.

options pageno=min nodate formdlim='-';

proc format; value yn 1='Yes' 2='No'; value ww 1='Alone' 2='Partner';

data duh; input Interest WithWhom count;

weight count; cards;

1 1 51

1 2 16

2 1 21

2 2 1

proc freq; format Interest yn. WithWhom ww.;

table Interest*WithWhom / chisq nopercent nocol relrisk; run;

proc logistic; model WithWhom = Interest; run;

------

The SAS System 1

The FREQ Procedure

Table of Interest by WithWhom

Interest WithWhom

Frequency‚

Row Pct ‚Alone ‚Partner ‚ Total

ƒƒƒƒƒƒƒƒƒˆƒƒƒƒƒƒƒƒˆƒƒƒƒƒƒƒƒˆ

Yes ‚ 51 ‚ 16 ‚ 67

‚ 76.12 ‚ 23.88 ‚

ƒƒƒƒƒƒƒƒƒˆƒƒƒƒƒƒƒƒˆƒƒƒƒƒƒƒƒˆ

No ‚ 21 ‚ 1 ‚ 22

‚ 95.45 ‚ 4.55 ‚

ƒƒƒƒƒƒƒƒƒˆƒƒƒƒƒƒƒƒˆƒƒƒƒƒƒƒƒˆ

Total 72 17 89

Statistics for Table of Interest by WithWhom

Statistic DF Value Prob

ƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒ

Chi-Square (Pearson) 1 4.0068 0.0453

Likelihood Ratio Chi-Square 1 5.0124 0.0252

Notice that the relationship is significant with both the Pearson and LR Chi-Square.

WARNING: 25% of the cells have expected counts less

than 5. Chi-Square may not be a valid test.

------

The SAS System 2

The FREQ Procedure

Statistics for Table of Interest by WithWhom

Estimates of the Relative Risk (Row1/Row2)

Type of Study Value 95% Confidence Limits

ƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒ

Case-Control (Odds Ratio) 0.1518 0.0189 1.2189

Cohort (Col1 Risk) 0.7974 0.6781 0.9378

Cohort (Col2 Risk) 5.2537 0.7385 37.3741

Sample Size = 89

Notice that although the Pearson and LR Chi-Square statistics were significant beyond .05, the 95% confidence interval for the odds ratio includes the value one. As you will soon see, this is because a more conservative Chi-Square, the Wald Chi-Square, is used in constructing that confidence interval.

Since most people are uncomfortable with odds ratios between 0 and 1, I shall invert the odds ratio, to 6.588, with a confidence interval extending from 0.820 to 52.910.

------

The SAS System 3

The LOGISTIC Procedure

Testing Global Null Hypothesis: BETA=0

Test Chi-Square DF Pr > ChiSq

Likelihood Ratio 5.0124 1 0.0252

Score (Pearson) 4.0068 1 0.0453

Wald 3.1461 1 0.0761

The values of the Pearson and the LR Chi-Square statistics are the same as reported with Proc Freq. Notice that here we also get the conservative Wald Chi-Square, and it falls short of significance. The Wald Chi-square is essentially a squared t, where t = the value of the slope in the logistic regression divided by its standard error.

------

Odds Ratio Estimates

Point 95% Wald

Effect Estimate Confidence Limits

Interest 6.588 0.820 52.900

So we should not be surprised that the confidence interval, based upon the Wald Chi-Square statistic, does include one.

What should one do when the results are significant via the Pearson or Likelihood Chi-Square test, but the confidence interval includes the value 1? Reporting such a confidence interval while claiming the test to be significant would be confusing. In such a case I have recommended reporting the value of the Chi-Square statistics, exact p value, and odds ratio, but not the confidence interval.

Karl L. Wuensch, January, 2017