hi all,
I want to get this result
eq_m.@method name
LOG(M) LOG(Y) LOG(E) EC_M
but
eq_m.@varlist
only give me this
LOG(M) Y E EC_M
this my spec and substituted equations
eq_m.@spec
LOG(M)=C_M(1)*LOG(Y)+C_M(2)*LOG(E)+C_M(3) +EC_M
eq_m.@subst
LOG(M)=2.31873071534*LOG(Y)-1.92167062414*LOG(E)+7.28343455044 +EC_M
eq_m.@coeflist
C_M(1) C_M(2) C_M(3)
My final target is to transform
LOG(M)=2.31873071534*LOG(Y)-1.92167062414*LOG(E)+7.28343455044 +EC_M
into
EC_M=LOG(M)=2.31873071534*LOG(Y)-1.92167062414*LOG(E)+7.28343455044
Is there any alternative function for the varlist, so I don't have to do it the hard way
Thank you very much.
regards,
ginanjar
how to get the variable list like in the equations spec
Moderators: EViews Gareth, EViews Moderator, EViews Jason, EViews Matt
-
EViews Gareth
- Fe ddaethom, fe welon, fe amcangyfrifon
- Posts: 13583
- Joined: Tue Sep 16, 2008 5:38 pm
Re: how to get the variable list like in the equations spec
Hi Gareth,
I just changed my approach rather fighting the tools, so
the equation spec is now just
equation eq_m.ls(p) log(m) c log(y) log(e)
by removing ec_m term because it will throw error, but now I learn how to use addfactor
thanks,
ginanjar
I just changed my approach rather fighting the tools, so
the equation spec is now just
equation eq_m.ls(p) log(m) c log(y) log(e)
by removing ec_m term because it will throw error, but now I learn how to use addfactor
thanks,
ginanjar
Code: Select all
subroutine transform_ecm_from(string %eq_name, string %mod_name, string %ecm_series)
%ecm = ""
%varlist = {%eq_name}.@varlist
!ncoef = {%eq_name}.@ncoef
%ecm = %ecm_series
%ecm = %ecm + " = " + @wleft(%varlist,1) + " - ("
%ecm = %ecm + @str({%eq_name}.@coefs(1))
for !i=2 to (!ncoef)
%ecm = %ecm + " + " + @str({%eq_name}.@coefs(!i)) + "*" + @word(%varlist,1+!i)
next
%ecm = %ecm + ")"
{%mod_name}.append {%ecm}
endsub
Who is online
Users browsing this forum: No registered users and 2 guests
