Your original syntax was asking for
regression lines and data points for each subset in front
regression lines and data points for other subsets in back
There are many variants on this. Here's one with extra twists to match the example. rangestat and mylabels are from SSC, as is fabplot.
regression lines and data points for each subset in front
regression lines and data points for other subsets in back
There are many variants on this. Here's one with extra twists to match the example. rangestat and mylabels are from SSC, as is fabplot.
Code:
webuse grunfeld, clear gen ln_invest = ln(invest) rangestat (reg) ln_invest year, int(company 0 0) gen predicted = b_cons + b_year * year label var predicted "predicted investment (linear fit on log scale)" mylabels 1 3 10 30 100 300 1000, myscale(ln(@)) local(yla) fabplot line predicted year, by(company) select(company <= 4) frontopts(lw(thick)) yla(`yla') xtitle("") xla(1935 " 1935" 1955 "1955 " 1940(5)1950, format(%tyYY))
Comment