On Sat, 8 Nov 2014, Sven Schreiber wrote:
given that my first attempts to implement panel logit with so-called
random
effects have been 95% but not 100% successful I have now written a wrapper
function to outsource this task to R. Given that this is a potentially
computational-intensive task I think it makes sense to incur the overhead of
invoking R.
If somebody likes to test and feed back the results, they're welcome (see
attached).
You need to have R installed and within R you need the "lme4" package to be
present.
The function interface from a gretl user side is pretty straightforward, you
just specify the dependent variable and then the right-hand side in a list
"X". If you want to let lme4's glmer() do Gauss-Hermitian quadrature you
need
to specify the number of points in "quadpoints" (or you set it to zero to let
me choose the default number 32), otherwise with the default 1 it uses a
"Laplacian" quadrature:
RElogitR(series y, const list X, int quadpoints[0::1])
The function returns a bundle with all kind of stuff, but this is far from
finished.
Note that in the output you will see from the R side, the jargon from the
lme4 package calls some things "fixed effects", which is probably a pretty
accurate description, but that we in econometrics usually wouldn't call fixed
effects. It has nothing to do with (conditional) Fixed-Effects-Logit from
gretl's fe_logit package for example. It is really just the standard
explanatory variables without the "random effects".
So let's see if this thing works for you.
Thanks, Sven. Here's what I'm seeing with 3.1.0:
? bundle myRElogit = RElogitR(binary, rhs)
Loading required package: Matrix
Loading required package: Rcpp
fixed-effect model matrix is rank deficient so dropping 1 column /
coefficient
Error in if (!dims["useSc"] || trivial.y) NA else sigmaML :
missing value where TRUE/FALSE needed
In addition: Warning message:
In storage.mode(dims) <- "integer" : NAs introduced by coercion
External command failed
Allin