I would like to add a line showing the relationship between two variables x and y in a scatter plot.
graph gra_b1.scat(n) x y
gra_b1.option linepat
gra_b1.setelem(1) lcolor(blue) lwidth(2) symbol(circle)
gra_b1.setelem(2) lcolor(blue) lwidth(2) symbol(circle)
what is the command to add the line?
Thank you.
Graphs: Adding a line in a scatter plot
Moderators: EViews Gareth, EViews Jason, EViews Moderator, EViews Matt
-
- Posts: 202
- Joined: Tue Jul 17, 2012 9:47 am
Re: Graphs: Adding a line in a scatter plot
Code: Select all
wfcreate u 100
genr x = nrnd
genr y = nrnd
group myscat x y
freeze(myscat_graph) myscat.scat linefit
Re: Graphs: Adding a line in a scatter plot
It is useful, but it seems not flexible enough.
For example you cannot standardize variables with the option (n):
myscat.scat(n)
or you cannot add a text with the option
myscat.addtext(.2, .1, x) Relation between x and y
For example you cannot standardize variables with the option (n):
myscat.scat(n)
or you cannot add a text with the option
myscat.addtext(.2, .1, x) Relation between x and y
Re: Graphs: Adding a line in a scatter plot
I have figure out how to add a text:
myscat.addtext(.2, .1) Relation between x and y
but not how to standardize variables with the option (n)
Once standardized the variables, is it possible to add a vertical line crossing the zero?
Best
myscat.addtext(.2, .1) Relation between x and y
but not how to standardize variables with the option (n)
Once standardized the variables, is it possible to add a vertical line crossing the zero?
Best
Re: Graphs: Adding a line in a scatter plot
I also found the way to add the vertical line crossing the zero.
The questions left are:
1) automatic standardization of the variables (n)
2) rather than a linear fit, what would be the command to add a polynomial (power = 2) in the graph?
All the information for fitting regressions in graphs are note available in "Eviews 8 Command Ref.pdf"
Where are these reported?
Best
The questions left are:
1) automatic standardization of the variables (n)
2) rather than a linear fit, what would be the command to add a polynomial (power = 2) in the graph?
All the information for fitting regressions in graphs are note available in "Eviews 8 Command Ref.pdf"
Where are these reported?
Best
-
- Fe ddaethom, fe welon, fe amcangyfrifon
- Posts: 13322
- Joined: Tue Sep 16, 2008 5:38 pm
Re: Graphs: Adding a line in a scatter plot
Thanks very useful.
The last think I need to do is to add a scalar in the graph.
For example I run a regression between x and y and save the adjusted R^2 named adjr2.
I need to add the scalar adjr2 in the graph.
Note that I cannot add the number using addtext because it is a loop of many charts.
Best
The last think I need to do is to add a scalar in the graph.
For example I run a regression between x and y and save the adjusted R^2 named adjr2.
I need to add the scalar adjr2 in the graph.
Note that I cannot add the number using addtext because it is a loop of many charts.
Best
-
- Fe ddaethom, fe welon, fe amcangyfrifon
- Posts: 13322
- Joined: Tue Sep 16, 2008 5:38 pm
Re: Graphs: Adding a line in a scatter plot
You'll have to use addtext
Follow us on Twitter @IHSEViews
Re: Graphs: Adding a line in a scatter plot
Addtext would add a text not the scalar`.
Unless you are suggesting to add the number directly in the addtext option.
Unless you are suggesting to add the number directly in the addtext option.
-
- Fe ddaethom, fe welon, fe amcangyfrifon
- Posts: 13322
- Joined: Tue Sep 16, 2008 5:38 pm
Re: Graphs: Adding a line in a scatter plot
Convert the scalar to text with the @str function.
Follow us on Twitter @IHSEViews
Who is online
Users browsing this forum: No registered users and 23 guests