Hi All,

I'm trying to do a calculation for an average rate and a marginal rate using state data. Since the data varies by day of the week, I first want to remove the variation from each day of the week and mean difference so that Wednesday is the omitted variable.

reg dependant i.dow
residuals dependant i.dow
gen intercept = _b[_cons]
gen dependant_2 = residual + intercept

This should give me each dependant smoothed per day of the week. However, I don't think this is the way to mean difference with an omitted category. Can someone please help me!

Miranda