storing the sum of lags for multiple variables and models

For questions regarding programming in the EViews programming language.

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

undergrad
Posts: 9
Joined: Wed Jul 23, 2014 10:52 am

storing the sum of lags for multiple variables and models

Postby undergrad » Wed Jul 23, 2014 11:11 am

I'm working on a project in which I need to compare statistics for PDL regressions over many different models. I would like to store the sum of lags coefficient and t-Statistic for specific variables in each model. So far, I have been able to store the Akiake info criterion, Schwarz criterion and Durbin-Watson statistic in column vectors for each model. I would also like to be able to store the sum of lags coefficient and t-Statistic for two specific variables in each of 24 models.

My code stores 24 different PDL regression results in eq1 through eq24. At the end of the program I included these statements to store some statistics. Is there a similar statement I could write to save the sum of lags coefficient and t-Statistic for either individual or all variables in each model?

'Saving relevant statistics in column vectors
vector(24) akaike
for !j=1 to 24
akaike(!j)= eq!j.@aic
next

vector(24) schwarz
for !j=1 to 24
schwarz(!j)= eq!j.@schwarz
next

vector(24) durbinwatson
for !j=1 to 24
durbinwatson(!j)= eq!j.@dw
next


It seems like these coefficients and t-Statistics would have to get stored in a matrix with dimensions (24 x # of variables), but I'm not sure how to specifically access them.

Thanks for your help

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

Re: storing the sum of lags for multiple variables and model

Postby EViews Gareth » Wed Jul 23, 2014 11:15 am

equationname.@coefs gets you the coefficients. equationname.@tstats gets you the t-statistics.

You'll have to use the colplace function to insert them into the matrix at the right column. Examples are given here:
http://forums.eviews.com/viewtopic.php?f=5&t=1638
(just do a search on that page for colplace).

undergrad
Posts: 9
Joined: Wed Jul 23, 2014 10:52 am

Re: storing the sum of lags for multiple variables and model

Postby undergrad » Wed Jul 23, 2014 1:37 pm

I'm unfortunately still having issues.
This is an example of a subset of regressions I am running, followed by an attempt at storing the coefficient values in a matrix. I'm getting two types of errors, either a non-numeric value error or a matrix size mismatch error. They both happen with the very first equation, for .@coefs and .@tstats. I played around with the matrix size and no matter how large or small I make it (though it should just fit the output I want), I still get the matrix size mismatch error.

!FL=3
!OL=3
!D=2
for !i=1 to 3
eq!i.ls(cov=hac,p) ps!i c time pdl(ipr,!OL,!D) pdl(un,!OL,!D) pdl(unionprq,!OL,!D) pdl(unipr,!OL,!D) pdl(unionipr,!OL,!D) pdl(tsaspl,!FL,!D) pdl(tfp4,!FL,!D)
next

'8 explanatory variables, 24 total equations
matrix(8,24) coefs
for !i=1 to 24
colplace(coefs, eq!i.@coefs, !i) 'or alternatively colplace(coefs!i,@tstats, !i) ... with a 1x24 matrix
next

I must be interpreting the output of eq!i.@coefs/tstats incorrectly, but I haven't been able to figure it out. Thanks again for your help.

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

Re: storing the sum of lags for multiple variables and model

Postby EViews Gareth » Wed Jul 23, 2014 2:06 pm

If you look at the size of eq1.@coefs, you'll notice it includes all the pdl terms too, and so has way more than 8 rows.


Return to “Programming”

Who is online

Users browsing this forum: No registered users and 2 guests