Page 1 of 1

Diplaying fit eq. in a scatter graph (EV 6)

Posted: Wed May 26, 2010 6:59 am
by nadja123
Hi there,

I just wonder if it's possible to get displayed the estimated equation and R2 to 'Regression Line' in a Scatter type of graph. If yes, I'd need to include it in a code. Thanks for hints!

Re: Diplaying fit eq. in a scatter graph (EV 6)

Posted: Wed May 26, 2010 8:03 am
by EViews Gareth

Code: Select all

g.scat linefit(leg=det)
will get you the equation. You can't automatically get the R2 in there though.

Re: Diplaying fit eq. in a scatter graph (EV 6)

Posted: Wed May 26, 2010 11:25 am
by nadja123
Hi Gareth,

many thanks for the tip. After having tried it, I see two somewhat disadvantages: first, it produced the eq representation as a part of the legend, standing left to chart; second, the actual variable names may be too long; and third, I'd need to get R2 in there anyway.

I think I best do by creating a piece of text myself which I could: [1] include in the chart area, [2] even export if wanted.
Having gotten the coeff estimates into a vector:

Code: Select all

coef(3) cfs equation eq1.ls y = cfs(1) + cfs(2) * x cfs(3) = @r2
I thought of sth like this:
Y = .dddd +- .dddd X, (R^2 .dd)
, however, I hit on difficulties with:
1. making the code to write the text in the text object
2. including the estimated cfs-s into the text
3. controlling the number of digits in the displayed cfs-s
4. formatting part of the text as italics.
Maybe I should not think of creating a text object, but rather something like a table object? I don't know, no experience with this at all. I would be enormously thankful for helping.

Re: Diplaying fit eq. in a scatter graph (EV 6)

Posted: Wed May 26, 2010 11:42 am
by EViews Gareth
Ha, once again this would be much easier in EV7. But in 6 you are probably best off putting it into a table object rather than a text object.

Re: Diplaying fit eq. in a scatter graph (EV 6)

Posted: Wed May 26, 2010 12:23 pm
by nadja123
Thank you, Gareth,

I 'd maybe try it with a table object. However, can I be sure that with a table object I really can get what I want? If not, it would be more efficient for me, just to write it down manually as I only need to do this for 4 equations. I am under enormous time pressure now, so I am looking for something that is the fastet even though not the best way to solve the problem in the long-run.

May I please ask you to assert the feasibility of the points I listed? (Replace text for table where necessary.)
a piece of text myself which I could: [1] include in the chart area, [2] even export if wanted.
2. including the estimated cfs-s into the text
3. controlling the number of digits in the displayed cfs-s
4. formatting part of the text as italics.
Many thanks for helping.

Re: Diplaying fit eq. in a scatter graph (EV 6)

Posted: Wed May 26, 2010 12:53 pm
by EViews Gareth
You can't put a table into a graph (nor can you put a text object into a graph). The closest you can get is a spool.

You can export a table as an RTF file, or various other formats.

You can manually build up text strings containing the coefficients, then put those text strings into the table.

You can control the number of digits, and you can format as italic.

Re: Diplaying fit eq. in a scatter graph (EV 6)

Posted: Fri May 28, 2010 1:08 pm
by nadja123
In the meantime, the issue has been solved, but not in EV...