index by year and commenting out text

For questions regarding programming in the EViews programming language.

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

eviewscg
Posts: 7
Joined: Mon Feb 09, 2009 7:09 am

index by year and commenting out text

Postby eviewscg » Mon Apr 06, 2009 6:47 am

Hi,
I have two technical programming questions. First, when you are writing a program, is there a way to block out comments or text so eviews does not read this as part of the program to run? For example, in stata I could type ///at the beginning of a line to designate that it was just a comment.

My second question has to do with when you are referencing an index in a command. I tried to create a formula for calculating real prices from nominal. It looked something like this:

frml prswd_cl_real=prswd_cl*(ppi_cl(2000)/ppi_cl)

However, I got an error saying 2000 wasn't a valid index. After a couple attempt I found that if I did:

frml prswd_cl_real=prswd_cl*(ppi_cl(-1)/ppi_cl)

it would use the previous ppi_cl value. I now realize that whatever number I put into parenthesis, eviews takes forward (or backwards) that many observations from the current. Is there a way to change this to a year instead of just going forward or backwards?

What I would like is to divide the base year (2000) ppi by every ppi_cl, so in the year 2000 I would have prswd_cl*1. Any year after 2000 I would have a number less than one (before 2000 greater than one). Is this doable? If so, how would I write it. Thanks!

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

Re: index by year and commenting out text

Postby EViews Gareth » Mon Apr 06, 2009 8:08 am

Hi.

You can use a apostrophe to signify a comment:

' this would be a comment line



You can use the @elem command to retrieve a single value for a given date.


Return to “Programming”

Who is online

Users browsing this forum: No registered users and 2 guests