I have a dataset comprised of two variables, the foobarx variable is what I concerned, the type variable is an indicator of different types of foobarx. I use -catplot- and -tabplot- (both from SSC) to generate three plots, g1, g2 and g3. The g1 plot seems to be identical to g2 plot, but what g3 plot means in this case? Thank you!
Code:
* Example generated by -dataex-. To install: ssc install dataex clear input int type double foobarx 1 1 1 1.3 1 1.5 1 1.2 1 1 1 2.4 1 1.5 1 1 1 2.1 1 1.4 1 3 1 1.2 1 2 1 1 1 1 1 1.2 1 2 1 .8 1 2.1 1 .1 1 1 1 2 1 1.4 1 2 1 2 1 1.7 1 1.3 1 2 1 1.5 1 .8 1 .83 1 2.2 1 .8 1 .8 1 1.46 1 .8 1 .5 1 2 1 2.5 1 1.2 1 .7 1 .3 1 1.5 1 .8 1 .8 1 .03 1 .4 1 1.4 1 1 1 1.4 2 .4 2 2.6 2 4.375 2 1.2 2 1 2 2.4 2 1.5 2 .5 2 2.1 2 .66 2 4 2 1.5 2 2 2 1 2 1 2 1.2 2 1.66 2 .8 2 2.1 2 .07 2 .5 2 2 2 1.4 2 2 2 1.6 2 1.7 2 1.3 2 1.69 2 1.5 2 .32 2 .416 2 2 2 .3 2 1 2 1.2 2 .8 2 .5 2 .8 2 2.5 2 1.2 2 .7 2 .3 2 .7 2 .667 2 .8 2 .02 2 1.25 2 1.4 2 .5 2 1.4 end graph drop _all catplot type foobarx, recast(bar) asyvars var2opts(label(labsize(tiny))) legend(order(1 "Type==1" 2 "Type==2")) name(g1) tabplot type foobarx, separate(type) xlabel(, labsize(tiny)) name(g2) tabplot foobarx, separate(type) xlabel(, labsize(tiny)) name(g3)
0 Response to Difference between catplot and tabplot
Post a Comment