How to run regressions on multidimensional panel data in R

后端 未结 4 869
暗喜
暗喜 2021-02-04 22:11

I need to run a regression on a panel data . It has 3 dimensions (Year * Company * Country). For example:

============================================
 year | co         


        
4条回答
  •  误落风尘
    2021-02-04 22:38

    If you want to control for another dimension in a within model, simply add a dummy for it:

    plm(value.y ~ value.x + count, data = dataname, index = c("comp","year"))

    Alternatively (especially for high-dimensional data), look at the lfe package which can 'absorb' the additional dimension so the summary output is not polluted by the dummy variable.

提交回复
热议问题