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

For questions regarding the import, export and manipulation of data in EViews, including graphing and basic statistics.

Moderators: EViews Gareth, EViews Steve, EViews Moderator, EViews Jason

nadja123
Posts: 72
Joined: Thu Aug 06, 2009 10:43 am

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

Postby nadja123 » Wed May 26, 2010 6:59 am

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!

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

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

Postby EViews Gareth » Wed May 26, 2010 8:03 am

Code: Select all

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

nadja123
Posts: 72
Joined: Thu Aug 06, 2009 10:43 am

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

Postby nadja123 » Wed May 26, 2010 11:25 am

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.

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

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

Postby EViews Gareth » Wed May 26, 2010 11:42 am

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.

nadja123
Posts: 72
Joined: Thu Aug 06, 2009 10:43 am

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

Postby nadja123 » Wed May 26, 2010 12:23 pm

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.

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

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

Postby EViews Gareth » Wed May 26, 2010 12:53 pm

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.

nadja123
Posts: 72
Joined: Thu Aug 06, 2009 10:43 am

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

Postby nadja123 » Fri May 28, 2010 1:08 pm

In the meantime, the issue has been solved, but not in EV...


Return to “Data Manipulation”

Who is online

Users browsing this forum: No registered users and 2 guests