Equation Variable Name Output

For questions regarding programming in the EViews programming language.

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

Dmpace
Posts: 4
Joined: Fri Dec 18, 2009 2:26 pm

Equation Variable Name Output

Postby Dmpace » Fri Dec 18, 2009 2:36 pm

Is there a way to output an equation's variable name and associated coefficient to a table? We are running multiple equations and outputting the coefficients and t-stats to a table. We want to include the variable name next to the relevant statistic, but are unable to find a way to do this. Would anyone have any insight on how to do this?

David

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

Re: Equation Variable Name Output

Postby EViews Gareth » Fri Dec 18, 2009 2:59 pm

Lots of different ways.

Possibly the easiest would be to freeze the regression output into a table:

Code: Select all

freeze(mytab) eq1.stats
and then extract the info from the cells of that table, using the copyrange command.

Dmpace
Posts: 4
Joined: Fri Dec 18, 2009 2:26 pm

Re: Equation Variable Name Output

Postby Dmpace » Fri Dec 18, 2009 3:13 pm

I am not familiar with the copyrange command and counldn't find in the help guide. Would you be able to show me an example?

Thank you.

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

Re: Equation Variable Name Output

Postby EViews Gareth » Fri Dec 18, 2009 3:17 pm

copyrange is only available in EViews 7, but is fairly well documented in the Table section of the Object Reference.

I'll copy the relevant parts here:

Syntax

Code: Select all

table_name.copyrange s1 s2 destname d1 table_name.copyrange sr1 sc1 sr2 sc2 destname dr1 dc1
The copyrange command can be specified either using coordinates where columns are signified with a letter, and rows by a number (for example “A3” represents the first column, third row), or by row number and column number.

The first syntax represents coordinate form, where s1 specifies the upper-left coordinate portion of the section of the source table to be copied, s2 specifies the bottom-right coordinate, destname specifies the name of the table to copy to, and d1 specifies the upper-left coordinate of the destination table.

The second syntax represents the row/column number form, where sr1 specifies the source table upper row number, sc1 specifies the source table left most column number, sr2 specifies the source table bottom row number, sc2 specifies the source table right most column number. destname specifies the name of the table to copy to, and dr1 and dr2 specify the upper and left most row and column of the destination table, respectively.

Examples

Code: Select all

table1.copyrange B2 D4 table2 A1
places a copy of the data from cell range B2 to D4 in TABLE1 to TABLE2 at cell A1

Code: Select all

table1.copyrange 1 1 1 5 table2 1 3
copies 5 rows of data in the first column of data in table1 to the top of the 3rd column of TABLE2.

Dmpace
Posts: 4
Joined: Fri Dec 18, 2009 2:26 pm

Re: Equation Variable Name Output

Postby Dmpace » Fri Dec 18, 2009 3:25 pm

Unfortunately we have Eviews 6. Is there a way to do it in this version?

Thank you.

David

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

Re: Equation Variable Name Output

Postby EViews Gareth » Fri Dec 18, 2009 3:27 pm

You'll just have to copy each cell of the table one at a time.

mytable1(5,1) = mytable2(6,4)

copies cell 6,4 from mytable2 into cell 5,1 in mytable1

Dmpace
Posts: 4
Joined: Fri Dec 18, 2009 2:26 pm

Re: Equation Variable Name Output

Postby Dmpace » Fri Dec 18, 2009 3:48 pm

Thank you. This is helpful. Out of interest, is there any way to identify a variable or regressor name in a similar way to capturing a regression statistic? (i.e. @ncoef)

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

Re: Equation Variable Name Output

Postby EViews Gareth » Fri Dec 18, 2009 4:57 pm

Not in EViews 6.


Return to “Programming”

Who is online

Users browsing this forum: No registered users and 2 guests