Hi
The following code creates variables similar to those that I have:
The numbers in the "Yes" categories are 41, 60, 35, 33, 48 and 70.
How can I plot a single bar chart with six bars, of heights 41, 60, 35, 33, 48 and 70, with the bars labelled on the x-axis with the labels of the variables (here "Question 1", "Question 2", etc)?
It would be the icing on the cake if I could then add the number (41, 60, etc) to the top of the bar.
Thankyou
Karin
The following code creates variables similar to those that I have:
Code:
clear
set seed 1066
set obs 100
gen q1=cond(uniform()<0.5,0,1)
gen q2=cond(uniform()<0.6,0,1)
gen q3=cond(uniform()<0.4,0,1)
gen q4=cond(uniform()<0.3,0,1)
gen q5=cond(uniform()<0.5,0,1)
gen q6=cond(uniform()<0.7,0,1)
label define yesno01 0 "No" 1 "Yes"
label values q1-q6 yesno01
forvalues x = 1/6 {
label variable q`x' "Question `x'"
}
forvalues x = 1/6 {
tab q`x'
}
How can I plot a single bar chart with six bars, of heights 41, 60, 35, 33, 48 and 70, with the bars labelled on the x-axis with the labels of the variables (here "Question 1", "Question 2", etc)?
It would be the icing on the cake if I could then add the number (41, 60, etc) to the top of the bar.
Thankyou
Karin

Comment