An introduction to EViews programming.

For questions regarding programming in the EViews programming language.

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

samonia
Posts: 2
Joined: Thu Nov 20, 2014 4:11 am
Contact:

Re: An introduction to EViews programming.

Postby samonia » Thu Nov 20, 2014 4:37 am

I would like to store in a vector (or in a group, I don't know) the "s.e. of regression"s for all my 17 equations that I have in a file. What would be the command line for that? Thank you a lot.
_______________
врати блиндирани врати входни врати интериорни врати
Last edited by samonia on Sun Nov 30, 2014 5:58 am, edited 1 time in total.

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

Re: An introduction to EViews programming.

Postby EViews Gareth » Thu Nov 20, 2014 8:41 am

Code: Select all

%eqlist = @wlookup("*","equation") !n = @wcount(%eqlist) vector(!n) ses for !i=1 to !n %eq = @word(%eqlist, !i) ses(!i) = {%eq}.@se next
Follow us on Twitter @IHSEViews

neshate
Posts: 6
Joined: Tue Mar 31, 2015 7:25 am

Re: An introduction to EViews programming.

Postby neshate » Tue Mar 31, 2015 7:31 am

Hi guys, I am new to Eviews. I have a couple of question and appreciate any help.

I have the following code and trying to understand what it does: Specifically I need to first know what does w{%Y}(!i+1) mean?
Last edited by neshate on Tue Mar 31, 2015 3:25 pm, edited 1 time in total.

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

Re: An introduction to EViews programming.

Postby EViews Gareth » Tue Mar 31, 2015 7:53 am

You have two for loops. The first loops through %Y, the second loops through !i.

%Y is looping through object names. !i is looping through elements. Thus the first time through, we have w{%y}(!i+1), which means w914(1), which is the first element of the vector w914.
Follow us on Twitter @IHSEViews

neshate
Posts: 6
Joined: Tue Mar 31, 2015 7:25 am

Re: An introduction to EViews programming.

Postby neshate » Tue Mar 31, 2015 7:57 am

Thanks. So does that mean we never enter the if statement because we have not defined w914 yet?

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

Re: An introduction to EViews programming.

Postby EViews Gareth » Tue Mar 31, 2015 8:02 am

w914 must have existed prior to running the program. You'll enter the if statement if the first element of it is not equal to an NA.
Follow us on Twitter @IHSEViews

neshate
Posts: 6
Joined: Tue Mar 31, 2015 7:25 am

Re: An introduction to EViews programming.

Postby neshate » Tue Mar 31, 2015 8:07 am

Ohhh. Thank you very much. That helped a lot. So, I have two more question:

1. w{%Y}eqb{!i}.ls log(w{%Y}) C YEAR does this generate a least square regression of log(w914) with some constant ? What is YEAR? does this also exist before running?

2. What does this mean? w{%Y}eqa{!i}.c(2)

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

Re: An introduction to EViews programming.

Postby EViews Gareth » Tue Mar 31, 2015 8:20 am

1) It estimates an equation of log(w194) on a constant and the variable year (which would have to previously exist, yes). It stores this equation in the object w914eqb1
2) It retrieves the second coefficient from the equation w914eqb1
Follow us on Twitter @IHSEViews

neshate
Posts: 6
Joined: Tue Mar 31, 2015 7:25 am

Re: An introduction to EViews programming.

Postby neshate » Tue Mar 31, 2015 8:33 am

Excuse me if I am asking stupid questions. what is the effect of smpl 1960+!i 1965+!i? does this mean that we have selected certain values of w914 for eqa and eqb?

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

Re: An introduction to EViews programming.

Postby EViews Gareth » Tue Mar 31, 2015 8:47 am

Yes. Only observations between 1960+1 and 1965+1 etc...
Follow us on Twitter @IHSEViews

neshate
Posts: 6
Joined: Tue Mar 31, 2015 7:25 am

Re: An introduction to EViews programming.

Postby neshate » Tue Mar 31, 2015 9:34 am

1. What is the format of w914eqa0 and w914eqb0 look like? I am trying to figure out what kind of table the .results line generates? for example when we try to access (4,1) element or (10,2)?


2. What does that 0.02 and 0.035 comes from? I feel that this program tries to do a t-test on a sample data, but I can not explain how. Any help on this is appreciated.

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

Re: An introduction to EViews programming.

Postby EViews Gareth » Tue Mar 31, 2015 9:53 am

I think you'll have to play around a bit and figure out the rest :D
Follow us on Twitter @IHSEViews

neshate
Posts: 6
Joined: Tue Mar 31, 2015 7:25 am

Re: An introduction to EViews programming.

Postby neshate » Tue Mar 31, 2015 12:02 pm

Thanks for the help. Unfortunately, I do not have access to eviews and that is why I am not able to run this program ans see the results. But, thanks anyway. You helped a lot.

maujasmin
Posts: 4
Joined: Wed Nov 25, 2009 7:40 am

Re: An introduction to EViews programming.

Postby maujasmin » Fri Jul 03, 2015 2:31 am

Hi, I am new here so I hope you could help me.

We are doing an index for our work and it utilizes principal component analysis.
Basically, I have 10 variables which need to normalize. After normalizing the variables , I need to run a principal component analysis for these variables.
Once I have done that, I need to get the the 1st principal component for each variable and multiply that with the normalized values.
To get the index, I just need to add those values ( normalized values* 1st principal component)

So I would like to know if you could give the syntax.
What I want to do is to import the data from an excel file and run the commands I enumerated above.

TIA!

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

Re: An introduction to EViews programming.

Postby EViews Gareth » Fri Jul 03, 2015 8:30 am

What have you go so far?
Follow us on Twitter @IHSEViews


Return to “Programming”

Who is online

Users browsing this forum: Baidu [Spider], Bing [Bot] and 2 guests