Page 1 of 1

Use representation with substituted coefs from an eq?

Posted: Tue Dec 18, 2012 12:47 pm
by tzink
After estimating an equation, one can view the "representations" view, which also shows a version with the estimated coefficient values substituted in. This can then be copied and pasted into a model creation or append command with the expected outcome.

Is it possible to access this string automatically when creating a model? Something like:

Code: Select all

EQUATION eq1.ls x c y z MODEL model1 model1.append eq1.representations
..Of course, those commands don't work, but hopefully someone understands what I'm trying to accomplish here.

Thanks

Re: Use representation with substituted coefs from an eq?

Posted: Tue Dec 18, 2012 2:02 pm
by EViews Gareth
eq.@subst

You can see the list of available equation data members at the start of the Equation section in the Object Reference.

Re: Use representation with substituted coefs from an eq?

Posted: Tue Dec 18, 2012 3:17 pm
by tzink
Thanks Gareth. I knew there must be a data member, but I didn't know what it was called (I actually looked through the list you mentioned but it didn't pop out at me the first time).

Unfortunately I'm not quite getting it to work. The following produces an error in the model object:

Code: Select all

EQUATION eq1.ls x c y z MODEL model1 model1.append eq1.@subst
Or alternatively,

Code: Select all

EQUATION eq1.ls x c y z STRING eq_coefs = eq1.@subst MODEL model1 model1.append eq_coefs
This produces the string as expected, but encounters the same error in the mode object

Probably doing something silly here...

Re: Use representation with substituted coefs from an eq?

Posted: Wed Dec 19, 2012 6:34 pm
by tzink
For anyone who's curious, I figured it out after enough futsing, and the key is to use a string variable (p. 79 of the Command Reference):

Code: Select all

EQUATION eq1.ls x c y z %eq_coefs = eq1.@subst MODEL model1 model1.append %eq_coefs
There is probably a way to do it with a string object, or a direct reference, but I couldn't figure out how.