[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Candidate stem-and-leaf plot function
From: |
Daniel J Sebald |
Subject: |
Re: Candidate stem-and-leaf plot function |
Date: |
Sat, 26 Jan 2013 00:12:38 -0600 |
User-agent: |
Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.24) Gecko/20111108 Fedora/3.1.16-1.fc14 Thunderbird/3.1.16 |
On 01/25/2013 10:50 PM, Michael D. Godfrey wrote:
Attached is an m-file which implements the statistical
display method called "stem and leaf." This method was
developed by John Tukey in the mid 1960's. I wrote the
first machine version (in Fortran, of course). The reference
for this is John Tukey's book: Exploratory Data Analysis,
1971.
There is a stem and leaf plot function in the Matlab Central
contributed library. I made no attempt at compatibility with this
implementation. It is not much like what was intended by Tukey.
R also has a routine called stem(). I have not tried this, but
it is likely well-done. Compatibility with R is not a current Octave
objective.
I would like comments as to whether this should be included in
the statistics library, probably in /base for lack of a better place.
Comments about the code, documentation and tests, are very
welcome. And, if anyone wants to include it they are welcome to do so.
Michael Godfrey
Interesting. I'd say that this could be a general plot because it seems
to me that some applications I've (just now) read about use the plot
simply to display data, e.g., schedules. However, I wonder if before
incorporating into Octave it could be made to create a plot in a figure
window. The ASCII-based plot gets the idea across, but if someone wants
to quickly create a plot that could be incorporated into a document, the
figure and EPS, PNG, etc. is the way to go. I'm fairly certain that
gnuplot has techniques for plotting characters at different locations on
a graph. Could color be incorporated in somewhat to enhance meaning?
I had to change "signbit" to "sign" and use 1/-1 in place of 0/1,
respectively. Is "signbit" your own routine? Or am I missing
something? That change would be necessary if placed in the base scripts.
One question about the graphing for this example:
x = [-22 12 -28 52 39 -2 12 10 11 11 42 38 44 18 44];
stem_and_leaf_plot(x, 0);
stem step: 10, data: unsorted.
Hinges: lo: 10, hi: 42
-2 | 28
-1 |
0 |
1 | 220118
2 |
3 | 98
4 | 244
5 | 2
Should the negative stems have the leaves going the other direction? I.e.,
-2 | 82
-28 < -22 after all. I would think for consistency that the quantities
should always increase when moving outward. That is, say I added 30 to
all the values, then the associated leaves would not change positions
between the two plots.
Dan
- Candidate stem-and-leaf plot function, Michael D. Godfrey, 2013/01/25
- Re: Candidate stem-and-leaf plot function,
Daniel J Sebald <=
- Re: Candidate stem-and-leaf plot function, Michael D. Godfrey, 2013/01/26
- Re: Candidate stem-and-leaf plot function, Daniel J Sebald, 2013/01/26
- Re: Candidate stem-and-leaf plot function, Michael D. Godfrey, 2013/01/26
- Re: Candidate stem-and-leaf plot function, Daniel J Sebald, 2013/01/26
- Re: Candidate stem-and-leaf plot function, Michael D. Godfrey, 2013/01/26
- Re: Candidate stem-and-leaf plot function, Michael D. Godfrey, 2013/01/29
- Re: Candidate stem-and-leaf plot function, Daniel J Sebald, 2013/01/29
Re: Candidate stem-and-leaf plot function, Carnë Draug, 2013/01/26