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
Panel data export
Moderators: EViews Gareth, EViews Jason, EViews Moderator, EViews Matt
-
- Fe ddaethom, fe welon, fe amcangyfrifon
- Posts: 13317
- Joined: Tue Sep 16, 2008 5:38 pm
Re: Panel data export
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
Re: Panel data export
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
Does this feature works for equation objects (as well as pools)? I keep getting a "Syntax error" when I try to use it...
Regards
-
- Fe ddaethom, fe welon, fe amcangyfrifon
- Posts: 13317
- Joined: Tue Sep 16, 2008 5:38 pm
-
- Posts: 23
- Joined: Fri Feb 06, 2009 2:53 am
Re: Panel data export
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.
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/
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/
Re: Panel data export
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.)
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.)
-
- Posts: 23
- Joined: Fri Feb 06, 2009 2:53 am
Re: Panel data export
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.
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/
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/
Who is online
Users browsing this forum: Google [Bot] and 27 guests