Page 1 of 1

linefit & equation in the spool object

Posted: Mon Apr 18, 2016 10:44 am
by ecofin
hi,
i would like to show linefit in the five graph, and store every equation and graph in the spool objects, for example the eq_y_f the fist and g_y_f the second (every eqaution with the graph corresponding) and so on
group g1 y x z f h q
for !i=1 to 1
%iname=g1.@seriesname(!i)
for !j=!i+1 to g1.@count
%jname=g1.@seriesname(!j)
'generate 5 equation
equation eq_{%iname}_{%jname}.ls {%iname} {%jname}
' create 5 graph with line and save it in the wf
graph g_{%iname}_{%jname}.scat{%linefit} {%iname} {%jname}
{%spool}.display
next
next

Re: linefit & equation in the spool object

Posted: Mon Apr 18, 2016 10:48 am
by EViews Gareth

Re: linefit & equation in the spool object

Posted: Mon Apr 18, 2016 10:59 am
by ecofin
:D
1-but the linefit doesnt appear in the graph :roll: there is a mistake
group g1 y x z f h q
for !i=1 to 1
%iname=g1.@seriesname(!i)
for !j=!i+1 to g1.@count
%jname=g1.@seriesname(!j)
'generate 5 equation
equation eq_{%iname}_{%jname}.ls {%iname} {%jname}
' create 5 graph with line and save it in the wf
graph g_{%iname}_{%jname}.scat{%linefit} {%iname} {%jname}
spool myspool
myspool.append eq_{%iname}_{%jname} g_{%iname}_{%jname}.scat{%linefit}
next
next
2- suppose that i would like the show all eqaution followed by all graph in the spool( five equation followed by 5 graph), can you guide me.

Re: linefit & equation in the spool object

Posted: Tue Apr 19, 2016 7:42 am
by ecofin
i have solved my second case but how can make regression line in all graph. could you help me please.
group g1 y x z f h q
for !i=1 to 1
%iname=g1.@seriesname(!i)
for !j=!i+1 to g1.@count
%jname=g1.@seriesname(!j)
'generate 5 equation
equation eq_{%iname}_{%jname}.ls {%iname} {%jname}
' create 5 graph with line and save it in the wf
graph g_{%iname}_{%jname}.scat{%linefit} {%iname} {%jname}
spool sp
sp.insert(offset=first) eq_{%iname}_{%jname}
sp.insert g_{%iname}_{%jname}
delete g_{%iname}_{%jname}
next
next
sp.move(offset=first) untitled01
sp.move(loc=untitled02) untitled09
sp.move(loc=untitled05) untitled03
sp.move(loc=untitled09) untitled07

Re: linefit & equation in the spool object

Posted: Tue Apr 19, 2016 8:03 am
by EViews Gareth
You'll have to explain it a bit better.

Re: linefit & equation in the spool object

Posted: Tue Apr 19, 2016 8:34 am
by ecofin
i would like to make linefit with y x, y z, y q, y h, y f (y is dependent variable), the problem when i right this code the linefit doesn't appear in the all graph just the scatter.

Code: Select all

graph g_{%iname}_{%jname}.scat{%linefit} {%iname} {%jname}

Re: linefit & equation in the spool object

Posted: Tue Apr 19, 2016 8:37 am
by EViews Gareth
What do you mean all the graph?

Re: linefit & equation in the spool object

Posted: Tue Apr 19, 2016 8:41 am
by ecofin
g_y_f , g_y_x, ....

Re: linefit & equation in the spool object

Posted: Tue Apr 19, 2016 8:48 am
by EViews Gareth
I don't understand what your code is doing at all.

But the way I would do it is to make a group containing the series you want to graph, then freeze the scat view of the group so that you can include a linefit.

Re: linefit & equation in the spool object

Posted: Tue Apr 19, 2016 8:51 am
by ecofin
no, when i make all in the group i get all varialbles in one graph and all linefit in one graph

Code: Select all

group g1 y x z f h q g1.scat linefit

Re: linefit & equation in the spool object

Posted: Tue Apr 19, 2016 8:57 am
by EViews Gareth
Don't put all the variables in the group.

Code: Select all

group temp {%iname} {%jname} freeze(g_{%iname}_{%jname}) temp.scat linefit d temp

Re: linefit & equation in the spool object

Posted: Tue Apr 19, 2016 9:56 am
by ecofin
i get error message G_Y_X already exists in "GRAPH G_Y_X.SCAT Y X". the workfile attached

Code: Select all

group g1 y x z f h q for !i=1 to 1 %iname=g1.@seriesname(!i) for !j=!i+1 to g1.@count %jname=g1.@seriesname(!j) 'generate 5 equation equation eq_{%iname}_{%jname}.ls {%iname} {%jname} ' create 5 graph with line and save it in the wf graph g_{%iname}_{%jname}.scat {%iname} {%jname} group temp {%iname} {%jname} freeze(g_{%iname}_{%jname}) temp.scat linefit d temp spool sp sp.insert(offset=first) eq_{%iname}_{%jname} sp.insert g_{%iname}_{%jname} delete g_{%iname}_{%jname} next next sp.move(offset=first) untitled01 sp.move(loc=untitled02) untitled09 sp.move(loc=untitled05) untitled03 sp.move(loc=untitled09) untitled07

Re: linefit & equation in the spool object

Posted: Tue Apr 19, 2016 10:19 am
by EViews Gareth
Delete this line:

Code: Select all

graph g_{%iname}_{%jname}.scat {%iname} {%jname}

Re: linefit & equation in the spool object

Posted: Tue Apr 19, 2016 10:31 am
by ecofin
thanks! for your help :D