Page 1 of 1

Obtain certain cross-section fixed effects constant

Posted: Wed May 02, 2018 10:28 am
by brianleblanc
I've run a number of panel regressions in a loop, and I'm looking for a way to programmatically grab the FE contants.

I know that the following produces a table of the fixed effects constants.

Code: Select all

equation LR LR.ls Y = C(1) + C(2)*X LR.effects
Which for me produces a table like:

PROV Effect
1 ALBERTA 2.668232
2 B_COLUMb 1.730889
3 MANITOBA 1.205979
4 NBRUNSWK 0.225447
5 NFOUNLND -1.567084
6 NORTHWT -3.864254
7 NOVA_SCO 0.348455
8 NUNAVUT -3.607152
9 ONTARIO 3.806506
10 PRINCE_E -2.239777
11 QUEBEC 3.078946
12 SASKCHWN 0.926343
13 YUKON -2.712531


What I need is for a way to write the following string, for example:

"Y,ALBERTA = " @str(C(1)) + @str(2.668232) + @str(c(2)) + "*X, ALBERTA"

Where ALBERTA and 2.668232 come from the FE table above. I then need to iterate over B_COLUMB, MANITOBA, etc etc.

I can handle the iteration portion, I just don't know how to grab the info from LR.effects table

Re: Obtain certain cross-section fixed effects constant

Posted: Wed May 02, 2018 10:40 am
by EViews Gareth
Freeze it into a table object, then grab the contents from that frozen object.

Re: Obtain certain cross-section fixed effects constant

Posted: Wed May 02, 2018 10:41 am
by brianleblanc
How to I obtain the string values in the table?

For example, @val(table(2,2)) produces NA but I need it to produce ALBERTA

Re: Obtain certain cross-section fixed effects constant

Posted: Wed May 02, 2018 10:45 am
by EViews Gareth
Don't use @val.

Code: Select all

%a = table(2,2)