getwd()
## [1] "D:/R Working Directory"
setwd("D:/R Working Directory")
Mooch_sales<-read.csv(file="Data_Analyst_Task.csv",stringsAsFactors=TRUE,header=TRUE)
print(Mooch_sales)
## Item Quantity Cost.per.item Profit...per.item
## 1 Burger 1 100 £5.50 0.33
## 2 Burger 2 170 £5.50 0.41
## 3 Burger 3 33 £5.50 0.28
## 4 Burger 4 38 £5.50 0.19
## 5 Burger 5 39 £5.50 0.29
## 6 Burger 6 67 £5.50 0.19
## 7 Burger 7 171 £5.50 0.38
## 8 Burger 8 44 £4.50 0.29
## 9 Burger 9 30 £5.50 0.29
## 10 Burger 10 27 £5.50 0.47
## 11 Chips 100 £2.25 0.85
## 12 Lasagne 16 £5.50 0.69
## Sales.per.market.segment.1 Sales.per.market.segment.2
## 1 0.05 0.06
## 2 0.17 0.20
## 3 0.20 0.01
## 4 0.01 0.04
## 5 0.04 0.08
## 6 0.08 0.11
## 7 0.11 0.10
## 8 0.10 0.24
## 9 0.05 0.16
## 10 0.16 0.16
## 11 0.16 0.16
## 12 0.16 0.17
## Sales.per.market.segment.3 Sales.per.market.segment.4
## 1 0.17 0.11
## 2 0.03 0.01
## 3 0.10 0.22
## 4 0.10 0.14
## 5 0.05 0.20
## 6 0.16 0.05
## 7 0.16 0.18
## 8 0.23 0.08
## 9 0.10 0.11
## 10 0.10 0.10
## 11 0.05 0.05
## 12 0.16 0.16
## Sales.per.market.segment.5 Sales.per.market.segment.6
## 1 0.06 0.22
## 2 0.27 0.01
## 3 0.01 0.22
## 4 0.30 0.14
## 5 0.15 0.03
## 6 0.26 0.10
## 7 0.17 0.10
## 8 0.22 0.05
## 9 0.14 0.16
## 10 0.24 0.01
## 11 0.02 0.20
## 12 0.05 0.14
## Sales.per.market.segment.7 Sales.per.market.segment.8 Total.of.segments
## 1 0.16 0.17 1
## 2 0.18 0.13 1
## 3 0.02 0.22 1
## 4 0.13 0.14 1
## 5 0.22 0.23 1
## 6 0.14 0.10 1
## 7 0.08 0.10 1
## 8 0.03 0.05 1
## 9 0.12 0.16 1
## 10 0.22 0.01 1
## 11 0.14 0.22 1
## 12 0.02 0.14 1
str(Mooch_sales)
## 'data.frame': 12 obs. of 13 variables:
## $ Item : Factor w/ 12 levels "Burger 1","Burger 10",..: 1 3 4 5 6 7 8 9 10 2 ...
## $ Quantity : int 100 170 33 38 39 67 171 44 30 27 ...
## $ Cost.per.item : Factor w/ 3 levels "£2.25","£4.50",..: 3 3 3 3 3 3 3 2 3 3 ...
## $ Profit...per.item : num 0.33 0.41 0.28 0.19 0.29 0.19 0.38 0.29 0.29 0.47 ...
## $ Sales.per.market.segment.1: num 0.05 0.17 0.2 0.01 0.04 0.08 0.11 0.1 0.05 0.16 ...
## $ Sales.per.market.segment.2: num 0.06 0.2 0.01 0.04 0.08 0.11 0.1 0.24 0.16 0.16 ...
## $ Sales.per.market.segment.3: num 0.17 0.03 0.1 0.1 0.05 0.16 0.16 0.23 0.1 0.1 ...
## $ Sales.per.market.segment.4: num 0.11 0.01 0.22 0.14 0.2 0.05 0.18 0.08 0.11 0.1 ...
## $ Sales.per.market.segment.5: num 0.06 0.27 0.01 0.3 0.15 0.26 0.17 0.22 0.14 0.24 ...
## $ Sales.per.market.segment.6: num 0.22 0.01 0.22 0.14 0.03 0.1 0.1 0.05 0.16 0.01 ...
## $ Sales.per.market.segment.7: num 0.16 0.18 0.02 0.13 0.22 0.14 0.08 0.03 0.12 0.22 ...
## $ Sales.per.market.segment.8: num 0.17 0.13 0.22 0.14 0.23 0.1 0.1 0.05 0.16 0.01 ...
## $ Total.of.segments : int 1 1 1 1 1 1 1 1 1 1 ...
colnames(Mooch_sales)[c(1,2,3,4,5,6,7,8,9,10,11,12,13)]<-c("Item","Quantity","Cost_per_item","Profit_per_item","Sales_per_market_segment_1","Sales_per_market_segment_2","Sales_per_market_segment_3","Sales_per_market_segment_4","Sales_per_market_segment_5","Sales_per_market_segment_6","Sales_per_market_segment_7","Sales_per_market_segment_8","Total_of_segments")
hist(Mooch_sales$Sales_per_market_segment_1,main="Students' Union's Mooch bar", xlab="Sales per market segment 1",border="lightcoral",col="darkseagreen2",las=2)
# the Sales per market segment Certainly tells that there is a long tail left hand side,there is a some kind of Skewness which we can obviously look this data
hist(log(Mooch_sales$Sales_per_market_segment_1),main="Students' Union's Mooch bar", xlab="Sales per market segment 1",border="lightcoral",col="darkseagreen2",las=2)
# # Doing a kind of transformation here in a logarithmic scale for the value of Sales per market segment 1
plot(density(Mooch_sales$Sales_per_market_segment_1),col="Blue")
hist(Mooch_sales$Sales_per_market_segment_1,prob=TRUE,col="grey")
lines(density(Mooch_sales$Sales_per_market_segment_1),col="blue",lwd=2)
lines(density(Mooch_sales$Sales_per_market_segment_1,adjust=2),lty="dotted",col="RED",lwd=2)
##############################
########## skewness ##########
##############################
# here the points is moved to the left that is "-0.05820875" _ve skewness
##############################
########## Kurtosis ##########
##############################
# in the give Data the Sales_per_market_segment_1 is Platykurtic because the Value is "-1.615413" Negative
hist(Mooch_sales$Sales_per_market_segment_2,main="Students' Union's Mooch bar", xlab="Sales per market segment 1",border="lightcoral",col="darkseagreen2",las=2)
# the Sales per market segment Certainly tells that there is a long tail left hand side,there is a some kind of Skewness which we can obviously look this data
hist(log(Mooch_sales$Sales_per_market_segment_1),main="Students' Union's Mooch bar", xlab="Sales per market segment 2",border="lightcoral",col="darkseagreen2",las=2)
# # Doing a kind of transformation here in a logarithmic scale for the value of Sales per market segment 2
plot(density(Mooch_sales$Sales_per_market_segment_2),col="Blue")
hist(Mooch_sales$Sales_per_market_segment_2,prob=TRUE,col="grey")
lines(density(Mooch_sales$Sales_per_market_segment_2),col="blue",lwd=2)
lines(density(Mooch_sales$Sales_per_market_segment_2,adjust=2),lty="dotted",col="RED",lwd=2)
##############################
########## skewness ##########
##############################
# here the points is moved to the left that is "-0.05805075" _ve skewness
##############################
########## Kurtosis ##########
##############################
# in the give Data the Sales_per_market_segment_2 is Platykurtic because the Value is "-1.277058" Negative
hist(Mooch_sales$Sales_per_market_segment_3,main="Students' Union's Mooch bar", xlab="Sales per market segment 3",border="lightcoral",col="darkseagreen2",las=2)
# the Sales per market segment Certainly tells that there is a long tail left hand side,there is a some kind of Skewness which we can obviously look this data
hist(log(Mooch_sales$Sales_per_market_segment_3),main="Students' Union's Mooch bar", xlab="Sales per market segment 3",border="lightcoral",col="darkseagreen2",las=2)
# # Doing a kind of transformation here in a logarithmic scale for the value of Sales per market segment 3
plot(density(Mooch_sales$Sales_per_market_segment_3),col="Blue")
hist(Mooch_sales$Sales_per_market_segment_3,prob=TRUE,col="grey")
lines(density(Mooch_sales$Sales_per_market_segment_3),col="blue",lwd=2)
lines(density(Mooch_sales$Sales_per_market_segment_3,adjust=2),lty="dotted",col="RED",lwd=2)
##############################
########## skewness ##########
##############################
# here the points is moved to the Right that is "0.1956756" +ve skewness
##############################
########## Kurtosis ##########
##############################
# in the give Data the Sales_per_market_segment_3 is Platykurtic because the Value is "-1.139855" Negative
hist(Mooch_sales$Sales_per_market_segment_4,main="Students' Union's Mooch bar", xlab="Sales per market segment 4",border="lightcoral",col="darkseagreen2",las=2)
# the Sales per market segment Certainly tells that there is a long tail right hand side,there is a some kind of Skewness which we can obviously look this data
hist(log(Mooch_sales$Sales_per_market_segment_4),main="Students' Union's Mooch bar", xlab="Sales per market segment 4",border="lightcoral",col="darkseagreen2",las=2)
# # Doing a kind of transformation here in a logarithmic scale for the value of Sales per market segment 4
plot(density(Mooch_sales$Sales_per_market_segment_4),col="Blue")
hist(Mooch_sales$Sales_per_market_segment_4,prob=TRUE,col="grey")
lines(density(Mooch_sales$Sales_per_market_segment_4),col="blue",lwd=2)
lines(density(Mooch_sales$Sales_per_market_segment_4,adjust=2),lty="dotted",col="RED",lwd=2)
##############################
########## skewness ##########
##############################
# here the points is moved to the Right that is "0.01674235" +ve skewness
##############################
########## Kurtosis ##########
##############################
# in the give Data the Sales_per_market_segment_4 is Platykurtic because the Value is "-1.321457" Negative
hist(Mooch_sales$Sales_per_market_segment_5,main="Students' Union's Mooch bar", xlab="Sales per market segment 5",border="lightcoral",col="darkseagreen2",las=2)
# the Sales per market segment Certainly tells that there is a long tail left hand side,there is a some kind of Skewness which we can obviously look this data
hist(log(Mooch_sales$Sales_per_market_segment_5),main="Students' Union's Mooch bar", xlab="Sales per market segment 5",border="lightcoral",col="darkseagreen2",las=2)
# # Doing a kind of transformation here in a logarithmic scale for the value of Sales per market segment 5
plot(density(Mooch_sales$Sales_per_market_segment_5),col="Blue")
hist(Mooch_sales$Sales_per_market_segment_5,prob=TRUE,col="grey")
lines(density(Mooch_sales$Sales_per_market_segment_5),col="blue",lwd=2)
lines(density(Mooch_sales$Sales_per_market_segment_5,adjust=2),lty="dotted",col="RED",lwd=2)
##############################
########## skewness ##########
##############################
# here the points is moved to the left that is "-0.1363499" -ve skewness
##############################
########## Kurtosis ##########
##############################
# in the give Data the Sales_per_market_segment_5 is Platykurtic because the Value is "-1.661504" Negative
hist(Mooch_sales$Sales_per_market_segment_6,main="Students' Union's Mooch bar", xlab="Sales per market segment 6",border="lightcoral",col="darkseagreen2",las=2)
# the Sales per market segment Certainly tells that there is a long tail left hand side,there is a some kind of Skewness which we can obviously look this data
hist(log(Mooch_sales$Sales_per_market_segment_6),main="Students' Union's Mooch bar", xlab="Sales per market segment 6",border="lightcoral",col="darkseagreen2",las=2)
# # Doing a kind of transformation here in a logarithmic scale for the value of Sales per market segment 6
plot(density(Mooch_sales$Sales_per_market_segment_6),col="Blue")
hist(Mooch_sales$Sales_per_market_segment_6,prob=TRUE,col="grey")
lines(density(Mooch_sales$Sales_per_market_segment_6),col="blue",lwd=2)
lines(density(Mooch_sales$Sales_per_market_segment_6,adjust=2),lty="dotted",col="RED",lwd=2)
##############################
########## skewness ##########
##############################
# here the points is moved to the left that is "-0.02818853" -ve skewness
##############################
########## Kurtosis ##########
##############################
# in the give Data the Sales_per_market_segment_6 is Platykurtic because the Value is "-1.601279" Negative
hist(Mooch_sales$Sales_per_market_segment_7,main="Students' Union's Mooch bar", xlab="Sales per market segment 7",border="lightcoral",col="darkseagreen2",las=2)
# the Sales per market segment Certainly tells that there is a long tail left hand side,there is a some kind of Skewness which we can obviously look this data
hist(log(Mooch_sales$Sales_per_market_segment_7),main="Students' Union's Mooch bar", xlab="Sales per market segment 7",border="lightcoral",col="darkseagreen2",las=2)
# # Doing a kind of transformation here in a logarithmic scale for the value of Sales per market segment 7
66
plot(density(Mooch_sales$Sales_per_market_segment_7),col="Blue")
hist(Mooch_sales$Sales_per_market_segment_7,prob=TRUE,col="grey")
lines(density(Mooch_sales$Sales_per_market_segment_7),col="blue",lwd=2)
lines(density(Mooch_sales$Sales_per_market_segment_7,adjust=2),lty="dotted",col="RED",lwd=2)
##############################
########## skewness ##########
##############################
# here the points is moved to the left that is "-0.1788896" -ve skewness
##############################
########## Kurtosis ##########
##############################
# in the give Data the Sales_per_market_segment_7 is Platykurtic because the Value is "-1.416921" Negative
hist(Mooch_sales$Sales_per_market_segment_8,main="Students' Union's Mooch bar", xlab="Sales per market segment 8",border="lightcoral",col="darkseagreen2",las=2)
# the Sales per market segment Certainly tells that there is a long tail left hand side,there is a some kind of Skewness which we can obviously look this data
hist(log(Mooch_sales$Sales_per_market_segment_8),main="Students' Union's Mooch bar", xlab="Sales per market segment 8",border="lightcoral",col="darkseagreen2",las=2)
# # Doing a kind of transformation here in a logarithmic scale for the value of Sales per market segment 8
plot(density(Mooch_sales$Sales_per_market_segment_8),col="Blue")
hist(Mooch_sales$Sales_per_market_segment_8,prob=TRUE,col="grey")
lines(density(Mooch_sales$Sales_per_market_segment_8),col="blue",lwd=2)
lines(density(Mooch_sales$Sales_per_market_segment_8,adjust=2),lty="dotted",col="RED",lwd=2)
##############################
########## skewness ##########
##############################
# here the points is moved to the left that is "-0.3056849" -ve skewness
##############################
########## Kurtosis ##########
##############################
# in the give Data the Sales_per_market_segment_8 is Platykurtic because the Value is "-1.019106" Negative