Advertisement
Guest User

Untitled

a guest
Mar 19th, 2018
509
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
R 7.21 KB | None | 0 0
  1. ---
  2. title: "Recruitment Stratedy For Real Estate Companies"
  3. author: "Joe Foley ,
  4.        JFoley648@gmail.com"
  5.  
  6. output: html_document
  7. ---
  8.  
  9. ```{r setup, include=FALSE}
  10. knitr::opts_chunk$set(echo = TRUE)
  11. ```
  12.  
  13.  
  14. The way for Real Estate companies to make more money is to sell more homes .  But of course they cannot increase the number of people who want to sell their homes so the only way to increase sales is to sell a larger proportion of those homes that do come on the market.
  15.  
  16. There are two sides to a real estate transaction, the **Listing** side and **Selling** side.
  17. The Listingside  markets the home and the Selling side are the ones that found the buyer.
  18.  
  19. Like in any sales force some agents are far more succesful than others.   Real estate companies try to poach the most succesful agents to switch to their company.  And among the agents  in particular the comapnies  focus on recruiting the Listing agents rather than the Selling agents.  The logic here is that no one knows who may find the buyer for the house but if you have the listing you dont care , you will make your money no matter who brings the buyer.
  20.  
  21. With this mindset the monthly Real Estate meeting features some version of an Area Graph like a Pie Chart showing how a few agents have the majority of lisitngs and then brainstorming on how to recruit these agents.
  22.  
  23. ```{r include=FALSE}
  24. #############
  25. # PREFERNCES
  26. ############
  27. #eliminate scientific notation
  28. options(scipen = 999)
  29. rm(list=ls())
  30. options(stringsAsFactors = FALSE, digits=6)
  31. ```
  32.  
  33. ```{r include=FALSE}
  34. ################
  35. # Packages
  36. ###############
  37. library(tidyverse)
  38. library(data.table)
  39. library(treemapify)
  40. library(RColorBrewer)
  41. # Installing packages
  42. wants <- c("tidyr","readr","dplyr","tidyverse","tibble","igraph","data.table",
  43.            "plyr","ggplot2","treemapify","treemap")
  44. has   <- wants %in% rownames(installed.packages())
  45. if(any(!has)) install.packages(wants[!has])
  46.  
  47. lapply(wants, library, character.only = TRUE)
  48.  
  49. library(dplyr)
  50. ```
  51.  
  52. ```{r include=FALSE}
  53.  
  54. #############
  55. #IMPORT DATA
  56. #############
  57. Data<- fread("NorthShore3.csv", header = TRUE, na.strings = c("","NA"))
  58. ```
  59.  
  60. ```{r  include=FALSE}
  61. #Group Data
  62. detach(package:plyr)
  63. ListAgentsTotals<- Data %>%
  64.      group_by(Listing_Last) %>%
  65.      summarise(Total = sum(Sold_Price))
  66. ListAgentsTotals
  67. View(ListAgentsTotals)
  68. ```
  69.  
  70. ```{r echo=FALSE}
  71. ###########
  72. # GRAPH
  73. ###########
  74. ##############################
  75. #  The Tree Map
  76. #############################
  77.  
  78. ###
  79. Tree_Map<- ggplot(ListAgentsTotals,
  80.                       aes(area=Total, fill=as.factor(log(1/Total)),
  81.                           label=Listing_Last,subgroup = Listing_Last))+
  82.   scale_colour_brewer(palette = "Greens") +
  83.   theme_classic() +
  84.   geom_treemap() +
  85.   # geom_treemap_text(fontface = "italic", colour = "white", place = "centre",grow = TRUE) +
  86.   geom_treemap_subgroup_border(colour="white",size=10) +
  87.   geom_treemap_subgroup_text(place = "centre", grow = T, alpha = 1, colour =
  88.                                "white", min.size = 0) +
  89.   theme(legend.position = "none")+
  90.   ggtitle("Ten Listing Agents have about 1/3 of all of the listings")
  91.  
  92. Tree_Map
  93. ```
  94.  
  95. But the truth of the matter is that these star Listing agents are not poachable.  But the very reason that the star Listing agents are not poachable points to a way forward for real estate companies.  The majority of real estate agents work on a 50/50 split .  This means that they and their company split the commision evenly.  Star Listing agents on the other hand often work on a  70/30 split , that means that for every $100,000 in sales with a 4% commsion , with 2% going to the Selling side and 2% going to the Lising side, they get $1400 while the company earns only $600. This is why the star agents are not poachable.  They are making as much commission  as they can and new comapanies have nothing more to offer.
  96.  
  97. ```{r echo=FALSE}
  98. Commision.Splits<-fread("Commsion_splits.csv")
  99.  
  100. ```
  101.  
  102.  
  103. ```{r echo=FALSE , results='as is'}
  104. library(knitr)
  105. kable(Commision.Splits)
  106.  
  107. ```
  108.  
  109. As the Tree Map illustrates about 10 agents List about 1/3 of a typical suburban real estate market. But it turns out that each star listing agent has a group of Selling agents who sell the star listing agents homes.  Year after year the same Selling agents will have the buyers for the same Listing agents.  And while individually these Selling agents are not stars, enough of them gathered together can approximate the performance of a star  Listing agent.  A look at the table shows us that each time the Selling agent sells one of the star Listing agents homes the Selling agents comapany earns mor ethan three times as much money.
  110.  
  111.  
  112. ```{r include=FALSE}
  113. Data<- fread("NorthShore3.csv", header = TRUE, na.strings = c("","NA"))
  114. ```
  115.  
  116.  
  117. ```{r include=FALSE}
  118. wants <- c("tidyr","readr","dplyr","tidyverse","tibble","igraph","data.table",
  119.            "plyr","ggplot2","treemapify","treemap")
  120. has   <- wants %in% rownames(installed.packages())
  121. if(any(!has)) install.packages(wants[!has])
  122.  
  123. lapply(wants, library, character.only = TRUE)
  124. #library(dplyr)
  125. ```
  126.  
  127. ```{r echo=FALSE}
  128. Data<- as.data.table(Data)
  129. ```
  130.  
  131. ```{r include=FALSE}
  132. Data<-Data[!(Data$Listing_Last==Data$Selling_Last) , ]
  133. ```
  134.  
  135. ```{r include=FALSE}
  136. Data<- na.omit(Data)
  137. #View(Data)
  138. ```
  139.  
  140.  
  141. ```{r echo=FALSE}
  142. library(plyr)
  143. Listing_And_Selling_Teams_Totals<- ddply(Data,c("Listing_Last","Selling_Last"), summarise,
  144.                                          Total= sum(Sold_Price))
  145. ```
  146.  
  147.  
  148.  
  149.  
  150.  
  151. ```{r, echo=FALSE, results='hide',fig.keep='all'}
  152.  
  153. Top_100<- head(arrange(Listing_And_Selling_Teams_Totals, desc(Total)), n=100)
  154. g<-graph.data.frame(Top_100, directed = TRUE)
  155. fixlayout <- layout.fruchterman.reingold(g)
  156. #g<-graph.data.frame(Top_100_Network, directed = TRUE)
  157. par(mar=c(1,0,2,0))
  158. V(g)$name
  159. plot(g,layout=fixlayout,
  160.      vertex.size= 4,
  161.      vertex.label= V(g)$name,
  162.      vertex.label.cex =0.8,
  163.      vertex.label.dist = 0.4,
  164.      vertex.label.color = "black",
  165.      edge.arrow.size=0.1,
  166.      vertex.color="blue")
  167. g
  168. title("Top 100 Teams")
  169. ```
  170.  
  171.  
  172.  
  173.  
  174. As can be seen from the network graph above real estate transactions divide in clusters.
  175. Brix, Parisi , and Scuibba listings are sold by seperate teams of agents.  
  176.  
  177. ```{r include=FALSE}
  178. #dplyr:: filter(iris, Sepal.Length > 7)
  179. Sciubba<-dplyr::filter(Listing_And_Selling_Teams_Totals , Listing_Last=="Sciubba" )
  180.  
  181. ```
  182.  
  183. ```{r echo=FALSE}
  184. Sciubba_Network<- graph_from_data_frame(Sciubba, directed = FALSE)
  185. plot(Sciubba_Network)
  186. title("Sciubba Network")
  187. ```
  188.  
  189.  
  190.  
  191. ```{r echo=FALSE}
  192. Parisi<-dplyr::filter(Listing_And_Selling_Teams_Totals , Listing_Last=="Parisi" )
  193. Parisi_Network<- graph_from_data_frame(Parisi, directed = FALSE)
  194. plot(Parisi_Network)
  195. title("Parisi Network")
  196. ```
  197.  
  198. As one can see the two teams are largely independent.
  199. Lets have another look at our table.
  200. Again, on a $100,000 sale with a  4% commision due , half of the commsion goes to the Selling side and half goes to the Lisitng side. $2000 and $2000.  But how the commsion gets split within the company is the difference.  While the majority of agents work on 50/50 split  the  company star agents often work on a 70/30 split.
  201.  
  202. ```{r echo=FALSE , results='as is'}
  203. library(knitr)
  204. kable(Commision.Splits)
  205.  
  206. ```
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement