Hi everyone,
I would like to display the distribution of my dependent variable at three levels of another variable. I managed to create three histograms next to each other, however it might be nicer to have the three histograms displayed on top of each other. Is there a way to do that? This is the code for my histograms next to each other:
This is the data I'm using:
I would like to display the distribution of my dependent variable at three levels of another variable. I managed to create three histograms next to each other, however it might be nicer to have the three histograms displayed on top of each other. Is there a way to do that? This is the code for my histograms next to each other:
Code:
histogram fs_wage if int_flag_wage2==0 & int_flag_survey_dur1_34==0 & p_earnlevels34==0, barwidth(.8) start (-5) plotregion(margin(b=0)) ytitle(`"Percent"') xtitle(`"Justice evaluation of earnings at Q1"') name(hist_Q1, replace)discrete percent ylabel(0(10)40) histogram fs_wage if int_flag_wage2==0 & int_flag_survey_dur1_34==0 & p_earnlevels34==1, barwidth(.8) start (-5) plotregion(margin(b=0)) ytitle(`"Percent"') xtitle(`"Justice evaluation of earnings at Q2"') name(hist_Q2, replace) discrete percent ylabel(0(10)40) histogram fs_wage if int_flag_wage2==0 & int_flag_survey_dur1_34==0 & p_earnlevels34==2, barwidth(.8) start (-5) plotregion(margin(b=0)) ytitle(`"Percent"') xtitle(`"Justice evaluation of earnings at Q3"') name(hist_Q3, replace)discrete percent ylabel(0(10)40) graph combine hist_Q1 hist_Q2 hist_Q3, row(1)
Code:
* Example generated by -dataex-. For more info, type help dataex clear input byte fs_wage double p_earnlevels34 float(int_flag_wage2 int_flag_survey_dur1_34) -5 0 0 0 -5 0 0 0 -5 0 0 0 -5 0 0 0 -5 0 0 0 -5 0 0 0 -5 0 0 0 -5 0 0 0 -5 0 0 0 -5 0 0 0 -5 0 0 0 -5 0 0 0 -5 0 0 0 -5 0 0 0 -5 0 0 0 -5 0 0 0 -5 0 0 0 -5 0 0 0 -5 0 0 0 -5 0 0 0 -5 0 0 0 -5 0 0 0 -5 0 0 0 -5 0 0 0 -5 0 0 0 -5 0 0 0 -5 0 0 0 -5 0 0 0 -5 0 0 0 -5 0 0 0 -5 0 0 0 -5 0 0 0 -5 0 0 0 -5 0 0 0 -5 0 0 0 -5 0 0 0 -5 0 0 0 -5 0 0 0 -5 0 0 0 -5 0 0 0 -5 0 0 0 -5 0 0 0 -5 0 0 0 -5 0 0 0 -5 0 0 0 -5 0 0 0 -5 0 0 0 -5 0 0 0 -5 0 0 0 -5 0 0 0 -5 0 0 0 -5 0 0 0 -5 0 0 0 -5 0 0 0 -5 0 0 0 -5 0 0 0 -5 0 0 0 -5 0 0 0 -5 0 0 0 -5 0 0 0 -5 0 0 0 -5 0 0 0 -5 0 0 0 -5 0 0 0 -5 0 0 0 -5 0 0 0 -5 0 0 0 -5 0 0 0 -5 0 0 0 -5 0 0 0 -5 0 0 0 -5 0 0 0 -5 0 0 0 -5 0 0 0 -5 0 0 0 -5 0 0 0 -5 0 0 0 -5 0 0 0 -5 0 0 0 -5 0 0 0 -5 0 0 0 -5 0 0 0 -5 0 0 0 -5 0 0 0 -5 0 0 0 -5 0 0 0 -5 0 0 0 -5 0 0 0 -5 0 0 0 -5 0 0 0 -5 0 0 0 -5 0 0 0 -5 0 0 0 -5 0 0 0 -5 0 0 0 -5 0 0 0 -5 0 0 0 -5 0 0 0 -5 0 0 0 -5 0 0 0 end label values fs_wage labels125 label values p_earnlevels34 p_earnlevels34 label def p_earnlevels34 0 "0. low", modify
Comment