I need to run a regression on a panel data . It has 3 dimensions (Year * Company * Country). For example:
============================================
year | co
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.