I have two sets of equations in two unknowns ($\gamma$ and $\delta_m$) from a hedonic regression model that need to be solved for $\gamma$. All sums are indexed over $m$.
(1) $$\sum_{m=1}^M s_m^0lnp_m^0 + \sum_{m=1}^M s_m^1lnp_m^1 = \sum_{m=1}^M (s_m^0 + s_m^1) \delta_m + \sum_{m=1}^M s_m^1 \gamma $$
(2) $$\sum_{m=1}^M s_m^1lnp_m^1 = \sum_{m=1}^M s_m^1 \gamma + \sum_{m=1}^M s_m^1 \delta_m $$
and it is also a fact (maybe unnecessary) that $$\sum_{m=1}^M s_m^1 = \sum_{m=1}^M s_m^0 = 1$$
If we solve (1) and (2) for $\gamma $ we get: (this is done by eliminating $\delta_m$)
$\gamma^* = (\sum \frac{s_m^0s_m^1}{s_m^0+s_m^1}ln(\frac{p_m^1}{p_m^0}))/(\sum \frac{s_m^0s_m^1}{s_m^0+s_m^1})$
(this is a harmonic mean of the weights in (1) and (2)).
My problem is I am unable to solve (1) and (2) for $\gamma$, I can get the relationship that $\sum s_m^0lnp_m^0 = \sum s_m^0 \delta_m $, but I cant figure out how to combined the two equations to eliminate $\delta$ completely. I am also unable to reverse engineer the problem starting from the solution and figuring out what steps were taken to get there... I know the notation is nasty but any tips or ideas how to proceed would be greatly appreciated.
First note that $\displaystyle\,\sum_{m=1}^M s_m^1 \gamma = \gamma \cdot \sum_{m=1}^M s_m^1 = \gamma \cdot 1 = \gamma\,$. Define $\displaystyle\,a = \sum_{m=1}^M s_m^0\ln p_m^0\,$, $\displaystyle\,b=\sum_{m=1}^M s_m^1\ln p_m^1\,$, $\displaystyle\,c=\sum_{m=1}^M s_m^0 \delta_m\,$, $\displaystyle\,d=\sum_{m=1}^M s_m^1 \delta_m\,$, then the system can be written as:
$$ \begin{align} a+b &= c+d+\gamma \\ b &= d + \gamma \end{align} $$
The above implies $\displaystyle\,a=c\,$, but cannot be otherwise solved for $\,\gamma\,$ in such a way that does not involve either of $\,c,d\,$ i.e. the $\,\delta_m\,$ averages.