I would like to calculate the Pearson (or other) correlation between two variables, for every combination of two categorical variables A and B. For example, the correlation between education and income, for every combination of decade of birth and seven categories of religious affiliation. If the sample included respondents born in 7 different decades, then there would be 49 correlations -- one for each cell defined by the intersection of A & B.
I know I can loop through each combination and format the saved estimates, but I am wondering if there is an already-constructed option, ado or utility that would generate an A x B table, with the corresponding pairwise correlation (always Rxy) in each cell. Berkeley's SDA analysis tool does precisely this (called "Comparison of Correlations" and is analogous to the old SPSS crossbreak procedure for means). If someone has already created such a utility, I hope someone can point me in the right direction.
I know I can loop through each combination and format the saved estimates, but I am wondering if there is an already-constructed option, ado or utility that would generate an A x B table, with the corresponding pairwise correlation (always Rxy) in each cell. Berkeley's SDA analysis tool does precisely this (called "Comparison of Correlations" and is analogous to the old SPSS crossbreak procedure for means). If someone has already created such a utility, I hope someone can point me in the right direction.
Comment