asdir
2010-Aug-16 15:46 UTC
[R] "2 not defined because of singularities" appearing after introducing Fixed Effects
The set runs fine without the fixed effects. However, once I add the "+factor(HostCode)"-part, it throws out two variables. The africa-dummy thrown out certainly does not exhibit perfect multicollinearity, I checked that. The litrate variable is continuous and therefore cannot be perfectly related to the FE-dummies introduced by R. This is the used code:> cdmoutcome<- lm(log(value)~#factor(year) > +factor(HostCode) > +log(gdppcpppconst)+log(gdppcpppconstAII) > +log(co2eemisspc)+log(co2eemisspcAII) > +fdiboth > +odapartnertohost > +infraindex > +litrate > +africa > +imr > , data=cdmdata2, subset=zero==1) > summary(cdmoutcome >These are the results (please expand to see the relevant part):> Coefficients: (2 not defined because of singularities) > Estimate Std. Error t value Pr(>|t|) > (Intercept) 1.144e+01 3.077e+01 0.372 0.7103 > factor(HostCode)7 -3.296e+00 4.617e+00 -0.714 0.4759 > factor(HostCode)19 -1.242e+01 8.764e+00 -1.417 0.1575 > factor(HostCode)20 1.548e+00 4.087e+00 0.379 0.7052 > factor(HostCode)23 -4.183e+00 3.786e+00 -1.105 0.2702 > factor(HostCode)29 -1.473e+01 1.168e+01 -1.261 0.2083 > factor(HostCode)35 7.631e-01 7.870e-01 0.970 0.3330 > factor(HostCode)36 7.700e+00 4.340e+00 1.774 0.0771 . > factor(HostCode)37 -6.549e+00 4.844e+00 -1.352 0.1774 > factor(HostCode)42 -1.020e+01 5.074e+00 -2.010 0.0453 * > factor(HostCode)51 1.738e+00 3.206e+00 0.542 0.5882 > factor(HostCode)52 1.032e+00 2.742e+00 0.376 0.7069 > factor(HostCode)53 3.210e+00 2.768e+00 1.160 0.2471 > factor(HostCode)54 -8.851e+00 6.340e+00 -1.396 0.1637 > factor(HostCode)60 2.146e+00 3.531e+00 0.608 0.5438 > factor(HostCode)65 -7.436e+00 5.958e+00 -1.248 0.2129 > factor(HostCode)70 -9.056e+00 6.711e+00 -1.349 0.1782 > factor(HostCode)75 -5.239e+00 5.696e+00 -0.920 0.3585 > factor(HostCode)78 -4.482e+00 5.185e+00 -0.864 0.3881 > factor(HostCode)79 4.259e-01 3.777e+00 0.113 0.9103 > factor(HostCode)84 2.035e+00 3.374e+00 0.603 0.5468 > factor(HostCode)94 -2.008e+01 1.315e+01 -1.528 0.1276 > factor(HostCode)106 6.563e+00 3.027e+00 2.168 0.0309 * > factor(HostCode)113 5.919e+00 1.010e+00 5.858 1.23e-08 *** > factor(HostCode)115 -2.429e+00 4.274e+00 -0.568 0.5702 > factor(HostCode)117 1.240e+01 5.779e+00 2.146 0.0327 * > factor(HostCode)119 -8.822e-01 4.118e+00 -0.214 0.8305 > factor(HostCode)123 -2.530e+01 1.616e+01 -1.566 0.1185 > factor(HostCode)126 -5.210e+00 6.782e+00 -0.768 0.4430 > factor(HostCode)128 -7.044e+00 8.246e+00 -0.854 0.3937 > factor(HostCode)132 -3.570e+00 6.508e+00 -0.548 0.5838 > factor(HostCode)134 -1.756e+00 3.905e+00 -0.450 0.6534 > factor(HostCode)135 -3.403e+00 7.444e+00 -0.457 0.6479 > factor(HostCode)137 -7.738e+00 6.175e+00 -1.253 0.2111 > factor(HostCode)138 -1.066e+01 7.116e+00 -1.498 0.1351 > factor(HostCode)160 1.251e+00 4.889e+00 0.256 0.7982 > factor(HostCode)162 -1.337e+01 8.742e+00 -1.529 0.1273 > factor(HostCode)171 -1.804e+00 2.404e+00 -0.750 0.4537 > factor(HostCode)176 3.873e+00 2.711e+00 1.428 0.1542 > factor(HostCode)180 -3.186e+01 1.734e+01 -1.837 0.0671 . > factor(HostCode)185 -2.367e+01 5.831e+00 -4.059 6.30e-05 *** > factor(HostCode)189 -4.209e+00 5.328e+00 -0.790 0.4302 > log(gdppcpppconst) 1.116e+00 3.849e+00 0.290 0.7721 > log(gdppcpppconstAII) -7.209e-01 7.850e-01 -0.918 0.3592 > log(co2eemisspc) -1.149e+01 6.230e+00 -1.845 0.0661 . > log(co2eemisspcAII) -2.182e-01 3.851e-01 -0.567 0.5714 > fdiboth 1.707e-04 1.055e-04 1.619 0.1066 > odapartnertohost 2.886e-03 1.354e-03 2.132 0.0338 * > infraindex 4.394e+01 9.097e+00 4.830 2.18e-06 *** > litrate NA NA NA NA > africa NA NA NA NA > imr 1.470e+00 7.173e-01 2.049 0.0414 * >Does anyone know how to solve this problem so I can use the FE and still keep the variables in? (Or what I made have wrong on a technical level?) -- View this message in context: http://r.789695.n4.nabble.com/2-not-defined-because-of-singularities-appearing-after-introducing-Fixed-Effects-tp2327047p2327047.html Sent from the R help mailing list archive at Nabble.com.
asdir
2010-Aug-17 17:07 UTC
[R] "2 not defined because of singularities" appearing after introducing Fixed Effects
Sorry, please nevermind. It seems to have been an econometrical problem after all. (A variable consisting of 2 or more of the 150 Country-Dummies for the fixed effects causes perfect multicollinearity as well. So does a variable that differs over cross-sections but not over periods, seemingly. I was not aware before...) -- View this message in context: http://r.789695.n4.nabble.com/2-not-defined-because-of-singularities-appearing-after-introducing-Fixed-Effects-tp2327047p2328686.html Sent from the R help mailing list archive at Nabble.com.