I am trying to add a dummy variable in order to determine the coefficients for a specific factor (MUNICIPIO) usin pgmm()
in R.
This is the code:
GN_Municipal_Empresa <- pgmm(log(CANTIDAD_M3+1) ~ log(INGTOTUG+1)+lag(log(PRECIO+1),1)+lag(log(CANTIDAD_M3+1),1)+lag(log(PRECIO_GASOLINA.CORRIENTE),1)+lag(log(PRECIO_GASOLINA.EXTRA),1)+as.factor(Consolidado_municipal_GN$MUNICIPIO)*lag(log(PRECIO+1),2)|lag(log(CANTIDAD_M3+1),2:120), data = Consolidado_municipal_GN, index =c("id","tiempo"),effect = "twoways", model = "onestep",collapse=T,transformation = "ld")
I got the following error
Error: `n` must be a nonnegative integer scalar, not a double vector of length 2.
The idea is to determine in this case the elasticity for each 'MUNICIPIO'.