Presentation 2

Sunny Sapkota, Thuy Anh Do, Konstantin Prokhorov

November 06, 2017

1.Rename variables

##    Country          OrderMethod        RetailerType      
##  Length:88475       Length:88475       Length:88475      
##  Class :character   Class :character   Class :character  
##  Mode  :character   Mode  :character   Mode  :character  
##                                                          
##                                                          
##                                                          
##                                                          
##  ProductLine        ProductType          Product               Year     
##  Length:88475       Length:88475       Length:88475       Min.   :2012  
##  Class :character   Class :character   Class :character   1st Qu.:2012  
##  Mode  :character   Mode  :character   Mode  :character   Median :2013  
##                                                           Mean   :2013  
##                                                           3rd Qu.:2013  
##                                                           Max.   :2014  
##                                                                         
##    Quarter             Revenue           Quantity        GrossMargin      
##  Length:88475       Min.   :      0   Min.   :    1.0   Min.   :-12.8537  
##  Class :character   1st Qu.:   8184   1st Qu.:  131.0   1st Qu.:  0.3699  
##  Mode  :character   Median :  21026   Median :  333.0   Median :  0.4506  
##                     Mean   :  42638   Mean   :  780.6   Mean   :  0.4497  
##                     3rd Qu.:  50391   3rd Qu.:  816.0   3rd Qu.:  0.5201  
##                     Max.   :1635688   Max.   :67875.0   Max.   :  0.7705  
##                                                         NA's   :581

2.Create a table for Sales and Proportion of Sales by country and by year

Country Year Revenue proportion_of_revenue_year
Australia 2012 25607044 0.0220904
Austria 2012 34568090 0.0298208
Belgium 2012 30396297 0.0262219
Brazil 2012 34234876 0.0295333
Canada 2012 75428386 0.0650696
China 2012 79080488 0.0682201
Denmark 2012 15893267 0.0137106
Finland 2012 47826647 0.0412585
France 2012 72237825 0.0623172
Germany 2012 65238045 0.0562787
Italy 2012 46135925 0.0397999
Japan 2012 86340230 0.0744829
Korea 2012 50844973 0.0438623
Mexico 2012 42363572 0.0365457
Netherlands 2012 44421660 0.0383211
Singapore 2012 48204223 0.0415842
Spain 2012 39237620 0.0338490
Sweden 2012 23966997 0.0206755
Switzerland 2012 26286562 0.0226766
United Kingdom 2012 69420604 0.0598869
United States 2012 201462260 0.1737949
Australia 2013 47799737 0.0319540
Austria 2013 44996737 0.0300802
Belgium 2013 38375433 0.0256539
Brazil 2013 43389954 0.0290061
Canada 2013 98134069 0.0656024
China 2013 99109352 0.0662544
Denmark 2013 20050466 0.0134037
Finland 2013 59648620 0.0398750
France 2013 83075921 0.0555361
Germany 2013 78113787 0.0522189
Italy 2013 61869049 0.0413593
Japan 2013 112137015 0.0749634
Korea 2013 60714213 0.0405873
Mexico 2013 58604265 0.0391768
Netherlands 2013 58301768 0.0389746
Singapore 2013 60942903 0.0407402
Spain 2013 55846233 0.0373331
Sweden 2013 30360527 0.0202959
Switzerland 2013 41463606 0.0277183
United Kingdom 2013 84920826 0.0567694
United States 2013 258036621 0.1724969
Australia 2014 35893189 0.0321239
Austria 2014 33801789 0.0302521
Belgium 2014 28186840 0.0252268
Brazil 2014 31440841 0.0281391
Canada 2014 73325209 0.0656250
China 2014 70633377 0.0632159
Denmark 2014 11954800 0.0106994
Finland 2014 44746716 0.0400477
France 2014 64209896 0.0574669
Germany 2014 57421832 0.0513917
Italy 2014 46625799 0.0417294
Japan 2014 83188254 0.0744523
Korea 2014 47014946 0.0420777
Mexico 2014 38401768 0.0343690
Netherlands 2014 46212968 0.0413599
Singapore 2014 47114688 0.0421670
Spain 2014 41679916 0.0373029
Sweden 2014 26308001 0.0235453
Switzerland 2014 32981707 0.0295182
United Kingdom 2014 64881658 0.0580682
United States 2014 191312080 0.1712216

