LOOP PROGRAMMING

For questions regarding programming in the EViews programming language.

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

EViews Matt
EViews Developer
Posts: 560
Joined: Thu Apr 25, 2013 7:48 pm

Re: LOOP PROGRAMMING

Postby EViews Matt » Tue Oct 23, 2018 11:03 am

I merely opened your workfile, created a new program, pasted in your code (with the required "next"):

Code: Select all

for !i = 1 to 28
   equation eq!i.ls y!i x!ia x!ib x!ic x!id c
next

Clicked the "Run" button, and the equations were created successfully.

adarshad
Posts: 101
Joined: Wed Sep 05, 2018 10:32 am

Re: LOOP PROGRAMMING

Postby adarshad » Tue Oct 23, 2018 2:39 pm

i have tried my code based on your guidance but all the times it doesnot work;i am using eviews8 and i run code in command window but it comes with error.i have my datafile sent to you.i open it and run this code in window but it comes with error;;;as i mentioned;please help me;;i am very near to my finding after long work

adarshad
Posts: 101
Joined: Wed Sep 05, 2018 10:32 am

Re: LOOP PROGRAMMING

Postby adarshad » Tue Oct 23, 2018 2:40 pm

what do you mean by created a new program

adarshad
Posts: 101
Joined: Wed Sep 05, 2018 10:32 am

Re: LOOP PROGRAMMING

Postby adarshad » Tue Oct 23, 2018 2:44 pm

you mean the upper white space;;you cannot understand the anxiety i feeling
Attachments
ad.png
ad.png (80.11 KiB) Viewed 7691 times

adarshad
Posts: 101
Joined: Wed Sep 05, 2018 10:32 am

Re: LOOP PROGRAMMING

Postby adarshad » Tue Oct 23, 2018 2:54 pm

thankyou i got how to run the program ;i wasnot running program in program window and was doing in command window;now i can do it in program window and run and extend my analysis.thankyou for the guidance and persistent help;i was just doomed by my ignorance;now atleast i can try doing my work thanks

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

Re: LOOP PROGRAMMING

Postby EViews Gareth » Tue Oct 23, 2018 4:10 pm

The best way to cure your ignorance is to read the documentation and links that people have given you in this thread. There are no short cuts.
Follow us on Twitter @IHSEViews

adarshad
Posts: 101
Joined: Wed Sep 05, 2018 10:32 am

Re: LOOP PROGRAMMING

Postby adarshad » Thu Oct 25, 2018 3:18 am

'create matrix to store pvalues. We'll be running 28 regressions with SIX pvalues in each row , five for five independent variables and one for intercept
matrix(6,28) pv
matrix(6,28) coefs 'create matrix to store coefficients
vector(28) r2s 'create vector to store rsquare value
vector(28) aic 'create vector to store akaike information criteria value
'create empty equation to be used inside the loop
equation eq
!rowcounter=1

'run pairwise regressions between Yi and Xi
for !i=1 to 28
'estimate equation
eq.ls y{!i} c x{!i}A(-1) x{!i}B x{!i}C x{!i}D x{!i}E



'store coefficients into matrix
colplace(pv, eq.@pval, !i)
colplace(coefs, eq.@coefs, !i)
r2s(!rowcounter) = eq.@r2
aic(!rowcounter) = eq.@aic
!rowcounter = !rowcounter+1
next

adarshad
Posts: 101
Joined: Wed Sep 05, 2018 10:32 am

Re: LOOP PROGRAMMING

Postby adarshad » Thu Oct 25, 2018 3:20 am

can you help me to define the program to select best value of lg for all regressors in all equations to find best probable model or atleast for each equation seperaely but for all regressors seperately;;any guideline;;thanks for your help

adarshad
Posts: 101
Joined: Wed Sep 05, 2018 10:32 am

Re: LOOP PROGRAMMING

Postby adarshad » Thu Oct 25, 2018 9:10 am

i require help fo aic selection for one regressor or may be multiple regressors and multiple equations.can someone do that

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

Re: LOOP PROGRAMMING

Postby startz » Thu Oct 25, 2018 9:22 am

adarshad,

It is unlikely that someone is going to write programs for you. If you are going to be doing a lot of this, you probably need to figure out how to do this for yourself. People may be able to help find a specific bug or give you suggestions, but the work is going to mostly have to be your own.

adarshad
Posts: 101
Joined: Wed Sep 05, 2018 10:32 am

Re: LOOP PROGRAMMING

Postby adarshad » Thu Oct 25, 2018 9:50 am

and can i jion differrent vctor and matrixs having same number of rows into one matrix to get output in one matrix

adarshad
Posts: 101
Joined: Wed Sep 05, 2018 10:32 am

Re: LOOP PROGRAMMING

Postby adarshad » Thu Oct 25, 2018 9:52 am

can you give any link for calculating aic for multiple regerrsos;
i had worked my way up and its lot of learning but i have not seen any program selecting lag value for multiple regressors

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

Re: LOOP PROGRAMMING

Postby startz » Thu Oct 25, 2018 9:54 am

EViews automatically computes and displays the AIC for you every time you run a regression.

adarshad
Posts: 101
Joined: Wed Sep 05, 2018 10:32 am

Re: LOOP PROGRAMMING

Postby adarshad » Thu Oct 25, 2018 10:33 am

i just want to calculate best lag value on the basis of aic for multiple regressors


Return to “Programming”

Who is online

Users browsing this forum: No registered users and 28 guests