@pc(x) function does not work

For questions regarding programming in the EViews programming language.

Moderators: EViews Gareth, EViews Moderator, EViews Jason, EViews Matt

johnvaz@gmail.com
Posts: 8
Joined: Thu Mar 11, 2010 6:31 am

@pc(x) function does not work

Postby johnvaz@gmail.com » Thu Nov 21, 2013 10:44 pm

I using Eviews 8, and am trying to get the average absolute percentage change of a series
!AAPC = @mean(@abs(@pc(_yhat)))

and I get an error
@PC is an illegal or reserved name in "!AAPC = @MEAN(@ABS(@PC(_YHAT)))


or

for mean absolute error

!MAE = @sum(@abs( _yer)))/!h
!MAE is not defined or is an illegal command in "!MAE = @SUM(@ABS( _YER)))/13"
Is there something I am missing

EViews Glenn
EViews Developer
Posts: 2682
Joined: Wed Oct 15, 2008 9:17 am

Re: @pc(x) function does not work

Postby EViews Glenn » Fri Nov 22, 2013 12:27 pm

The @pc function only works for series destinations, not program variable or matrix destinations. You could generate a series with the values on the RHS of your expression, then grab the value using the @min, @max, @mean, etc.

Code: Select all

series temppc = @mean(@abs(@pc(_yhat))) !AAPC = @mean(temppc)
As to the other error, are you typing this in the command window or is this included in a program file that you are running?

johnvaz@gmail.com
Posts: 8
Joined: Thu Mar 11, 2010 6:31 am

Re: @pc(x) function does not work

Postby johnvaz@gmail.com » Sun Nov 24, 2013 6:07 am

I was trying to run this code in a program not on command line

EViews Gareth
Fe ddaethom, fe welon, fe amcangyfrifon
Posts: 13604
Joined: Tue Sep 16, 2008 5:38 pm

Re: @pc(x) function does not work

Postby EViews Gareth » Sun Nov 24, 2013 8:15 am

For the last error, you have a syntax error - two open parens and three close parens.


Return to “Programming”

Who is online

Users browsing this forum: No registered users and 2 guests