Dummy Coding
Dummy coding represents a treatment factor with indicator variables relative to a reference group.
If treatment A is the reference category in a three-group problem, then one possible model is
$$ y_j = \mu + \tau_1 x_{1j} + \tau_2 x_{2j} + \varepsilon_j, $$where $x_{1j}$ and $x_{2j}$ indicate membership in the non-reference groups. The intercept gives the mean of the reference treatment, and the coefficients compare other treatments to that reference.
R
fit <- lm(y ~ treatment, data = dat)
model.matrix(fit)