Dear Stata users,
I am looking for a command in Stata to draw association plots, as introduced by Cohen (1980) and extended by Meyer, Zeileis, and Hornik (e.g., in the R package vcd). These plots visualize the residuals from a chi-squared test of independence in a two-way contingency table. Each cell is represented by a rectangle whose height is proportional to the (signed) Pearson residual and width to the square root of the expected count, so the area reflects the raw residual. Color shading is often used to highlight residuals exceeding certain thresholds (e.g., |r| > 2).
These plots are useful for identifying which cells drive a significant chi-squared statistic and for exploring patterns of deviation from independence.
Does Stata have a native or user-written command that can produce such plots? Any pointers would be greatly appreciated.
Best regards
I am looking for a command in Stata to draw association plots, as introduced by Cohen (1980) and extended by Meyer, Zeileis, and Hornik (e.g., in the R package vcd). These plots visualize the residuals from a chi-squared test of independence in a two-way contingency table. Each cell is represented by a rectangle whose height is proportional to the (signed) Pearson residual and width to the square root of the expected count, so the area reflects the raw residual. Color shading is often used to highlight residuals exceeding certain thresholds (e.g., |r| > 2).
These plots are useful for identifying which cells drive a significant chi-squared statistic and for exploring patterns of deviation from independence.
Does Stata have a native or user-written command that can produce such plots? Any pointers would be greatly appreciated.
Best regards

Comment