Closed mhamjediers closed 11 months ago
Open for testing as nopo dadb varname
Regarding the plotoptions, I suggest that we just return the default contents so that users can post the full set with their adjustments (similar to the kmatch_cmdline
).
Looks good; I'll check how many standard-options can be implemented maybe more directly and for the rest we follow your suggestion
Bug: Scale centering does not always work, which is a problem with multiple xscales. Only happens with by()
. Seems to be Stata bug. I have tested several hacks to no avail.
Carlas example:
run "nopo.ado"
use "GPG_exampledata.dta", clear
nopo decomp pensionbeZero_tc duration_CIV duration_CW spell_CW_age_1 AFtransition__CIV_RET_ AFtransition__FT_RET_, by(frau)
tempfile temp
nopo dadb duration_CW, save(`temp') keepalllevels
use `temp', clear
sum pensionbeZero_tc_diff
local _mmax = abs(r(min)) * 1.75
sum pensionbeZero_tc_diff_weighted
local _wmmax = abs(r(min)) * 1.75
gen nx = `_mmax'
local plotbyreleveled "duration_CW"
replace pensionbeZero_tc_diff_weighted = 1.75 * pensionbeZero_tc_diff_weighted
gen mirror2 = -pensionbeZero_tc_diff_weighted
// plot
twoway ///
(bar pensionbeZero_tc_diff `plotbyreleveled', horizontal xaxis(2)) ///
(scatter `plotbyreleveled' pensionbeZero_tc_diff_weighted, xaxis(1) xscale(noreverse)) ///
(scatter `plotbyreleveled' mirror2, xaxis(1)) ///
, by(frau)
I have implemented only xsize
and ysize
as direct options for the plot. These should allow to resolve most scaling issues. Everything else is determined by defaults and returned in r()
. Users can then either:
twopts
We could allow for many more direct options, but I think that in the end, you'll always need more than we offer, and in this case the two options allow for maximum flexibility (to be sure, the second option involves some coding and is not just copy paste).
Closing.
Similar to the occupation-graph in our submission