-
Login or Register
- Log in with

sysuse uslifeexp, clear f_rcspline yr=year, nk(5) reg le year yr* f_able yr?, auto margins, dydx(year) margins, at(year=(1900(5)2000)) plot margins, dydx(year) at(year=(1900(5)2000)) plot
// some example data
sysuse uslifeexp, clear
// to spice things up we do a cubic spline and discrete jump
mkspline ys = year , cubic
gen spanish_flu = year == 1918
reg le ys* i.spanish_flu
// we can use margins for predictions
margins, over(year)
marginsplot, ///
recastci(rarea) ciopts(astyle(ci)) ///
plotopts(msymbol(i)) scheme(s1mono)
Leave a comment: