# From conceptual framework to econometric estimation

When I run the following regression, I find that $$\beta>0$$

$$y_i=\beta D_i+\varepsilon_i$$

To explain the finding, I wrote down a conceptual framework and I obtained the following prediction

$$\frac{\partial y_i}{\partial D_i}=L_i \frac{1}{1+e(1-\alpha)}$$

By assumption $$\alpha \in (0,1)$$, $$e>0$$, and $$L_i>0$$. Therefore $$\frac{\partial y_i}{\partial D_i}>0$$ is generally confirmed. But what worries me is that the $$L_i$$ term that varies by $$i$$. FWIW, $$\frac{\partial L_i}{\partial D_i}$$ is a function of $$D_i$$. How can I account for the $$L_i$$ in my econometric framework?

Use non-parametric regression. A particular version that comes to mind is local linear regression. This can be written as

$$Y_i = \beta_{0i} + \beta_{1i}X_i + \epsilon_i,$$

thereby allowing for individual heterogeneity in $$\partial Y_i/\partial D_i = \beta_{1i}$$. The model is fitted using weighted regression such that

$$\hat \beta_i = (X^\top W_iX)^{-1}(X^\top W_iY),$$

where $$W_i$$ is an $$N \times N$$ diagonal matrix with the $$n$$'th diagonal element being $$K((x_i-x_n)/h)$$ where $$K$$ is the chosen kernel and $$h$$ is the bandwidth (see for example Le and Racine 'Non-Parametric Econometrics' page 81).

• This looks like weighted least squares. That is an estimation method while weighted regression is probably not the right way of phrasing that. Dec 3 '21 at 9:31
• Because the weight matrix is diagonal each observation is assigned one and only one weight as in weighted regression. Numerically you get $(\hat \beta_{i1})$ for $i=1,...,N$ by running a single weighted least squares estimation. But you have to do this procedure $N$ times to get all $\hat \beta_{i1}$. And hence it is different from WLS in that sense. Dec 3 '21 at 10:30
• As for the choice of wording see en.wikipedia.org/wiki/Weighted_least_squares, where they say 'Weighted least squares (WLS), also known as weighted linear regression'. So the wording is not mine. Dec 3 '21 at 10:31
• Wikipedia is not free of poor wording, so it is not a very convincing argument. I do not disagree with your broader point. My quibble is that using regression in the meaning of an estimation method is questionable. A lot of people have been unintentionally and unfortunately mislead by muddling the distinction between a model, an estimator and certain other elements. (Phrases like "an OLS model" are ubiquitous even if they do not make sense.) Perhaps WLS is not the right name here either, so we can look for something better. Dec 3 '21 at 10:38
• And don't get me started on the notion of a regression model :) Dec 3 '21 at 10:52

tldr:

• If $$D_i$$ is a dummy variable, then if $$cov(L_i, D_i)> 0$$ then OLS will overestimate the mean effect of $$D_i$$ on $$y_i$$. If $$cov(L_i, D_i)< 0$$ the OLS estimate will underestimate this mean effect.
• If $$D_i$$ is not a dummy variable then the effect also depends on the covariance between $$L_i$$ and $$(D_i)^2$$.

Assume that the true model is given by: $$y_i = \gamma + \dfrac{1}{1 + e(1-\alpha)}L_i D_i + \eta_i,$$ where $$\eta_i$$ is uncorrelated with $$D_i$$ and has mean zero.

For a variable $$X_i$$ write $$\bar X = \mathbb{E}(X_i)$$ then we can rewrite above equation as: $$y_i = \gamma + \dfrac{\bar L}{1 + e(1-\alpha)}D_i + \sigma_i,$$ where $$\sigma_i = \eta_i + \dfrac{(L_i - \bar L)}{1 + e(1-\alpha)} D_i.$$ Notice that $$\sigma_i$$ has mean: \begin{align*} \mathbb{E}(\sigma_i) &= \dfrac{\mathbb{E}(L_i D_i) - \bar L \bar D}{1 + e(1-\alpha)}\\ &= \dfrac{cov(L_i,D_i)}{1 + e(1-\alpha)}. \end{align*} Which is not necessarily zero, but this is not a big problem as it will be captured by the constant term in the regression.

Assume we run the following specification: $$y_i = \delta + \beta D_i + \varepsilon_i,$$ Then the estimate of $$\beta$$ will asymptotically estimate: $$\dfrac{cov(y_i, D_i)}{var(D_i)}.$$ Let's compute the numerator: \begin{align*} y_i - \bar y &= \dfrac{\bar L}{1 + e(1-\alpha)}(D_i - \bar D) + \sigma_i - \mathbb{E}(\sigma_i)\\ &= \dfrac{\bar L}{1 + e(1-\alpha)}(D_i - \bar D) + \eta_i + \dfrac{(L_i - L) D_i}{1 + e(1-\alpha)}- \dfrac{cov(L_i,D_i)}{1 + e(1-\alpha)}. \end{align*} Then: \begin{align*} (y_i - \bar y)(D_i - \bar D) = \dfrac{\bar L}{1 + e(1-\alpha)}(D_i - \bar D)^2 + \eta_i(D_i - D) + \dfrac{(L_i - \bar L)D_i(D_i - \bar D)}{1 + e(1-\alpha)} - \dfrac{cov(L_i, D_i)}{1 + e(1-\alpha)}(D_i - \bar D) \end{align*} So taking the expectation of both sides gives: $$cov(y_i, D_i) = \dfrac{\bar L}{1 + e(1-\alpha)}var(D_i) + \dfrac{\mathbb{E}((L_i - \bar L)(D_i - \bar D)D_i)}{1 + e(1-\alpha)}$$ The last term gives: \begin{align*} &\dfrac{1}{1 + e(1-\alpha)}\left[\mathbb{E}(L_i D_i D_i) - \mathbb{E}(\bar L D_i D_i) - \mathbb{E}(L_i \bar D D_i) + \mathbb{E}(\bar L \bar D D_i) \right],\\ &=\dfrac{1}{1 + e(1-\alpha)}\left[\mathbb{E}(L_i D_i D_i) - \bar L \mathbb{E}(D_i D_i) - \bar D \mathbb{E}(L_i D_i) + \bar L (\bar D)^2 \right],\\ &=\dfrac{1}{1 + e(1-\alpha)}\left[\mathbb{E}(L_i (D_i)^2) - \bar L \overline{D^2} - \bar D\left[\mathbb{E}(L_i D_i) - \bar L \bar D\right] \right],\\ &= \dfrac{1}{1 + e(1-\alpha)} \left[ cov(L_i, (D_i)^2) - \bar D cov(L_i, D_i)\right] \end{align*} So the OLS estimate will converge to: $$\dfrac{\bar L}{1 + e(1-\alpha)} + \dfrac{1}{1 + e(1-\alpha)} \dfrac{cov(L_i, (D_i)^2)}{var(D_i)} - \bar D \dfrac{1}{1 + e(1-\alpha)} \dfrac{cov(L_i, D_i)}{var(D_i)}.$$ If $$D_i$$ is a dummy variable then $$(D_i)^2 = D_i$$ so $$cov(L_i,(D_i)^2) = cov(L_i, D_i)$$ and $$var(D_i) = \bar D(1-\bar D)$$ so, we get: \begin{align*} &\dfrac{\bar L}{1 + e(1-\alpha)} + \dfrac{1}{1 + e(1-\alpha)}(1 - \bar D)\dfrac{cov(L_i, D_i)}{\bar D(1-\bar D)},\\ &= \dfrac{\bar L}{1 + e(1-\alpha)} + \dfrac{1}{1 + e(1-\alpha)}\dfrac{cov(L_i, D_i)}{\bar D}, \end{align*} If $$cov(L_i, D_i) > 0$$ then the OLS estimate will tend to overestimate $$\dfrac{\bar L}{1 + e(1-\alpha)}$$ if $$cov(L_i, D_i) < 0$$ then the OLS will underestimate this mean effect of $$D$$ on $$y$$.