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
storing the sum of lags for multiple variables and models
Moderators: EViews Gareth, EViews Moderator, EViews Jason, EViews Matt
-
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
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).
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).
Re: storing the sum of lags for multiple variables and model
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.
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
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.
Who is online
Users browsing this forum: No registered users and 1 guest
