Syntax to set common axis scales in a graph
Posted: Thu May 26, 2011 8:10 pm
I am using the command "scatplot" to make many scatterplots between different y and x. I have also included a regression line (by "linefit") in the scatter plots so that I can compare the slopes of the relationships. The problem is that the slopes of the regression lines cannot be compared between different scatter graphs since the axes are different for every scatter plot.
How do I change the startpoints of the scatter-plot axes to e.g. (xmin,ymin)=(0,0) and the maximal endpoints of the scatter graph set to (xmax,ymax)=(5,6).
for %j 1 2 3 5 10
group scat{%j} x{%j}(-{!lags}) y{%j}
freeze(scat{%j}) scat{%j}.scatpair linefit
next
I know how to change the axis scales (min, max) by clicking on the scatter graph with the mouse, but I am asking for a syntax to change the code above.
A secondary alternative solution (the first one does not work) to solve the problem would be to run a regression ls y{%j} c x{%j} and save the slope coefficient c(2) and automatically have that one inserted automatically into the scatter plot. Would that be possible? E.g. R2 may also be interesting to copy into the graph. I can of course do this separately and save it in a vector, but then it is hard to compare the relationships (and also look at the plot in a separate view), I want everything on the same picture.
However, the easiest way is probably just to change the axes' scales.
Best wishes,
Pelle
How do I change the startpoints of the scatter-plot axes to e.g. (xmin,ymin)=(0,0) and the maximal endpoints of the scatter graph set to (xmax,ymax)=(5,6).
for %j 1 2 3 5 10
group scat{%j} x{%j}(-{!lags}) y{%j}
freeze(scat{%j}) scat{%j}.scatpair linefit
next
I know how to change the axis scales (min, max) by clicking on the scatter graph with the mouse, but I am asking for a syntax to change the code above.
A secondary alternative solution (the first one does not work) to solve the problem would be to run a regression ls y{%j} c x{%j} and save the slope coefficient c(2) and automatically have that one inserted automatically into the scatter plot. Would that be possible? E.g. R2 may also be interesting to copy into the graph. I can of course do this separately and save it in a vector, but then it is hard to compare the relationships (and also look at the plot in a separate view), I want everything on the same picture.
However, the easiest way is probably just to change the axes' scales.
Best wishes,
Pelle