Table labelling

For questions regarding programming in the EViews programming language.

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

MaxMude
Posts: 2
Joined: Wed Feb 11, 2015 7:26 am

Table labelling

Postby MaxMude » Wed Feb 11, 2015 7:35 am

Hi,

Does anybody knows a code/program to name columns of a table.

I have a program which gives me a table, but the columns aren’t labelled. Therefore I would just need a code to name columns of a table.

Code: Select all

!coeff = 14 'number of variables (c, the constant counts as a variable) !row = !cts 'number of countries => number of rows !col = !coeff*2 + 4 ' no of coeff + no of t values + 4 for the summary stats => number of columns table(!row, !col) _out 'that's the name of the table 'read the data into the table for !i = 1 to !row for !j = 1 to !coeff _out(!i,1+ 2*!j -1) = eq_{!i}.@coef(!j) _out(!i,1+ 2*!j ) = eq_{!i}.@tstat(!j) next _out(!i,1) = country(!i) _out(!i,!col-2) = eq_{!i}.@regobs _out(!i,!col-1) = eq_{!i}.@r2 _out(!i,!col) = eq_{!i}.@dw

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

Re: Table labelling

Postby EViews Gareth » Wed Feb 11, 2015 8:03 am

Code: Select all

Mytable(1,1) = "colheader1" Mytable(1,2) = "colheader2" Mytable(1,3) = "colheader3"

MaxMude
Posts: 2
Joined: Wed Feb 11, 2015 7:26 am

Re: Table labelling

Postby MaxMude » Wed Feb 11, 2015 8:26 am

thanks, that works already beautifully!

however, is it possible to combine the header or any labelling of the columns with this code

Code: Select all

!coeff = 14 'number of variables (c, the constant counts as a variable) !row = !cts 'number of countries => number of rows !col = !coeff*2 + 4 ' no of coeff + no of t values + 4 for the summary stats => number of columns table(!row, !col)_out 'that's the name of the table 'read the data into the table for !i = 1 to !row for !j = 1 to !coeff _out(!i,1+ 2*!j -1) = eq_{!i}.@coef(!j) _out(!i,1+ 2*!j ) = eq_{!i}.@tstat(!j) next _out(!i,1) = country(!i) _out(!i,!col-2) = eq_{!i}.@regobs _out(!i,!col-1) = eq_{!i}.@r2 _out(!i,!col) = eq_{!i}.@dw
so that it automatically labels "t-test" above all the t-test columns f.e. because the amount of explanatory variables changes and with 14 explanatory variables I get 14 columns for the variables + 14 variables for the t-test + DW-test etc. etc. which is pretty much to lable by hand!

thanks

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

Re: Table labelling

Postby EViews Gareth » Wed Feb 11, 2015 9:09 am

Take a look at the EqOutputTab library:
http://www.eviews.com/Addins/addins.shtml#libraries


Return to “Programming”

Who is online

Users browsing this forum: No registered users and 2 guests