Hi there!

Does anyone know how to smooth a plot using margins and marginsplot?

I ran the following code:
Code:
reg educyears i.yearbirth##c.InfectionRate i.NewDist i.yearmerge i.urban##i.yearbirth i.female##i.yearbirth househeadsex housemembers househeadage, cluster(IDclusternum)
margins, dydx(InfectionRate) at(yearbirth=(1962(1)2001)) 
marginsplot, recast(scatter) noci
The graph I end up with is not very useful, because there are too many data points (see below). So I was hoping to run a smoothed line through each point, like a moving average. Unfortunately, "lpoly" does not seem to work with marginsplot as it does with other graphing tools.

Thank you!

Array