First, import the data into R. We will import Table 14 from Section 2.3. Use the head command to view the first five lines of data.
Table14 <- read.csv("https://sullystats.github.io/Statistics6e/Data/Chapter2/Table14.csv")
head(Table14,n=5)
## Poverty
## 1 16.9
## 2 11.1
## 3 14.9
## 4 16.4
## 5 13.3
Use the syntax
stem(data_file/$Variable*,scale = )
stem(Table14$Poverty,scale=2)
##
## The decimal point is at the |
##
## 7 | 7
## 8 |
## 9 | 35567
## 10 | 0335678
## 11 | 01133369
## 12 | 5568
## 13 | 0023456
## 14 | 00127799
## 15 | 048
## 16 | 469
## 17 | 2
## 18 |
## 19 | 1778
Now, let’s draw a stem-and-leaf plot using “scale = 3”.
stem(Table14$Poverty,scale=3)
##
## The decimal point is at the |
##
## 7 | 7
## 8 |
## 8 |
## 9 | 3
## 9 | 5567
## 10 | 033
## 10 | 5678
## 11 | 011333
## 11 | 69
## 12 |
## 12 | 5568
## 13 | 00234
## 13 | 56
## 14 | 0012
## 14 | 7799
## 15 | 04
## 15 | 8
## 16 | 4
## 16 | 69
## 17 | 2
## 17 |
## 18 |
## 18 |
## 19 | 1
## 19 | 778