I did it the same way before with a different dataset, now with this dataset the bars are all over the place. Why?
The middle is completely overlaid. And if I fix the width to 0.1, then the most-left one is too distant. Why?
Code:
local color1 "navy"
local color2 "cranberry"
local color3 "gold"
local color4 "forest_green"
local offset = 0.1
gen temp_self = self - `offset'
gen temp_guess = guess + `offset'
#delimit ;
twoway
(hist temp_self if treat==1, frac lcolor(`color1') fcolor(`color1')) ||
(hist temp_guess if treat==1, frac fcolor(`color2') lcolor(`color2')),
title("Panel A: 7% wage decrease due to recession", size(small))
legend(label(1 "Own judgement") label(2 "Guessing others judgement") rows(1) pos(6))
xlabel(1 "Sign. less" 2 "Slight. less" 3 "Same" 4 "Slight. more" 5 "Sign. more")
plotregion(style(none)) graphregion(color(white)) bgcolor(white)
name(recession, replace);
#delimit cr
Code:
* Example generated by -dataex-. For more info, type help dataex clear input byte(treat self guess) 2 2 2 3 3 3 1 3 3 4 4 4 2 3 2 3 4 3 2 3 2 4 3 3 2 3 3 3 3 4 1 4 3 3 4 4 2 3 2 4 3 2 2 3 3 4 4 4 2 3 1 3 4 3 1 1 5 4 4 4 1 3 3 3 3 4 1 3 2 4 3 4 2 1 1 4 3 3 1 5 4 3 5 4 2 3 2 4 3 4 1 3 3 4 4 4 2 4 3 3 5 3 2 3 3 4 3 3 1 3 2 4 3 4 1 3 2 4 3 2 1 2 3 3 4 4 1 2 1 4 4 5 1 3 5 4 4 5 2 3 3 4 3 3 2 3 4 4 3 4 1 3 3 3 3 3 1 4 4 3 3 3 1 4 2 3 5 4 2 3 4 4 3 3 2 3 2 4 4 4 1 1 2 4 1 2 2 3 3 4 3 3 1 3 3 3 3 3 2 2 2 4 4 4 2 2 2 3 3 3 1 3 4 3 3 5 2 2 4 4 4 3 2 2 3 4 4 4 1 3 3 4 3 3 1 4 4 3 2 3 1 3 3 3 4 4 1 3 3 3 4 4 1 1 1 4 1 1 2 2 3 4 4 5 2 3 3 3 3 4 1 2 2 4 3 3 1 5 2 3 5 4 2 3 3 4 4 4 1 4 4 3 4 4 2 3 3 4 3 3 end

Comment