3. Creating two tables, using the results from question 2:

3.1 Table of country, revenue_2012, rev-enue_y2013, and revenue_y2014.

Country revenue_2012 revenue_2013 revenue_2014
Australia 25607044 47799737 35893189
Austria 34568090 44996737 33801789
Belgium 30396297 38375433 28186840
Brazil 34234876 43389954 31440841
Canada 75428386 98134069 73325209
China 79080488 99109352 70633377
Denmark 15893267 20050466 11954800
Finland 47826647 59648620 44746716
France 72237825 83075921 64209896
Germany 65238045 78113787 57421832
Italy 46135925 61869049 46625799
Japan 86340230 112137015 83188254
Korea 50844973 60714213 47014946
Mexico 42363572 58604265 38401768
Netherlands 44421660 58301768 46212968
Singapore 48204223 60942903 47114688
Spain 39237620 55846233 41679916
Sweden 23966997 30360527 26308001
Switzerland 26286562 41463606 32981707
United Kingdom 69420604 84920826 64881658
United States 201462260 258036621 191312080

3.2 Table of country, prop_2012, prop_y2013,and prop_y2014.

Country prop_2012 prop_2013 prop_2014
Australia 0.0220904 0.0319540 0.0321239
Austria 0.0298208 0.0300802 0.0302521
Belgium 0.0262219 0.0256539 0.0252268
Brazil 0.0295333 0.0290061 0.0281391
Canada 0.0650696 0.0656024 0.0656250
China 0.0682201 0.0662544 0.0632159
Denmark 0.0137106 0.0134037 0.0106994
Finland 0.0412585 0.0398750 0.0400477
France 0.0623172 0.0555361 0.0574669
Germany 0.0562787 0.0522189 0.0513917
Italy 0.0397999 0.0413593 0.0417294
Japan 0.0744829 0.0749634 0.0744523
Korea 0.0438623 0.0405873 0.0420777
Mexico 0.0365457 0.0391768 0.0343690
Netherlands 0.0383211 0.0389746 0.0413599
Singapore 0.0415842 0.0407402 0.0421670
Spain 0.0338490 0.0373331 0.0373029
Sweden 0.0206755 0.0202959 0.0235453
Switzerland 0.0226766 0.0277183 0.0295182
United Kingdom 0.0598869 0.0567694 0.0580682
United States 0.1737949 0.1724969 0.1712216

4. Merge the results from both tables created in question 3.

Country revenue_2012 prop_2012 revenue_2013 prop_2013 revenue_2014 prop_2014
Australia 25607044 0.0220904 47799737 0.0319540 35893189 0.0321239
Austria 34568090 0.0298208 44996737 0.0300802 33801789 0.0302521
Belgium 30396297 0.0262219 38375433 0.0256539 28186840 0.0252268
Brazil 34234876 0.0295333 43389954 0.0290061 31440841 0.0281391
Canada 75428386 0.0650696 98134069 0.0656024 73325209 0.0656250
China 79080488 0.0682201 99109352 0.0662544 70633377 0.0632159
Denmark 15893267 0.0137106 20050466 0.0134037 11954800 0.0106994
Finland 47826647 0.0412585 59648620 0.0398750 44746716 0.0400477
France 72237825 0.0623172 83075921 0.0555361 64209896 0.0574669
Germany 65238045 0.0562787 78113787 0.0522189 57421832 0.0513917
Italy 46135925 0.0397999 61869049 0.0413593 46625799 0.0417294
Japan 86340230 0.0744829 112137015 0.0749634 83188254 0.0744523
Korea 50844973 0.0438623 60714213 0.0405873 47014946 0.0420777
Mexico 42363572 0.0365457 58604265 0.0391768 38401768 0.0343690
Netherlands 44421660 0.0383211 58301768 0.0389746 46212968 0.0413599
Singapore 48204223 0.0415842 60942903 0.0407402 47114688 0.0421670
Spain 39237620 0.0338490 55846233 0.0373331 41679916 0.0373029
Sweden 23966997 0.0206755 30360527 0.0202959 26308001 0.0235453
Switzerland 26286562 0.0226766 41463606 0.0277183 32981707 0.0295182
United Kingdom 69420604 0.0598869 84920826 0.0567694 64881658 0.0580682
United States 201462260 0.1737949 258036621 0.1724969 191312080 0.1712216

