On 12/21/06, Lucy Shum <[email protected]> wrote:
Maybe my initial question is better illustrated as follows:
Column 1 Column 2
1 4
3 10
4 21
5 4
6 3
So, I want to graph the frequency which is represented by Column 2, but the
x-axis to be expressed by figures in column 1.
Do you mean sth like this?
I am using the levelsof command to retrieve all levels of the variable
col1 and col2 and store them in a local macral. I later use the to
local macros in the y/xlabel statement:
/* example beginn */
clear
input col1 col2
1 4
3 10
4 21
5 4
6 3
end
quiet levelsof col1, local(lev_col1)
quiet levelsof col2, local(lev_col2)
#delimit ;
twoway bar col2 col1,
xlabel(`lev_col1', grid)
ylabel(0 `lev_col2', grid)
;
/* example ends here */
*
* 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/