I am try to estimate a demand model:
d_t^k = a_t - b^k p_t^k + e_t^k
The indices t are for week number, k are for pro
t
k
After doing some experimentation, it seems that
lm(demand ~ factor(week) + factor(product) * price, data = df)
does work.
I don't know why I hadn't thought it would work earlier.