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)```
```mean(store$CTenure)
sd(store$CTenure)```
```mean(store$MTenure)
sd(store$MTenure)```
```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)```
```newstoredata_2 <- store[order(Profit),]
View(newstoredata_2)
head(newstoredata_2)```
```library(car)
scatterplot(MTenure,Profit, main=“Profit vs MTenure”)```
scatterplot(CTenure,Profit, main="Profit vs CTenure")
options(digits = 2) cor(store)
x <- store[,c("Profit")] y <- store[,c("MTenure")] cor(x,y)
x <- store[,c("Profit")] z <- store[,c("CTenure")] cor(x,z)
```library(corrgram)
corrgram(store, order=TRUE, lower.panel=panel.shade, upper.panel=panel.pie, text.panel=panel.txt, main=“Corrgram of store intercorrelations”)```
x <- store[,c("Profit")] y <- store[,c("MTenure")] cor.test(x,y, method = c("pearson"))
x <- store[,c("Profit")] z <- store[,c("CTenure")] cor.test(x,z, method = c("pearson"))
fit <- lm(Profit ~ MTenure + CTenure + Res + Pop + Comp + PedCount + Hours24 + Visibility, data=store) summary(fit)