Reviewing store 24 file

store <- read.csv("G://IIM Lucknow//Employee Retention Data//Store24.csv") summary(store) ##Measure of Mean and Standard Deviation of Profit

```mean(store$Profit)

sd(store$Profit)```

Measure of Mean and Standard Deviation of CTenure

```mean(store$CTenure)

sd(store$CTenure)```

Measure of Mean and Standard Deviation of MTenure

```mean(store$MTenure)

sd(store$MTenure)```

First 10 Profitable Stores

```attach(store)

View(store)

newstoredata <- store[order(-Sales, Profit, MTenure, CTenure),] #sort by Sales, Profit, MTenure, CTenure in descending order

newstoredata_1 <- store[order(-Profit),]

View(newstoredata_1)

head(newstoredata_1, 10)```

Last 10 Profitable Stores

```newstoredata_2 <- store[order(Profit),]

View(newstoredata_2)

head(newstoredata_2)```

Scatterplot for Profit Vs MTenure

```library(car)

scatterplot(MTenure,Profit, main=“Profit vs MTenure”)```

Scatterplot for Profit Vs CTenure

scatterplot(CTenure,Profit, main="Profit vs CTenure")

Correlation Matrix for all the variables

options(digits = 2) cor(store)

Correlation between Profit and MTenure

x <- store[,c("Profit")] y <- store[,c("MTenure")] cor(x,y)

Correlation between Profit and CTenure

x <- store[,c("Profit")] z <- store[,c("CTenure")] cor(x,z)

Correlation between Variables using corrgram

```library(corrgram)

corrgram(store, order=TRUE, lower.panel=panel.shade, upper.panel=panel.pie, text.panel=panel.txt, main=“Corrgram of store intercorrelations”)```

There is a weak positive relationship between profit and MTenure.

There is a weak positive relationship between profit and CrewSkill.

There is a positive relationship between profit and CTenure.

There is a strong positive relationship between profit and sales.

There is a negative relation between profit and competition.

Pearson’s Correlation test on the correlation between Profit and MTenure.

x <- store[,c("Profit")] y <- store[,c("MTenure")] cor.test(x,y, method = c("pearson"))

Pearson’s Correlation test on the correlation between Profit and CTenure.

x <- store[,c("Profit")] z <- store[,c("CTenure")] cor.test(x,z, method = c("pearson"))

Regression test on effect of profit on (MTenure, CTenure Comp, Pop, PedCount, Res, Hours24, Visibility)

fit <- lm(Profit ~ MTenure + CTenure + Res + Pop + Comp + PedCount + Hours24 + Visibility, data=store) summary(fit)

MTenure may raise the profits by $945

Visibility may raise the profits by $760