5. Which country has highest growth rate in terms of revenue in 2013, 2014

Country revenue_2013 revenue_2014 Growth_Rate
Sweden 30360527 26308001 -0.1334801
Switzerland 41463606 32981707 -0.2045625
Netherlands 58301768 46212968 -0.2073488
Korea 60714213 47014946 -0.2256353
Singapore 60942903 47114688 -0.2269044
France 83075921 64209896 -0.2270938
United Kingdom 84920826 64881658 -0.2359747
Italy 61869049 46625799 -0.2463793
Austria 44996737 33801789 -0.2487947
Australia 47799737 35893189 -0.2490923
Finland 59648620 44746716 -0.2498281
Canada 98134069 73325209 -0.2528058
Spain 55846233 41679916 -0.2536665
Japan 112137015 83188254 -0.2581553
United States 258036621 191312080 -0.2585855
Germany 78113787 57421832 -0.2648950
Belgium 38375433 28186840 -0.2654978
Brazil 43389954 31440841 -0.2753889
China 99109352 70633377 -0.2873187
Mexico 58604265 38401768 -0.3447274
Denmark 20050466 11954800 -0.4037645

6. Country has highest growth rate in terms of proportion of total revenue 2013 - 2014

Country prop_2013 prop_2014 Growth_Rate
Sweden 0.0202959 0.0235453 0.1600979
Switzerland 0.0277183 0.0295182 0.0649326
Netherlands 0.0389746 0.0413599 0.0612024
Korea 0.0405873 0.0420777 0.0367204
Singapore 0.0407402 0.0421670 0.0350212
France 0.0555361 0.0574669 0.0347677
United Kingdom 0.0567694 0.0580682 0.0228779
Italy 0.0413593 0.0417294 0.0089483
Austria 0.0300802 0.0302521 0.0057146
Australia 0.0319540 0.0321239 0.0053160
Finland 0.0398750 0.0400477 0.0043310
Canada 0.0656024 0.0656250 0.0003445
Spain 0.0373331 0.0373029 -0.0008078
Japan 0.0749634 0.0744523 -0.0068174
United States 0.1724969 0.1712216 -0.0073935
Germany 0.0522189 0.0513917 -0.0158406
Belgium 0.0256539 0.0252268 -0.0166476
Brazil 0.0290061 0.0281391 -0.0298898
China 0.0662544 0.0632159 -0.0458615
Mexico 0.0391768 0.0343690 -0.1227203
Denmark 0.0134037 0.0106994 -0.2017592

7. Bar plot

8. Scatterplot

9. Most profitable country

9.1 Most profitable country in terms of profit

Country GrossProfit
United States 79,853,980
Japan 34,877,011
Canada 30,479,726
China 29,398,530
United Kingdom 27,038,316
France 26,816,103
Germany 23,918,484
Singapore 19,651,191
Italy 19,497,491
Korea 19,484,528
Netherlands 19,133,312
Finland 18,531,797
Spain 17,407,446
Mexico 15,879,189
Australia 14,900,245
Austria 14,202,010
Switzerland 13,848,073
Brazil 13,128,548
Belgium 11,719,669
Sweden 11,016,468
Denmark 4,978,965

9.2 Most Profitable contry in terms of margin

