# Weighted average, then adding an intercept term

I am working with a problem where we are calculating the weighted average of DNA modifications. Modified sites are placed into four different groups and the average weight is calculated from there. However, I am then supposed to add an intercept term. I am confused by "intercept term". How would I go about adding an intercept term in this case?

The step is written below: "Next one forms a weighted average of the levels using the reported coefficient values and adds an intercept term."

## 1 Answer

If understand this correctly, you have 4 groups, which can be viewed as categorical variables. You can select one group and denote it as the 'refence'. A reasonable choice would be the group with the most observations. The estimated average for this group, $$b_0$$, would be your intercept. For the others group estimate their respective averages and the difference between these averages and the intercept. Finally you'll have a model of the form: $$Y = b_0 + b_1D_1X_1 + b_2D_2X_2 + b_3D_3X_3$$, where $$D_1, D_2, D_3$$ are indicator variables equal to $$1$$ if $$X$$ belongs to the respective group (otherwise $$0$$)

• Thank you for the comment! When you say estimated average, you mean just the mean correct? The intercepts themselves do not reply on the other categories, in this case, does that mean I only need to make an estimated average for each category instead using the indicator variables? – T Mend Sep 21 '20 at 18:07
• Also, In regards to the intercept, the intercept will always be dependent on the DNA modification levels and not a constant number regardless of what the levels are? – T Mend Sep 21 '20 at 18:15
• The mean value conditionally that $X$ belongs in the given group. – Akylas Stratigakos Sep 21 '20 at 19:20