I was recently working with the rlm
function from the MASS
package, seeking to fit a robust regression for a panel. Just like many other functions, rlm
does not have a built-in way to introduce fixed effects. ID dummies however cost too much degrees of freedom and doesn't allow for two-way fixed effects.
This got me wondering whether there is a convenient way of "tricking" R into including individual or two-way fixed effects in a regression by performing the within transformation manually? I haven't seen anything about this flying around so possible I am getting the concept wrong. But out of interest: Has anyone done this before?