- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
I am trying to create a stem-and-leaf plot of some data that I have but when I run the code, I get doubles for each stem value because the leaf value splits at 5. How can I stop this from occurring? Also, how can I sort the data in ascending order because currently the chart is printing in ascending order?
Here is the code I have so far:
INPUT scf;
CARDS;
31
35
42
43
43
43
44
44
45
47
48
49
50
50
53
53
54
59
61
62
70
73
76
;
ods listing;
ods graphics off;
proc univariate data=auto plots;
VAR scf;
run;
quit;
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
The number of lines displayed in a line-printer plot, i.e. listing destination is controlled by the PLOTSIZE= option which the number of printed lines displayed including headers (text like Stem Leaf and information at the bottom.
proc univariate data=auto plots plotsize=10; VAR scf; run; quit;
Seems to get close with the given data for the Stem and Leaf though the order is still smallest to largest upwards.
If your data changes you may need to change the plot size. I think the default number of rows is based on the number of records and range of values.
Note that if you have more than 49 values you likely wont get a stem and leaf plot but a bar chart, of sorts.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
It would help if you could attach an image of what you're getting and some indication of what you don't like about that.
@Fara_I wrote:
Hi,
I am trying to create a stem-and-leaf plot of some data that I have but when I run the code, I get doubles for each stem value because the leaf value splits at 5. How can I stop this from occurring? Also, how can I sort the data in ascending order because currently the chart is printing in ascending order?
Here is the code I have so far:
DATA auto;
INPUT scf;
CARDS;
31
35
42
43
43
43
44
44
45
47
48
49
50
50
53
53
54
59
61
62
70
73
76
;*PROC UNIVARIATE DATA=auto PLOTS;
ods listing;
ods graphics off;
proc univariate data=auto plots;
VAR scf;
run;
quit;I commented PROC UNIVARIATE DATA = auto PLOTS; out because I wasn't sure what the code does and it doesn't seem to change the output when I run it. I also need help printing the plot in ascending order because it is currently printing in descending order. I will appreciate any insight or input anyone can provide me. Thanks!
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Can you post an example of your desired plot?
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
The number of lines displayed in a line-printer plot, i.e. listing destination is controlled by the PLOTSIZE= option which the number of printed lines displayed including headers (text like Stem Leaf and information at the bottom.
proc univariate data=auto plots plotsize=10; VAR scf; run; quit;
Seems to get close with the given data for the Stem and Leaf though the order is still smallest to largest upwards.
If your data changes you may need to change the plot size. I think the default number of rows is based on the number of records and range of values.
Note that if you have more than 49 values you likely wont get a stem and leaf plot but a bar chart, of sorts.