Lesson 5: ThreeWay Tables: Different Types of Independence
This lesson spells out analysis techniques for threeway tables which is a representative analysis of any Kway table. We begin with the structure of a threeway table, and its corresponding joint, marginal and conditional distributions. In particular, we distinguish between a marginal and a conditional odds ratio. We then consider how to extend the goodnessoffit tests that we saw in the previous lessons. Now there will be a variety of models of independence and associations (see the list below). It is natural to think about using the tests we developed for twoway tables on threeway tables. Many of the models we discuss in this lesson correspond to a particular choice of how to turn a threeway table into a twoway table.
The concept of conditional independence is very important and it is the basis for many statistical models (e.g., latent class models, factor analysis, item response models, graphical models, etc.). With respect to conditional independence models we will see more on CochranMantelHaenszel (CMH) statistic, and describe the phenomenon known as Simpson's paradox. We will also learn about a model of homogeneous associations. In a later lesson on LogLinear models, we will learn how to answer the same questions but via models instead of goodnessoffit tests.
Each of the models described in this lesson will be given a mathematical formulation, e.g., a formula for the expected counts when possible. If that's not your "cup of tea", you can skip those paragraphs and focus on conceptual understanding and how we do the relevant tests in SAS and/or R.
Key Concepts in ThreeWay Tables
Objectives

Useful Links
 SAS source on stratified tables: https://support.sas.com/documentation/cdl/en/procstat/66703/HTML/default/viewer.htm#procstat_freq_syntax08.htm
 R: CochranMantelHaenszel ChiSquared Test for Count Data https://stat.ethz.ch/Rmanual/Rpatched/library/stats/html/mantelhaen.test.html
 R: BreslowDay test: function for the class, breslowday.test()