Case Study
Case Study
Case Study
Business analytics
Problems 3.1, 3.2, 3.3 & 3.4
Solution 3.1b:
From the time plot, it is evident that shipment increases in the 1st and 4th quarter of the year, and in the
2d and 3rd quarter shipment reduces. Probable reasons for increase in sale in the 4th quarter could be the
pressure to meet year-end targets and reason for increased sale in the 1st quarter could be a new-year
enthusiasm and push from the managers. Reasons for sluggishness in 2nd and 3rd quarter are could be over
achievement of 1st quarter target and due to which relaxed manager’s position.
Solution 3.1c:
Business analytics
Problems 3.1, 3.2, 3.3 & 3.4
Solution 3.1d:
Business analytics
Problems 3.1, 3.2, 3.3 & 3.4
5. plot(shipment.ts, xlab = "Year", ylab = "Shipment (in million $)", ylim = c(3500, 5000))
6. library(ggplot2)
7. par(oma = c(0,0,0,2))
8. xrange <- c(1,5)
9. yrange <- range(shipment.ts)
10. plot(xrange, yrange, main = "Shipments by Quarter", type = "n", xlab = "Year", ylab =
"Shipments", bty = "l")
11. colors <- rainbow(4)
12. linetype <- c(1:4)
13. plotchar <- c(1:4)
14. for (i in 1:4) {
current_quarter <- subset(shipment.ts, cycle(shipment.ts)==i)
lines(current_quarter, type="b", lwd=1.5, lty=linetype[i], col=colors[i], pch=plotchar[i])
}
15. legend(5.25 ,4800, 1:4, cex=0.8, col=colors, pch=plotchar, lty=linetype, title="Quarter",
xpd=NA)
16. yearly <- aggregate(shipment.ts, nfrequency=1, FUN=sum)
17. plot(yearly, bty="l")
Business analytics
Problems 3.1, 3.2, 3.3 & 3.4
a. Using R, create a scatter plot of Lot Size vs. Income, color-coded by the outcome variable
owner/nonowner. Make sure to obtain a well-formatted plot (create legible labels and a legend, etc.).
Solution 3.2:
1. Import RidingMowers.csv file
2. View(RidingMowers)
3. summary(RidingMowers)
4. par(xpd=TRUE)
5. plot(RidingMowers$Income,RidingMowers$Lot_Size, xlab = "Income in $1000s", ylab = "Lot
Size in 1000ft2",col = ifelse(RidingMowers$Ownership=="Owner","black","red"), pch=19,
bty="l")
6. legend ("topleft", inset = c(0,-0.3), legend = c("Ownership=Owner", "Ownership=
Nonowner"),col=c("black","red"), pch=1)
Business analytics
Problems 3.1, 3.2, 3.3 & 3.4
Question 3.3). Laptop Sales at a London Computer Chain: Bar Charts and Boxplots.
The file LaptopSalesJanuary2008.csv contains data for all sales of laptops at a computer chain in London
in January 2008. This is a subset of the full dataset that includes data for the entire year.
a. Create a bar chart, showing the average retail price by store. Which store has the highest average?
Which has the lowest?
b. To better compare retail prices across stores, create side-by-side boxplots of retail price by store. Now
compare the prices in the two stores from (a). Does there seem to be a difference between their price
distributions?
Solution 3.3a
Business analytics
Problems 3.1, 3.2, 3.3 & 3.4
Solution 3.3b
Business analytics
Problems 3.1, 3.2, 3.3 & 3.4
ii. Does price change with time? (Hint: Make sure that the date column is recognized as such. The
software should then enable different temporal aggregation choices, e.g., plotting the data by
weekly or monthly aggregates, or even by day of week.)
iii. Are prices consistent across retail outlets?
iv. How does price change with configuration?
b. Location Questions:
i. Where are the stores and customers located?
ii. Which stores are selling the most?
iii. How far would customers travel to buy a laptop?
◦ Hint 1: You should be able to aggregate the data, for example, plot the sum or average of the prices.
◦ Hint 2: Use the coordinated highlighting between multiple visualizations in the same page, for example,
select a store in one view to see the matching customers in another visualization.
◦ Hint 3: Explore the use of filters to see differences. Make sure to filter in the zoomed out view. For
example, try to use a “store location” slider as an alternative way to dynamically compare store locations.
This might be more useful to spot outlier patterns if there were 50 store locations to compare.
iv. Try an alternative way of looking at how far customers traveled. Do this by
creating a new data column that computes the distance between customer and
store.
c. Revenue Questions:
i. How do the sales volume in each store relate to Acell’s revenues?
ii. How does this relationship depend on the configuration?
d. Configuration Questions:
i. What are the details of each configuration? How does this relate to price?
ii. Do all stores sell all configurations?
Business analytics