The bar plot is frequently used in daily practice. Suppose that I have several categorical variables in my dataset, and I want to show frequencies or percents of these variables using bar plot. The -graph bar- will fail in this case. And the user-written command -fbar- (by Nick Cox in 2001.06.19) can do some work, i.e. it can show frequencies of one categorical variable one at a time. Is there some command can do this work and simultaneously show frequencies or percents of several categorical variables? Thank you.
Code:
* Example generated by -dataex-. To install: ssc install dataex clear input byte(q1 q2 q3 q4 q5) 3 3 2 2 2 1 1 1 1 1 2 3 2 1 1 1 1 1 1 1 2 2 2 2 2 2 2 1 1 1 .a 2 2 2 2 1 1 1 1 1 2 2 2 2 1 2 2 2 2 2 1 1 1 1 1 2 2 1 1 1 2 2 2 2 2 1 1 1 1 1 1 1 1 1 1 4 4 2 3 2 2 2 2 2 2 1 1 1 1 1 2 2 2 2 2 1 1 1 1 1 2 2 2 2 2 2 2 1 1 1 2 2 2 1 2 1 1 1 1 1 3 2 1 1 1 2 2 2 2 2 1 1 1 1 1 2 3 1 2 2 2 2 2 2 1 2 2 2 2 2 end label values q1 q label values q2 q label values q3 q label values q4 q label values q5 q label def q 1 "stongly agree", modify label def q 2 "slightly agree", modify label def q 3 "slightly disagree", modify label def q 4 "strongly disagree", modify
0 Response to Command likes -fbar- that simultaneously show frequencies or percents of categorical variables
Post a Comment