← Back to the chapter · Previous detail · Next detail →
Technical detail · Validation and Outlier Detection
Cross-tabulate categorical outcomes
When both variables are categories, start with a contingency table rather than forcing category codes into a correlation. Rows might represent firmware version and columns might represent outcome: normal, recovered fault, or unrecovered fault. Each cell is an observed count. Add row percentages when the question is “How do outcomes differ within each firmware group?” and column percentages when the question is “Which firmware groups make up each outcome?” Raw counts remain visible so a striking percentage based on very few devices cannot masquerade as strong evidence.
To test association, calculate the count expected in each cell if the row and column variables were independent:
The chi-square statistic sums across cells. A large departure can be evidence against independence, but the result does not identify causation or say which difference matters operationally. Inspect cell contributions, report an effect size such as Cramer’s V, preserve the sampling and exposure denominators, and combine sparse categories or use an appropriate exact method when expected counts are too small for the approximation. In an IoT fleet, site, device age, workload, or rollout timing can confound an apparent firmware-fault association.