Hi all,
I am trying to create a figure for box plots that includes multiple variables - but I want to stratify by another variable (whether the response is from a nurse or a doctor).
What I have is this code:
graph hbox Q1_1 Q1_6 Q1_7 Q1_9 Q1_12 Q1_3 Q1_16 Q1_18 Q1_17 Q1_19 Q1_15, by(Doc_nurse) asy noout legend(col(1) ring(0) position(1))
but I don't want a legend for each question, I want these listed on the right by their box plot and a legend for the stratified variable (nurse vs doctor). The resulting graph is shown at the end.
What I want is to have one graph like so
Q1_1 -> nurse response
Q1_1 -> doctor repsonse
Q1_3 -> nurse
Q1_3 -> doc
etc. for the remaining variables
with a legend for just either nurse or doctor response, with the variable name for each on the right hand side.
Is this possible? I have tried using the -combine- command but this has limited options for axis, and basically leads to the same issue.
any help would be appreciated, thank you in advance!
N

I am trying to create a figure for box plots that includes multiple variables - but I want to stratify by another variable (whether the response is from a nurse or a doctor).
What I have is this code:
graph hbox Q1_1 Q1_6 Q1_7 Q1_9 Q1_12 Q1_3 Q1_16 Q1_18 Q1_17 Q1_19 Q1_15, by(Doc_nurse) asy noout legend(col(1) ring(0) position(1))
but I don't want a legend for each question, I want these listed on the right by their box plot and a legend for the stratified variable (nurse vs doctor). The resulting graph is shown at the end.
What I want is to have one graph like so
Q1_1 -> nurse response
Q1_1 -> doctor repsonse
Q1_3 -> nurse
Q1_3 -> doc
etc. for the remaining variables
with a legend for just either nurse or doctor response, with the variable name for each on the right hand side.
Is this possible? I have tried using the -combine- command but this has limited options for axis, and basically leads to the same issue.
any help would be appreciated, thank you in advance!
N
Comment