That works nicely. A refinement is to add
label def dim 1 "Repair record" 2 "Origin"
label val dim
before the -graph box- call to avoid the
detail of "1" and "2".
One question now is there is a useful and interesting
generalisation that lends itself to automation? That
is, assume
1. There is a response variable.
2. There are two or more categorical covariates.
3. For each covariate, we want the distribution
of the response by its categories.
4. We want the individual displays aligned.
Uses could vary from exploration all the way
to final report.
Nick
[email protected]
>>> Ulrich Kohler
Thanks Vince, this answered my question thouroughly. I went for the
-reshape- solution, which is far as complicated as I thought.
To round this tread up, here is a template for the auto-data:
. gen cov1:cov = rep78
. gen cov2:cov = 6 + foreign
. label define cov 6 "Domestic" 7 "Foreign"
. reshape long cov, i(make) j(dim)
. graph box turn, over(cov) by(dim, cols(1)) nofill horizontal
Reshape rules!
*
* For searches and help try:
* http://www.stata.com/support/faqs/res/findit.html
* http://www.stata.com/support/statalist/faq
* http://www.ats.ucla.edu/stat/stata/