Hi. I have panel data and I am supposed to do within transformation to remove the fixed effects. Basically, I have to create a variable $y-\Bar{y}$
. I know usually I can do this using the within transformation of the plm package. However, I have to run a non-parametric regression. Therefore, my transformation should look like this:
y_{i,t}(x) = y_{i,t} - \Sigma_{s=1}^T y_{i,s} w_{i,s}
where w_{i,s} = \frac{K_H (X_{i,s}) - x}{\Sigma_{r=1}^T K_H (X_{i,r} - x)} and K is a kernel.
Any idea how I can do this?