In: Statistics and Probability
6.9 Grocery retailer. A large, national grocery retailer tracks productivity and costs of its facilities closely. Data below were obtained from a single distribution center for a one-year period. Each data point for each variable represents one week of activity. The variables included are the number of cases shipped (X1), the indirect costs of the total labour hours as a percentage (X2), a qualitative redictor called holiday that is coded 1 if the week has a holiday and 0 otherwise (X3), and the total labor hours (Y).
a. Prepare separate stem-and-leaf plots for the number of cases
shipped Xi1
and the indirect cost of the total hours Xi2. Are there any
outlying cases
present? Are there any gaps in the data?
SOLUTION
I have use R studio for solving this problem.it is free software you can download it if you don't have it.
follow the steps -> Save data in Excel with csv format with name "Grocery".
In place of Path give location your file(Grocery)
---------------Run This code coping in R studio------------------------------
setwd("Path")
Grocery<-read.csv("Grocery.csv",header = T)
attach(Grocery)
head(Grocery)#if You get something like Y.... then just goto
Grocery.csv in your location and check there will be #space after Y
just delete that space and read file again in R.
# a.stem and leaf diagram
stem(X1,scale = 3) #There are outliers
--------------output-------------------
The decimal point is 4 digit(s) to the right of the |
21 | 2
22 | 8
23 |
24 | 668
25 | 027
26 | 15688999
27 | 022477
28 | 38
29 | 0023467
30 | 123367
31 | 7
32 | 22388
33 |
34 |
35 | 2
36 | 7
37 | 0
38 | 3
39 |
40 |
41 | 24
42 | 7
43 |
44 | 3
45 |
46 |
47 | 2
---------------------------------------------------------------
stem(X2)# No outliers
---------------------output-------------------------
The decimal point is at the |
4 | 6
5 | 8
6 | 123345577888999
7 | 0122222334466777888999
8 | 00011224566
9 | 07