[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
st: RE: yscale in anovaplot
"Nick Cox" <email@example.com>
st: RE: yscale in anovaplot
Sun, 26 Apr 2009 16:52:09 +0100
Thanks to Diego for this interesting question and to Thomas for
answering it so fully.
To fill in a gap and to fill out the implicitly needed discussion:
-anovaplot- is a program in the -modeldiag- package written up in the
Stata Journal within
SJ-4-4 gr0009 . . . . . . . . . . Speaking Stata: Graphing model
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . N.
(help anovaplot, indexplot, modeldiag, ofrtplot, ovfplot,
qfrplot, racplot, rdplot, regplot, rhetplot, rvfplot2,
rvlrplot, rvpplot2 if installed)
Q4/04 SJ 4(4):449--475
plotting diagnostic information calculated from residuals
and fitted values from regression models with continuous
There's also an equivalent package on SSC that includes older versions
of these programs.
The paper is accessible to all via
-anovaplot- is described on p.458. I add this comment, which is relevant
to Diego's question:
"It is curious that analysis-of-variance people typically draw
interaction plots but suppress the data, whereas regression people
prefer to draw scatterplots showing both observed and fitted values.
Admittedly, a complicated set of crossing lines showing interactions may
seem to leave little scope for showing data effectively, while a
simple regression leaves plenty of scope, but the difference is
I still treasure a comment made by a senior Stata user, who might not
want to be named for this, to the effect that showing the data on the
graph typically confuses the issue.
Nevertheless I'll think about adding a -nodata- option, possibly with a
sting in the tail. (For example, it might -drop- all your data, or some
Although you have suppressed printing a symbol for the data points via
-scatter(msym(none))-, Stata still allows room for that invisible data
in its y-axis range. Therefore you cannot reduce the range given the way
the code is written. Editing the code to allow what you want is pretty
numlist "2/`= 1 + `: word count `fits'''"
numlist "1/`= 1 + `: word count `fits'''"
twoway scatter `y' `x1' if e(sample), `scatter' ///
twoway `scatter' ///
Then edit line:
program anovaplot, sort
program anovaplot0, sort
Save it with new name anovaplot0.ado and invoke it with command
Nick Cox's original will keep working and you'll have this one for your
Of course, you could get fancy and add a -nodata- option that allows
both forms in a single program.
I am trying to plot an ANOVA for repeated measures model using the
amazing anovaplot command.
Everything works fine except the yscale range. I need to reduce the
range and increase the scale
to make differences clear. So I tried:
anovaplot level groups, scatter(msym(none)) yscale (range(-12 -24))
ylabel(-12 (2) -24)
The problem is that I actually reduced the numbered range and the
labelling but now almost half of the graph
is empty. Is there any way to change the range so that I can take
advantage of all the graph extension ?
* For searches and help try: