library(ggplot2)
library(tidyverse)
## ── Attaching packages ─────────────────────────────────────── tidyverse 1.3.2 ──
## ✔ tibble  3.1.8      ✔ dplyr   1.0.10
## ✔ tidyr   1.2.1      ✔ stringr 1.4.1 
## ✔ readr   2.1.3      ✔ forcats 0.5.2 
## ✔ purrr   0.3.5      
## ── Conflicts ────────────────────────────────────────── tidyverse_conflicts() ──
## ✖ dplyr::filter() masks stats::filter()
## ✖ dplyr::lag()    masks stats::lag()
library(openintro)
## Loading required package: airports
## Loading required package: cherryblossom
## Loading required package: usdata
library(ggridges)
library(readxl)
Enterprise <- read_excel("Enterprise.xlsx")

Observations

In this data set we are given information about different stages of sales. These include closed lost, closed won, contract, deferred, demo, gain sponsorship, proposal, and qualify. Below are many graphs organizing this data in a cohesive manner.

From this data we see that KJ is making the most Annual Recurring Revenue at 248817.0 dollars. We can also see that Jay is making the least amount of Anuual Recurring Revenue at 24200.0 dollars. We can see that Matt has lost the most amount of deaLs. We can also tell that Jay and Michelle have the least amount of closed lost, however they both make the least amount of Anuual Recurring Revenue. From this we can infer that in order to make a lot of annual revenue, you have to attempt a lot of sales, even if that means losing a lot of them. We also can see that KJ has won the most deals. And he also has the most in gain sponsorship.

library(ggplot2)

ggplot(Enterprise, aes(x = Annual_Recurring_Rev, y = Deal_owner)) +
  geom_violin()
## Warning: Removed 58 rows containing non-finite values (stat_ydensity).
## Warning: Groups with fewer than two data points have been dropped.

ggplot(Enterprise, aes(x = Deal_Stage,
                       fill = Deal_owner)) +
  geom_bar()

##Closed lost and won
Enterprise_Closed <- filter(Enterprise, Deal_Stage == "Closed lost" | Deal_Stage == "Closed won")
print(Enterprise_Closed)
## # A tibble: 235 × 6
##    Record_ID  Deal_Name Deal_Stage  Close_Date          Deal_owner Annual_Recu…¹
##    <chr>      <chr>     <chr>       <dttm>              <chr>              <dbl>
##  1 8667386634 MMT       Closed lost 2022-06-03 08:22:00 Jay                22500
##  2 8665924620 NR        Closed won  2022-06-30 10:37:00 Jay                24200
##  3 8376067927 MAG       Closed lost 2022-04-21 09:43:00 Jay                30000
##  4 8051015557 IMP       Closed lost 2022-05-05 11:27:00 Jay               300000
##  5 5281132294 MCC       Closed lost 2022-02-01 09:19:00 Jay               100000
##  6 80536468   ADC       Closed lost 2021-12-06 16:25:00 Jay                50000
##  7 6290897793 GUSI      Closed lost 2022-04-28 08:43:00 Jeff               30000
##  8 5293533834 USSS      Closed won  2021-05-31 18:54:00 Jeff                  NA
##  9 398502314  OHSU      Closed won  2020-12-09 16:23:00 Jeff              260300
## 10 301167866  USSS      Closed won  2021-04-15 13:13:00 Jeff              185000
## # … with 225 more rows, and abbreviated variable name ¹​Annual_Recurring_Rev
ggplot(Enterprise_Closed, aes(x = Annual_Recurring_Rev)) + 
  geom_histogram(binwidth = 50000)
## Warning: Removed 49 rows containing non-finite values (stat_bin).

ggplot(Enterprise_Closed, aes(x = Annual_Recurring_Rev, y = Deal_Stage, fill = Deal_Stage, color = Deal_Stage)) + 
  geom_density_ridges(alpha = 0.5)
## Picking joint bandwidth of 38900
## Warning: Removed 49 rows containing non-finite values (stat_density_ridges).

Enterprise_opendeals <- filter(Enterprise, Deal_Stage == "Qualify" | Deal_Stage == "Deferred" | Deal_Stage == "Proposal" | Deal_Stage == "Contract" | Deal_Stage == "Gain Sponsorship" | Deal_Stage == "Demo", Deal_owner == "KJ")

print(Enterprise_opendeals)
## # A tibble: 31 × 6
##    Record_ID   Deal_Name Deal_Stage       Close_Date          Deal_owner Annua…¹
##    <chr>       <chr>     <chr>            <dttm>              <chr>        <dbl>
##  1 10263616090 POL       Qualify          2023-06-30 09:23:00 KJ          100000
##  2 10184892819 AGC       Qualify          2022-12-31 12:10:00 KJ           25000
##  3 10117760550 MC        Qualify          2023-06-30 14:23:00 KJ          100000
##  4 9944126474  IN        Qualify          2023-03-31 11:56:00 KJ              NA
##  5 9872064110  MB        Qualify          2023-03-31 14:04:00 KJ              NA
##  6 9494292544  CEN       Demo             2023-03-31 10:24:00 KJ          110000
##  7 9413663363  ALM       Proposal         2023-03-31 16:09:00 KJ          110400
##  8 8938605686  ALJ       Gain Sponsorship 2022-09-30 13:30:00 KJ           14400
##  9 8738242958  COG       Gain Sponsorship 2022-12-31 15:00:00 KJ          100000
## 10 8579937362  SW        Demo             2023-12-31 12:34:00 KJ          100000
## # … with 21 more rows, and abbreviated variable name ¹​Annual_Recurring_Rev
##Closed lost and won
Enterprise_Closed <- filter(Enterprise, Deal_Stage == "Closed lost" | Deal_Stage == "Closed won")
print(Enterprise_Closed)
## # A tibble: 235 × 6
##    Record_ID  Deal_Name Deal_Stage  Close_Date          Deal_owner Annual_Recu…¹
##    <chr>      <chr>     <chr>       <dttm>              <chr>              <dbl>
##  1 8667386634 MMT       Closed lost 2022-06-03 08:22:00 Jay                22500
##  2 8665924620 NR        Closed won  2022-06-30 10:37:00 Jay                24200
##  3 8376067927 MAG       Closed lost 2022-04-21 09:43:00 Jay                30000
##  4 8051015557 IMP       Closed lost 2022-05-05 11:27:00 Jay               300000
##  5 5281132294 MCC       Closed lost 2022-02-01 09:19:00 Jay               100000
##  6 80536468   ADC       Closed lost 2021-12-06 16:25:00 Jay                50000
##  7 6290897793 GUSI      Closed lost 2022-04-28 08:43:00 Jeff               30000
##  8 5293533834 USSS      Closed won  2021-05-31 18:54:00 Jeff                  NA
##  9 398502314  OHSU      Closed won  2020-12-09 16:23:00 Jeff              260300
## 10 301167866  USSS      Closed won  2021-04-15 13:13:00 Jeff              185000
## # … with 225 more rows, and abbreviated variable name ¹​Annual_Recurring_Rev
ggplot(Enterprise_Closed, aes (x = Annual_Recurring_Rev,
                                fill = Deal_owner))+
  geom_histogram(binwidth = 50000)
## Warning: Removed 49 rows containing non-finite values (stat_bin).

ggplot(Enterprise_Closed, aes (x = Annual_Recurring_Rev,
                               fill = Deal_Stage))+
  geom_histogram(binwidth = 50000)
## Warning: Removed 49 rows containing non-finite values (stat_bin).

ggplot(Enterprise_Closed, aes (x = Annual_Recurring_Rev, y = Deal_Stage, fill = Deal_Stage, color = Deal_Stage )) +
  geom_density_ridges(alpha = 0.5)
## Picking joint bandwidth of 38900
## Warning: Removed 49 rows containing non-finite values (stat_density_ridges).

Enterprise_opendeals <- filter(Enterprise, Deal_Stage == "Deferred" | Deal_Stage == "Qualify" | Deal_Stage == "Proposal" | Deal_Stage == "Gain Sponsership" | Deal_Stage == "Demo" | Deal_owner == "KJ")
Enterprise_won <- filter(Enterprise, Deal_Stage == "Closed won")

#Enterprise %>%
 # select(Deal_Name, Deal_Stage, Annual_Recurring_Rev)

Enterprise_won %>%
  group_by(Deal_owner) %>%
  summarize(
    avg_revenue = mean(Annual_Recurring_Rev, na.rm = TRUE)
    )
## # A tibble: 9 × 2
##   Deal_owner avg_revenue
##   <chr>            <dbl>
## 1 Jay             24200 
## 2 Jeff           219444 
## 3 KJ             248817.
## 4 Letitia        103100 
## 5 Mark           228920 
## 6 Matt           170091.
## 7 Michelle        43000 
## 8 Scott          118100 
## 9 Tomas          100640