Use representation with substituted coefs from an eq?

For technical support, tips and tricks, suggestions, or any other information regarding the EViews model object.

Moderators: EViews Gareth, EViews Moderator

tzink
Posts: 28
Joined: Mon Oct 29, 2012 4:55 pm

Use representation with substituted coefs from an eq?

Postby tzink » Tue Dec 18, 2012 12:47 pm

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

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

Re: Use representation with substituted coefs from an eq?

Postby EViews Gareth » Tue Dec 18, 2012 2:02 pm

eq.@subst

You can see the list of available equation data members at the start of the Equation section in the Object Reference.
Follow us on Twitter @IHSEViews

tzink
Posts: 28
Joined: Mon Oct 29, 2012 4:55 pm

Re: Use representation with substituted coefs from an eq?

Postby tzink » Tue Dec 18, 2012 3:17 pm

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...

tzink
Posts: 28
Joined: Mon Oct 29, 2012 4:55 pm

Re: Use representation with substituted coefs from an eq?

Postby tzink » Wed Dec 19, 2012 6:34 pm

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.


Return to “Models”

Who is online

Users browsing this forum: No registered users and 9 guests