Automatically Generate Interaction and Quadratic Terms

For technical questions regarding estimation of single equations, systems, VARs, Factor analysis and State Space Models in EViews. General econometric questions and advice should go in the Econometric Discussions forum.

Moderators: EViews Gareth, EViews Moderator

kruupy
Posts: 11
Joined: Thu Aug 14, 2014 11:38 pm

Automatically Generate Interaction and Quadratic Terms

Postby kruupy » Sun Aug 17, 2014 11:49 pm

Hi all,

I need to estimate an 11 variable translog function. Translog functions involve a sqaured term for each of the variables aswell as including all possible combinations of interaction terms. Can Eviews automatically generate these for me? - as is going to take me a long long time to write them out manually.

Cheers,
Andrew.

kruupy
Posts: 11
Joined: Thu Aug 14, 2014 11:38 pm

Re: Automatically Generate Interaction and Quadratic Terms

Postby kruupy » Mon Aug 18, 2014 5:14 am

I am now trying to get Eviews and Matlab to talk. So I can use Matlab code to create the estimations i need.

In Matlab I have a string variable defined as "regression" which equals 'read c d_male'. I then run the following Eview code:

xopen(type=m)
xrun "run d:\eviews.m"
xget regression
xclose

Eviews then gets the variable successfully from matlab, and stores it in an SVector. How do I now use this SVector to estimation the equation "read c d_male"?

kruupy
Posts: 11
Joined: Thu Aug 14, 2014 11:38 pm

Re: Automatically Generate Interaction and Quadratic Terms

Postby kruupy » Mon Aug 18, 2014 6:00 am

Ok ive got it to work now however, is there a max string length or something? - because when I run the regression it compains about missing parenthesis because it cuts the string down.....

kruupy
Posts: 11
Joined: Thu Aug 14, 2014 11:38 pm

Re: Automatically Generate Interaction and Quadratic Terms

Postby kruupy » Mon Aug 18, 2014 6:26 am

The answer is yes, once i cut the big string into smaller parts the OLS regression worked, cheers.

startz
Non-normality and collinearity are NOT problems!
Posts: 3796
Joined: Wed Sep 17, 2008 2:25 pm

Re: Automatically Generate Interaction and Quadratic Terms

Postby startz » Mon Aug 18, 2014 7:19 am

Take a look at Options/General options/Series and Alphas/Alpha truncation and see if changing the value there helps.

EViews Steve
EViews Developer
Posts: 844
Joined: Tue Sep 16, 2008 3:00 pm
Location: Irvine, CA

Re: Automatically Generate Interaction and Quadratic Terms

Postby EViews Steve » Mon Aug 18, 2014 8:31 am

I've taken a look again at the EViews code that is used to talk to MATLAB and I don't think their is a limit to the size of a string that can be retrieved. There may be issues with retrieving a string that contains newline characters in it (\n) because of the ambiguity of how MATLAB returns matrices (a 2x2 matrix is returned using spaces and newline characters as column and row delimiters). Or perhaps MATLAB itself is limiting the max size...


Return to “Estimation”

Who is online

Users browsing this forum: No registered users and 2 guests