Hello,
My question also concerns crosstabulation of multiple variables. I have 20 binary (Y/N) variables of activities people engaged with in the last 12 months and I would like to descriptively display the patterns of engagement between the variables before proceeding to cluster analyses of the observations. In essence, I'd like to display the proportions in the same way as with a cross tabulation of two count variables (var1 a score of 0-10 of engaged pactivities and var2 a score of 0-10 of engaged ractivities), see the graph below.

I have tried mtab and mrtab, but wasn't unable to set it up as a two-way table. Same for tabstat. I keep running to r(198) problems misspecifying tabmult and tabout and tab2 work but the output shows only one activity at the time, e.g. pactivity1 vs. pactivity2-10 etc.
Thank you in advance for your help.
----------------------- copy starting from the next line -----------------------
------------------ copy up to and including the previous line ------------------
My question also concerns crosstabulation of multiple variables. I have 20 binary (Y/N) variables of activities people engaged with in the last 12 months and I would like to descriptively display the patterns of engagement between the variables before proceeding to cluster analyses of the observations. In essence, I'd like to display the proportions in the same way as with a cross tabulation of two count variables (var1 a score of 0-10 of engaged pactivities and var2 a score of 0-10 of engaged ractivities), see the graph below.
I have tried mtab and mrtab, but wasn't unable to set it up as a two-way table. Same for tabstat. I keep running to r(198) problems misspecifying tabmult and tabout and tab2 work but the output shows only one activity at the time, e.g. pactivity1 vs. pactivity2-10 etc.
Thank you in advance for your help.
----------------------- copy starting from the next line -----------------------
Code:
* Example generated by -dataex-. To install: ssc install dataex clear input float id byte(pactivity1 pactivity2 pactivity3 pactivity4 pactivity5 pactivity6 pactivity7 pactivity8 pactivity9 pactivity10 ractivity1 ractivity2 ractivity3 ractivity4 ractivity5 ractivity6 ractivity7 ractivity8 ractivity9 ractivity10) 4712 1 1 0 1 0 0 1 1 1 1 0 1 1 1 0 0 1 1 1 1 2624 1 0 1 0 0 0 0 0 0 1 0 0 1 1 0 1 1 1 1 1 3205 1 0 0 0 0 0 0 0 0 1 0 0 0 0 0 1 0 1 0 0 1628 1 0 0 0 0 0 0 0 0 0 0 1 1 1 0 1 1 0 0 0 5960 1 0 0 1 0 0 0 1 0 0 1 1 1 1 1 1 1 1 1 1 435 1 0 1 0 0 1 0 1 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 1 0 0 1 0 1 1 1 1 1 1 1 1 0 end label values pactivity1 anyengagement label values pactivity2 anyengagement label values pactivity3 anyengagement label values pactivity4 anyengagement label values pactivity5 anyengagement label values pactivity6 anyengagement label values pactivity7 anyengagement label values pactivity8 anyengagement label values pactivity9 anyengagement label values pactivity10 anyengagement label values ractivity1 anyengagement label values ractivity2 anyengagement label values ractivity3 anyengagement label values ractivity4 anyengagement label values ractivity5 anyengagement label values ractivity6 anyengagement label values ractivity7 anyengagement label values ractivity8 anyengagement label values ractivity9 anyengagement label values ractivity10 anyengagement label def anyengagement 0 "Never", modify label def anyengagement 1 "One of or more", modify
Comment