Country Margin
Austria 0.4201556
Switzerland 0.4198713
Japan 0.4192540
Sweden 0.4187497
Italy 0.4181696
Spain 0.4176459
France 0.4176319
Brazil 0.4175635
United States 0.4174017
Singapore 0.4170927
United Kingdom 0.4167328
Germany 0.4165399
Denmark 0.4164826
China 0.4162130
Belgium 0.4157851
Canada 0.4156787
Australia 0.4151274
Korea 0.4144326
Finland 0.4141488
Netherlands 0.4140247
Mexico 0.4135015

10. Scatter plot of Revenue and Profit 2012-2014

11. Which Country places the most orders online in 2014?

Country places the most orders online in terms of Revenue

Country Revenue
United States 170,254,299
China 70,633,377
Japan 69,863,267
Canada 63,022,526
United Kingdom 58,921,923

Country places the most orders online in terms of Quantity

Country Quantity
United States 2,956,446
Japan 1,277,290
China 1,252,743
Canada 1,029,248
United Kingdom 1,022,802

12. Which country has the biggest growth in online orders?

Online Orders growth 2013-2014 by Quantity

Country 2013 2014 growth
Sweden 365,828 352,089 -0.0375559
Switzerland 596,532 547,027 -0.082988
Australia 637,190 572,506 -0.1015145
Netherlands 877,656 784,557 -0.1060769
Canada 1,213,030 1,029,248 -0.1515066

Online Order growth 2013 - 2014 by Revenue

Country 2013 2014 growth
Sweden 22,681,966 20,740,107 -0.08561249
Switzerland 34,620,404 31,103,454 -0.1015861
Netherlands 50,307,165 44,978,569 -0.1059212
Canada 74,346,429 63,022,526 -0.1523127
Australia 39,487,051 32,779,707 -0.1698619

13. What is the most profitable products?

Number_of_Products
140

The most profitable products in terms of total profit in 2014

Product Profit
Hailstorm Titanium Woods Set 15,323,104
Inferno 13,855,745
Maximus 12,899,357
Hailstorm Titanium Irons 11,804,825
Infinity 11,425,870
Star Lite 10,646,810
Retro 10,378,182
Lady Hailstorm Titanium Woods Set 9,841,454
Canyon Mule Journey Backpack 9,476,402
Zone 9,434,315

The most profitable products in terms of profit per unit in 2014

Product Profit_per_unit
Lady Hailstorm Titanium Woods Set 681.73
Hailstorm Titanium Woods Set 579.0169
Lady Hailstorm Steel Woods Set 444.28
Lady Hailstorm Titanium Irons 424.57
Hailstorm Titanium Irons 401.798
Hailstorm Steel Woods Set 327.0063
Star Gazer 6 304.9981
Star Gazer 3 252.94
Star Dome 229.6853
Lady Hailstorm Steel Irons 228.35

14. Which are the most profitable product lines?

Number_of_ProductLine
5

The most profitable product lines in terms of total profit in 2014

ProductLine Profit
Personal Accessories 186,535,159
Camping Equipment 132,751,905
Golf Equipment 86,986,350
Mountaineering Equipment 56,718,814
Outdoor Protection 2,768,853

The most profitable product lines in terms of profit per unit in 2014

ProductLine Profit_per_unit
Golf Equipment 73.6221
Personal Accessories 23.1376
Camping Equipment 21.78604
Mountaineering Equipment 15.95414
Outdoor Protection 4.089173

15. Which is the best retailer type?

RetailerType Profit Quantity Revenue
Outdoors Shop 163,446,088 8,185,384 407,201,378
Sports Store 119,487,912 4,608,281 288,347,272
Department Store 69,262,520 2,948,118 166,634,239
Golf Shop 61,767,124 1,228,843 128,119,127
Eyewear Store 26,174,903 919,735 59,022,366
Warehouse Store 14,645,779 880,119 41,619,943
Equipment Rental Store 6,152,163 376,633 15,259,878
Direct Marketing 4,824,593 422,078 11,132,072

In 2014, the best retailer type is Outdoor Shop.