Hi, I am trying to plot a graph that conveys how extra worked hours (when people worked overtime and in a 2nd job if they do it) relate to basic usual hours worked main job (pooled data for a few years, but I am only interested in average hours for the whole time period). I managed to get the graph but I would like the X-axis to gross up the results in different bin sizes than 1 (say in 5hours bins for example).
The code I did for this purpose was
bysort basic_hours: egen avg_basic_hours_males=mean(basic_hours) if working==1 & basic_hours<70 & sex==1
bysort avg_basic_hours_males: egen avg_extra_hours_males=mean(extra_hours) if working==1 & sex==1
twoway (bar avg_extra_hours_males basic_hours) ///
if working==1 & sex==1 & basic_hours<70 & ///
avg_extra_hours_males>=0 & avg_extra_hours_males<=70, ///
ytitle(Extra hours) ///
xtitle(Basic hours) ///
xlabel(0(5)70, labels) ///
xmtick(0(1)70,) ///
title(Male, size(small))
Would I have to recode the basic_hours variable and then do everything again?
Thanks for the help!
The code I did for this purpose was
bysort basic_hours: egen avg_basic_hours_males=mean(basic_hours) if working==1 & basic_hours<70 & sex==1
bysort avg_basic_hours_males: egen avg_extra_hours_males=mean(extra_hours) if working==1 & sex==1
twoway (bar avg_extra_hours_males basic_hours) ///
if working==1 & sex==1 & basic_hours<70 & ///
avg_extra_hours_males>=0 & avg_extra_hours_males<=70, ///
ytitle(Extra hours) ///
xtitle(Basic hours) ///
xlabel(0(5)70, labels) ///
xmtick(0(1)70,) ///
title(Male, size(small))
Would I have to recode the basic_hours variable and then do everything again?
Thanks for the help!
Comment