Basic programing

For questions regarding programming in the EViews programming language.

Moderators: EViews Gareth, EViews Jason, EViews Moderator

a.do88
Posts: 27
Joined: Sat May 27, 2017 10:01 pm

Basic programing

Postby a.do88 » Wed Oct 25, 2017 8:30 am

Hi

I tried to use the Eviews programming but was struggling at the very first step. I have an Eviews work file that I saved as DATA which is stored in the Documents in Disk C that I am working on. So I created a program call TESTING and try to open the work file DATA. I have tried so many ways but could not open it.

What I did is open the TESTING program that I created, then key in the commands and click RUN.

The commands that I tried are:
wfopen data then click RUN ========> I got this message: file is found not on disk in wfopendata
wfopen data.wf1
wfopen c:\users\anhdo\documents\data
wfopen c:\users\anhdo\documents\data.wf1

Could you please help... :(

Thank you

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

Re: Basic programing

Postby EViews Gareth » Wed Oct 25, 2017 8:31 am

Are you certain the file exists in that location?
Follow us on Twitter @IHSEViews

a.do88
Posts: 27
Joined: Sat May 27, 2017 10:01 pm

Re: Basic programing

Postby a.do88 » Wed Oct 25, 2017 8:33 am

I open the properties of the file and copy the file path from there...
The folder that I saved the file is This PC \ Documents

a.do88
Posts: 27
Joined: Sat May 27, 2017 10:01 pm

Re: Basic programing

Postby a.do88 » Wed Oct 25, 2017 8:36 am

Oh so sorry, I actually saved the file in another folder in the documents folder. I just moved the file to Documents and it works when I used the command wfopen data.wf1 !!!!

Amazing!!

How come it does not work when I saved in another folder (it called 6.PhD\thesis), even I have stated the full paths : c\users\anhdo\documents\6.phd\thesis

a.do88
Posts: 27
Joined: Sat May 27, 2017 10:01 pm

Re: Basic programing

Postby a.do88 » Wed Oct 25, 2017 8:51 am

Hi Gareth,

If I want to create an object that includes 4 return series, should I create a string variable or a matrix??

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

Re: Basic programing

Postby EViews Gareth » Wed Oct 25, 2017 10:53 am

You’ll have to provide more information
Follow us on Twitter @IHSEViews

a.do88
Posts: 27
Joined: Sat May 27, 2017 10:01 pm

Re: Basic programing

Postby a.do88 » Thu Oct 26, 2017 5:07 am

I have 17 countries (17 time series of log returns) and I want to run EGARCH for each pair of countries. If I do it one by one, I will have to do it 17x17 = 289 times (because each country will be an endogenous and exogenous variable), so I would like to create a loop (or something like that) to make it automatically run for 17 countries.

I tried to start with the string variable because I thought that I can assign 17 time series to that string variable. Is that correct?

a.do88
Posts: 27
Joined: Sat May 27, 2017 10:01 pm

Re: Basic programing

Postby a.do88 » Thu Oct 26, 2017 6:09 am

Sorry Gareth, but can you please show me how to create a loop to transfer my price series into first difference log series?
say I have a prices series for 3 countries as AU UK and US.

So I tried this command

'%p = "AU UK US"
create 3 ln series
for %p
series ln{%p}=log{%p}
next

It says the "incomplete command in batch mode in CREATE 3 SERIES"

Can you please help

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

Re: Basic programing

Postby EViews Gareth » Thu Oct 26, 2017 7:59 am

Take out the line "create 3 ln series"
Follow us on Twitter @IHSEViews

startz
Non-normality and collinearity are NOT problems!
Posts: 3178
Joined: Wed Sep 17, 2008 2:25 pm

Re: Basic programing

Postby startz » Thu Oct 26, 2017 8:12 am

Or start the line with an apostrophe if it was intended to be a comment

a.do88
Posts: 27
Joined: Sat May 27, 2017 10:01 pm

Re: Basic programing

Postby a.do88 » Thu Oct 26, 2017 9:04 am

Hi Gareth,

I took out the "create 3 ln series" and ran it again

'%p = "UK US"
for %p
series ln{%p} = log{%p}
next
then i got the message "syntax erro in control statement in "FOR %P"

so I changed it to :
'%p = "UK US"
for %p UK US
series ln{%p} = log{%p}
next

and I got LOGUK is not defined in "SERIES LN{%P}=LOGUK"

then I tried it one more time:
for %p UK US
series ln{%p} = log{%p}
next

and I got the same message LOGUK is not defined in "SERIES LN{%P}=LOGUK".

Can you please let me know where to fix my command.

Thanks a lot for your help.

a.do88
Posts: 27
Joined: Sat May 27, 2017 10:01 pm

Re: Basic programing

Postby a.do88 » Thu Oct 26, 2017 9:06 am

startz wrote:Or start the line with an apostrophe if it was intended to be a comment

Thanks Starz- I did, but it still does not work...

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

Re: Basic programing

Postby EViews Gareth » Thu Oct 26, 2017 9:10 am

You need log({%p}).

At this point you're probably best off going through some of the online resources for learning EViews programming.
http://www.eviews.com/Learning/programming_a.html
http://www.eviews.com/help/helpintro.ht ... cs.html%23
viewtopic.php?f=5&t=1638
Follow us on Twitter @IHSEViews

a.do88
Posts: 27
Joined: Sat May 27, 2017 10:01 pm

Re: Basic programing

Postby a.do88 » Fri Oct 27, 2017 11:38 am

EViews Gareth wrote:You need log({%p}).

At this point you're probably best off going through some of the online resources for learning EViews programming.
http://www.eviews.com/Learning/programming_a.html
http://www.eviews.com/help/helpintro.ht ... cs.html%23
viewtopic.php?f=5&t=1638


Thanks Gareth! It is really useful!


Return to “Programming”

Who is online

Users browsing this forum: Bing [Bot] and 6 guests