Page 1 of 1

@elem(ser,j) can not use integer J

Posted: Tue Oct 29, 2013 5:06 pm
by maxchen
EV8 32bit build 2013-10-22

in p481 of "EViews 8 Object Ref.pdf" , to access the j-th observation of the series, using @elem(ser,j)

Code: Select all

pagecreate(page=ar1) u 4 rndseed(type=mt) 12347 genr e = 0.6*nrnd 'sig=0.6 'c(1) = @elem(e,1) 'error c(2) = @elem(e,"2") c(3) = @elem(e,@str(3)) c(4) = @elem(e,@otod(4))
However, the line "c(1) = @elem(e,1)" will not work, the error info says we need a string. Is it possible to support integer to retrive j-th element?

Re: @elem(ser,j) can not use integer J

Posted: Wed Oct 30, 2013 7:35 am
by etienne
Hi,

I've not checked if the documentation is correct, it may not be, but at least you can easily work around this with the @str function.

So,

Code: Select all

c(1) = @elem(e,@str(1))
would work.

Example,

Code: Select all

for !i = 1 to @obsrange c(!i) = @elem(e,@str(!i)) next

Re: @elem(ser,j) can not use integer J

Posted: Wed Oct 30, 2013 11:01 am
by EViews Glenn
The docs are wrong. It should be a string. We'll get them corrected.