I've to admit that I haven't followed the whole discussion. But, Jan,
you could replace the NANs by some arbitrary value (e.g. '0' or -999),
pass the matrix to gretl and impose the NANs there again by:
<hansl>
# Check elementwise if matrix x.=0; if zero replace by NA,
# otherwise replace by the corresponding value of matrix m
matrix m = zeros(1,2)
matrix m = (m ? m : NA)
</hansl
Artur
Am 03.01.2017 um 17:40 schrieb Jan Tille:
Dear Allin, dear Sven,
thank you very much. I am not sure whether I can leave out the nan-values.
My aim is to use the LASSO procedure on a recursive basis to retrieve predictions
(>100) for more than 1.000 dependent variables instead of using a kitchen sink ols
model.
Constructing an appropriate loop that only passes a vector holding a dependent variable
if it contains valid data, along with a matrix of independent variables might be
possible.
I am not sure whether my meager programming skills will be enough, but I will definitely
give it a try.
Best,
Jan
-----Ursprüngliche Nachricht-----
Von: Plus.line MailSystem [mailto:cyrus@mailer.plusline.de] Im Auftrag von Sven
Schreiber
Gesendet: Dienstag, 3. Januar 2017 17:21
An: gretl-users(a)lists.wfu.edu
Betreff: Re: [Gretl-users] Problems when trying to interac with R
Am 03.01.2017 um 16:15 schrieb Allin Cottrell:
>
> Ah, I've found the remaining issue: it's a Windows thing. The
> Microsoft C library doesn't recognize either "nan" or "NaN"
as meaning
> not-a-number. We've had a work-around in place to handle "nan", as
> written by gretl in its matrix files, but this wasn't dealing with
> "NaN", as written by R. The work-around is now generalized to handle
> both, in git and today's snapshots.
Yes, by coincidence I was already using the brand new snapshot an hour ago or so, and
Jan's script now ran fine.
Jan, if you don't want to unnerve your admin again, in general it might be advisable
to keep the missings out of the stuff that is passed to R in the first place (if
that's doable). My feeling is that it would be cleaner anyway, apart from avoiding
this particular bug.
cheers,
sven
_______________________________________________
Gretl-users mailing list
Gretl-users(a)lists.wfu.edu
http://lists.wfu.edu/mailman/listinfo/gretl-users
_______________________________________________
Gretl-users mailing list
Gretl-users(a)lists.wfu.edu
http://lists.wfu.edu/mailman/listinfo/gretl-users