Panel data export

For questions regarding programming in the EViews programming language.

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

jaromir
Posts: 2
Joined: Mon Nov 17, 2008 2:03 am

Panel data export

Postby jaromir » Mon Nov 17, 2008 6:16 am

Hello,
I have been making my first steps with EViews programming and data exporting.

For panel models with fixed cross-section effects, you can display the values of the cross-section effects in model view options. My question is: is there a way to export these data to a table (or - I believe I've seen it - to a series) using programming?

Regards and thank you

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

Re: Panel data export

Postby EViews Gareth » Mon Nov 17, 2008 9:13 am

You can use the @effects data member of your equation to save them into a vector:

Code: Select all

vector cx = eq1.@effects
Follow us on Twitter @IHSEViews

jaromir
Posts: 2
Joined: Mon Nov 17, 2008 2:03 am

Re: Panel data export

Postby jaromir » Wed Nov 19, 2008 6:24 am

Thank you.

Does this feature works for equation objects (as well as pools)? I keep getting a "Syntax error" when I try to use it...

Regards

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

Re: Panel data export

Postby EViews Gareth » Wed Nov 19, 2008 9:02 am

Is your copy of EViews up-to-date?
Follow us on Twitter @IHSEViews

j.galimberti
Posts: 23
Joined: Fri Feb 06, 2009 2:53 am

Re: Panel data export

Postby j.galimberti » Fri Feb 06, 2009 5:32 am

Alternatively, you can do it without the new function:
1 - Fit the equation to a temporary series:
eq01.fit(u,f=na) tmp_series
2 – Lets say your equation is specified as: y=c(1)+c(2)*x1+c(3)*x2. Then you can generate a series with the fixed effects with:
genr fix_effects=tmp_series-(eq01.@coefs(1)+eq01.@coefs(2)*x1+eq01.@coefs(3)*x2)

The generated series will have the fixed effects (I didn’t tested for random effects) that you have specified in your equation. However, if you specified cross-section and period effects, the series will represent the sum of both.
Galimberti, J. K.
MSc in Economics at Federal University of Santa Catarina (Brazil)
Going to PhD in Economics at University of Manchester (UK)
Website: http://sites.google.com/site/jkgeconoeng/

Dusan
Posts: 5
Joined: Mon Jan 19, 2009 4:49 am

Re: Panel data export

Postby Dusan » Mon Feb 23, 2009 8:55 am

Hi,
I m running a loop of multiple regressions and I only need the R2( R squared) of them in a matrix, vector, excel or whatever!
I would be really greatful if u could help me on this.
(Till now the only thing that I succeeded was to have a matrix(or vector) for each R2.So, alternative if u could help me on how I can transform all these vectors(matrixes) in one it would also be perfect.)

j.galimberti
Posts: 23
Joined: Fri Feb 06, 2009 2:53 am

Re: Panel data export

Postby j.galimberti » Tue Mar 03, 2009 11:14 am

If I correctly understand what you want I would do something like this:

Let's say you have a table with each row representing an equation that you would like to estimate, and each column representing a variable. The first, obviously, is the dependent variable. Name this table as "specifications"

!n=1
while @isempty(specifications(!n,1))=0
%comand=""
!n2=1
while @isempty(specifications(!n,!n2))=0
%comand=%comand+specifications(!n,!n2)+" "
!n2=!n2+1
wend
equation eq1.ls {%comand} ''' Here is the estimation
vector(!n) r2s
r2s(!n)=eq1.@r2
!n=!n+1
wend

This program will create a vector called r2s with the r-squared of each specification contained in the table "specifications".

I hope it helps.
Galimberti, J. K.
MSc in Economics at Federal University of Santa Catarina (Brazil)
Going to PhD in Economics at University of Manchester (UK)
Website: http://sites.google.com/site/jkgeconoeng/


Return to “Programming”

Who is online

Users browsing this forum: Google [Bot] and 27 guests