Skip to content

"stem" does not give a correct answer (PR#9359)

2 messages · mgkim at seowon.ac.kr, Berwin A Turlach

#
Full_Name: Myung Geun Kim
Version: 2.4.0
OS: Window XP
Submission from: (NULL) (210.110.8.105)


For the data c1 of size 14, stem provides the following result.

**************************************************************
[1] 14 39 70 11 38 20 37 15 41 74 74 34 48 51
ZZangi>stem(c1)

  The decimal point is 1 digit(s) to the right of the |

  0 | 145
  2 | 04789
  4 | 181
  6 | 044

**************************************************************
However, stem does not give a correct answer, for example 34, 74, etc.
#
G' day Myung,
MGK> For the data c1 of size 14, stem provides the following result.

    MGK> **************************************************************
    >> c1
    MGK> [1] 14 39 70 11 38 20 37 15 41 74 74 34 48 51
    ZZangi> stem(c1)

    MGK> The decimal point is 1 digit(s) to the right of the |

    MGK> 0 | 145
    MGK> 2 | 04789
    MGK> 4 | 181
    MGK> 6 | 044

    MGK> **************************************************************
    MGK> However, stem does not give a correct answer, for example 34, 74, etc.

No bug, it is just the scale to which stem decides to plot by
default.  The line 

        4 | 181

should give a clue that this summarises 41, 48 and 51.  Since the data
is so sparse only even leading numbers are used.  Try:
The decimal point is 1 digit(s) to the right of the |

  0 | 145
  2 | 04789
  4 | 181
  6 | 044
The decimal point is 1 digit(s) to the right of the |

  1 | 145
  2 | 0
  3 | 4789
  4 | 18
  5 | 1
  6 | 
  7 | 044

Cheers,

        Berwin

========================== Full address ============================
Berwin A Turlach                      Tel.: +61 (8) 6488 3338 (secr)   
School of Mathematics and Statistics        +61 (8) 6488 3383 (self)      
The University of Western Australia   FAX : +61 (8) 6488 1028
35 Stirling Highway                   
Crawley WA 6009                e-mail: berwin at maths.uwa.edu.au
Australia                        http://www.maths.uwa.edu.au/~berwin