How do I extract estimates from a two way tabulation in stata?
Example data:
tab xx yy, col nokey
. tab yy zz, col nokey
I want to plot a twoway line graph or something closer of (xx and yy), and also (yy and zz) and use addplot to plot this two on same scale(or graph)
I noticed after -return list- command that these estimates are not stored. Does any one have information on any trick or user written command that I use to extract this estimates?
Thanks in anticipation.
Example data:
Code:
clear all set obs 100 gen id=_n gen x = runiform() gen xx=(x>0.5) gen y = runiform() + 1 gen yy =(y>1.7) gen z = runiform() gen zz = 0 replace zz = 1 if (z>0.3 & z<0.7) replace zz = 2 if z>0.6 tab xx yy, col nokey tab yy zz, col nokey
Code:
yy xx 0 1 Total 0 38 15 53 54.29 50.00 53.00 1 32 15 47 45.71 50.00 47.00 Total 70 30 100 100.00 100.00 100.00
. tab yy zz, col nokey
Code:
zz yy 0 1 2 Total 0 19 18 33 70 79.17 72.00 64.71 70.00 1 5 7 18 30 20.83 28.00 35.29 30.00 Total 24 25 51 100 100.00 100.00 100.00 100.00
I want to plot a twoway line graph or something closer of (xx and yy), and also (yy and zz) and use addplot to plot this two on same scale(or graph)
I noticed after -return list- command that these estimates are not stored. Does any one have information on any trick or user written command that I use to extract this estimates?
Thanks in anticipation.
Comment