Questions to be addressed in this analysis:

  1. Please develop a Multi-Variable linear regression model that predicts the average monthly rental price of a property.

Done below in the R markdown:

  1. What are the key assumptions for Linear Regression?

Assumptions are:

  1. Linearity in Parameters
  2. Homoscedasticity - the variance of the residual is the same for any value
  3. Normality - Errors are normally distributed
  4. No serial autocorrelation : Independence of observations (E(x’e) = 0) This condition is called exogeneity.
  5. No Multicollinearity /independence between x’s Full rank = There is no exact linear relationship among any of the independent variables in the model. This assumption will be necessary for estimation of the parameters of the model.
  1. Do any features require transformation?

Yes, The histogram for rent per sq. feet shows positive skewness, we can adjust it by log transformation, and normalized the distribution. We also removed outliers from the model and check hierarchial clustering the relation between relative important factors. Correlation matrix was used to gain insights about quantitative variables.

  1. Please share how you determined the accuracy and the model’s goodness of fit.

The following steps were used to identify the model

  1. The model was divided into training and testing set: 80:20 ratio. The model was assessed for accuracy using RMSE (root mean square error) - tells us roughly how much average error the model makes.

  2. We look at two measures that assess how well a model is predicting, the train RMSE and the test RMSE. We achieved as can be seen below under Final model, lower RMSE under test. The best fit model was chosen on the basis of stepwise AIC criterion. R2 was also one of the measures used.

  1. Are there any violation of the Linear Regression? Which metrics are used to test this?

Yes, There was violation of heteroscedasticity, which meant that The least squares estimator is still a linear and unbiased estimator, but it is no longer best. That is, there is another estimator with a smaller variance.The standard errors computed for the least squares estimators are incorrect. This can affect confidence intervals and hypothesis testing that use those standard errors, which could lead to misleading conclusions.

So we did a Breusch Pagan Test on our model, we then used heteroskedasticity-consistent standard errors or simply robust standard errors for our final model. However, we also found that the linear model is not the correct one for the data, then the slope and intercept estimates and the fitted values from the linear regression is biased, and the fitted slope and intercept estimates will not be meaningful. The model needs to be fitted using a polynomial regression as some of the X variables require higher degrees of polynomial order.

The strict exogeneity is violated when means X and errors are correlated. This causes inconsistency along with biasedness in estimates. In cases where exogeneity is violated, there could be multiple approaches to resolve it: 1. Instrument variable approach: This can help with endogeneity arising due to ommitted regressers or measurement error. 2. Using Newey West cov matrix to address the issue of serial correlation of errors.

  1. In case of violation, what strategy/strategies do you suggest can improve the model? Show with an example.

As presented under the subheading Improved model, we fit a our final model used uses robust standard errors with polynomial (degree = k) (variable degree for two different variables = Property per Sq and Lease term) for the analysis. We conclude that with lower RMSE and From the output below, the R2 is 0.97, meaning that the observed and the predicted outcome values are highly correlated, which is good. The prediction error RMSE is 22.29, representing an error rate of 1.58% which is good.

Also some of the codes has been inputted as annotations because R-markdown couldn’t knit them. They are working under the R console and produces interesting outputs.

Data Preprocessing

We can observe from the dataset that Monthly rent is our dependent variable for each id associated with Prologis. There are some aspects of the data that would be hard for doing calculations or analysis. Like in Col: Property Office Area has a couple of 0s in place so we need to identify if they are outliers/missing data or not.
Thus, we need to perform several data preprocessing tasks:

  1. Cleaning the missing values
  2. Convert string values to numerical values that allows calculations
#load data 
library(corrplot)
## corrplot 0.90 loaded
library(skimr)
library(dplyr); library(tidyr)
## 
## Attaching package: 'dplyr'
## The following objects are masked from 'package:stats':
## 
##     filter, lag
## The following objects are masked from 'package:base':
## 
##     intersect, setdiff, setequal, union
library(ClustOfVar)
library(readxl)
library(ggplot2)
library(hrbrthemes)
## Warning: package 'hrbrthemes' was built under R version 4.1.2
## NOTE: Either Arial Narrow or Roboto Condensed fonts are required to use these themes.
##       Please use hrbrthemes::import_roboto_condensed() to install Roboto Condensed and
##       if Arial Narrow is not on your system, please see https://bit.ly/arialnarrow
library(MASS)
## 
## Attaching package: 'MASS'
## The following object is masked from 'package:dplyr':
## 
##     select
prologis_data <- read_excel("C:/Users/Twinkle/Downloads/2022 Intern - Advanced Analytics Take Home Assessment (1).xlsx", sheet = "IE_Model_Population", skip = 2)
str(prologis_data) # sanity check
## tibble [84 x 10] (S3: tbl_df/tbl/data.frame)
##  $ Lease ID                    : num [1:84] 53884 56140 64052 54897 46043 ...
##  $ Monthly Rent ($ per Sq. Ft.): num [1:84] 6.35 6.73 6.67 5.88 6.36 ...
##  $ Transaction Type            : chr [1:84] "Renewal" "Renewal" "Original Lease" "Renewal" ...
##  $ Customer Industry           : chr [1:84] "Wholesaler" "Wholesaler" "Retailer" "Wholesaler" ...
##  $ Lease - Total Term (Month)  : num [1:84] 24 24 24 24 31 33 36 36 36 36 ...
##  $ Lease - Free Rent (Month)   : num [1:84] 0 0 0 0 2 2 0 1 0 0 ...
##  $ Property - Size (Sq. Ft.)   : num [1:84] 656040 445200 172998 395954 441970 ...
##  $ Property - Speed Bay        : num [1:84] 50 60 60 50 58 60 42 60 48 48 ...
##  $ Property - Year Built       : num [1:84] 2008 1996 1999 1998 2000 ...
##  $ Property - Office Area      : num [1:84] 33000 4150 12147 5520 8453 ...
prologis_data <- na.omit( data.frame(prologis_data)) # remove NA values

We can observe that some columns factor, they are actually character like Transaction type and Customer Industry. So we need to change those.

#typecast categorical variables as factors, but also keep the non factor versions for creating interaction terms
prologis_data$Transaction.Type = as.factor(prologis_data$Transaction.Type)
prologis_data$Customer.Industry = as.factor(prologis_data$Customer.Industry)
prologis_data$Property...Year.Built = as.factor(prologis_data$Property...Year.Built)


##### Rent transformation ####

prologis_data$totalrent = prologis_data$Monthly.Rent....per.Sq..Ft.. * prologis_data$Property...Size..Sq..Ft..
hist(prologis_data$totalrent)

plot(log(totalrent) ~ Customer.Industry, data = prologis_data)  

plot(log(totalrent) ~ Transaction.Type, data = prologis_data)

#### There is skewness present in rents so we need to do transformation to correct it. Analysis: The histogram shows positive skewness, we can adjust it by log transformation, and normalized the distribution.

 
prologis_data$log_totalrent = log(prologis_data$totalrent)
par(mfrow = c(1, 2))
hist(prologis_data$totalrent)
hist(prologis_data$log_totalrent)

### Calculate the average monthly price using subsets
### We checked that the average rent is aggregated based on conditional criterions so we are good to go. 



prologis_data %>%
  ggplot( aes(x=log_totalrent, y = Property...Year.Built)) +
    geom_point(aes(colour = factor(Transaction.Type)))  +
    labs(fill="") + facet_wrap(~ Customer.Industry)

## renewals are highest in wholesaler and 3 pl in the recent years. and original lease is high under unspecified but they are usually for a earlier time periods.



prologis_data %>%
  group_by(Lease.ID, Transaction.Type, Customer.Industry, Property...Year.Built) %>%
  mutate(agg_rent = mean(totalrent),
         log_aggrent = log(agg_rent))
## # A tibble: 84 x 14
## # Groups:   Lease.ID, Transaction.Type, Customer.Industry,
## #   Property...Year.Built [84]
##    Lease.ID Monthly.Rent....~ Transaction.Type Customer.Indust~ Lease...Total.T~
##       <dbl>             <dbl> <fct>            <fct>                       <dbl>
##  1    53884              6.35 Renewal          Wholesaler                     24
##  2    56140              6.73 Renewal          Wholesaler                     24
##  3    64052              6.67 Original Lease   Retailer                       24
##  4    54897              5.88 Renewal          Wholesaler                     24
##  5    46043              6.36 Original Lease   3PL                            31
##  6    41864              6.25 Original Lease   Transportation/~               33
##  7    44752              7.30 Renewal          Manufacturer                   36
##  8    49420              6.11 Renewal          Manufacturer                   36
##  9    48528              6.41 Renewal          Retailer                       36
## 10    52925              5.89 Renewal          3PL                            36
## # ... with 74 more rows, and 9 more variables: Lease...Free.Rent..Month. <dbl>,
## #   Property...Size..Sq..Ft.. <dbl>, Property...Speed.Bay <dbl>,
## #   Property...Year.Built <fct>, Property...Office.Area <dbl>, totalrent <dbl>,
## #   log_totalrent <dbl>, agg_rent <dbl>, log_aggrent <dbl>

Exploratory data analysis

First step in analyzing data is by EDA:

  1. Explore structures of the data - (done by str function) we will use skim to check other descriptive stats
  2. Makes use of simple descriptive statistics
  3. Finding errors and outliers
  4. Correlations between variables
### descriptive Stats 

skim(prologis_data)
Data summary
Name prologis_data
Number of rows 84
Number of columns 12
_______________________
Column type frequency:
factor 3
numeric 9
________________________
Group variables None

Variable type: factor

skim_variable n_missing complete_rate ordered n_unique top_counts
Transaction.Type 0 1 FALSE 2 Ren: 47, Ori: 37
Customer.Industry 0 1 FALSE 7 Who: 30, 3PL: 21, Uns: 15, Ret: 8
Property…Year.Built 0 1 FALSE 26 199: 9, 198: 8, 200: 7, 200: 7

Variable type: numeric

skim_variable n_missing complete_rate mean sd p0 p25 p50 p75 p100 hist
Lease.ID 0 1 54943.33 7483.54 40079.00 49419.75 54896.50 62323.25 68040.00 ▅▇▇▆▇
Monthly.Rent….per.Sq..Ft.. 0 1 6.88 0.98 5.62 6.21 6.50 7.40 9.94 ▇▅▂▂▁
Lease…Total.Term..Month. 0 1 56.15 20.05 24.00 37.00 61.00 63.00 130.00 ▅▇▁▁▁
Lease…Free.Rent..Month. 0 1 1.55 1.57 0.00 0.00 1.00 2.00 10.00 ▇▂▁▁▁
Property…Size..Sq..Ft.. 0 1 279097.38 219862.98 9862.00 107500.00 201473.50 419296.50 970073.00 ▇▃▃▁▁
Property…Speed.Bay 0 1 54.10 9.10 18.00 48.00 58.50 60.00 73.00 ▁▁▅▇▁
Property…Office.Area 0 1 8454.06 13047.11 0.00 3037.50 5712.00 8743.50 113949.00 ▇▁▁▁▁
totalrent 0 1 1790980.29 1366148.84 92691.94 751808.22 1369916.16 2577316.50 6626790.83 ▇▅▂▁▁
log_totalrent 0 1 14.07 0.89 11.44 13.53 14.13 14.76 15.71 ▁▂▆▇▅
pairs(prologis_data[,c("log_totalrent","Transaction.Type","Customer.Industry",
"Lease...Total.Term..Month.", "Lease...Free.Rent..Month.", "Property...Size..Sq..Ft..", "Property...Speed.Bay", "Property...Office.Area")], col=rainbow(3))

names(prologis_data)
##  [1] "Lease.ID"                     "Monthly.Rent....per.Sq..Ft.."
##  [3] "Transaction.Type"             "Customer.Industry"           
##  [5] "Lease...Total.Term..Month."   "Lease...Free.Rent..Month."   
##  [7] "Property...Size..Sq..Ft.."    "Property...Speed.Bay"        
##  [9] "Property...Year.Built"        "Property...Office.Area"      
## [11] "totalrent"                    "log_totalrent"
### Remove outliers by group 

boxplot(prologis_data$Property...Office.Area)

outliers <- boxplot(prologis_data$Property...Office.Area,plot=FALSE)$out
prologis_data[which(prologis_data$Property...Office.Area %in% outliers),]
##    Lease.ID Monthly.Rent....per.Sq..Ft.. Transaction.Type Customer.Industry
## 1     53884                     6.350155          Renewal        Wholesaler
## 26    45525                     6.246059          Renewal          Retailer
## 29    41816                     6.170980          Renewal        Wholesaler
## 31    48903                     6.850775          Renewal               3PL
## 32    41732                     6.067994          Renewal        Wholesaler
## 34    49919                     6.734077          Renewal          Retailer
## 60    60795                     5.706969          Renewal               3PL
## 80    57890                     7.268996   Original Lease               3PL
##    Lease...Total.Term..Month. Lease...Free.Rent..Month.
## 1                          24                         0
## 26                         38                         2
## 29                         48                         1
## 31                         59                         1
## 32                         60                         0
## 34                         60                         0
## 60                         62                         2
## 80                         86                         2
##    Property...Size..Sq..Ft.. Property...Speed.Bay Property...Year.Built
## 1                     656040                   50                  2008
## 26                    334800                   60                  2005
## 29                    359996                   73                  2000
## 31                    241367                   60                  2008
## 32                    504530                   60                  2000
## 34                    757765                   60                  2004
## 60                    645311                   60                  2007
## 80                    201454                   40                  1996
##    Property...Office.Area totalrent log_totalrent
## 1                   33000   4165955      15.24246
## 26                  23040   2091180      14.55324
## 29                  17590   2221528      14.61371
## 31                 113949   1653551      14.31844
## 32                  23640   3061485      14.93441
## 34                  18138   5102848      15.44531
## 60                  17413   3682770      15.11918
## 80                  18677   1464368      14.19693
prologis_data <-prologis_data[-which(prologis_data$Property...Office.Area %in% outliers),]

## Hierarchial clustering with Qual and Quant variables
xquant = prologis_data[,c(1,5,6,7,8,10,12)]
xqual = prologis_data[,c(3,4,9)]
tree <- hclustvar(xquant, xqual)
plot(tree)

stab <- stability(tree, B=50)

### Correlation Matrix
corrplot(cor(xquant),order = 'hclust',addrect = 2)

We can observe presence of outlier in proper office area and speed bay. We need to correct those outliers for the dataset.

Multiple Linear Regression Model

We will use regression models to estimate the average rental price in the market; and predict the new houses coming on the market based on the current data we have.

We will use Root Mean Squared Error (RMSE) on the test data to evaluate their performance.

First, we split the data into training and testing data on a 80-20% ratio

N <- length(prologis_data$Lease.ID)
set.seed(2022)
all_indices = seq(1, N)
training_indices = sort(sample(1:N, 4*N/5, replace = FALSE)) # ratio is 80/20
training_set = prologis_data[training_indices,]
testing_indices =  sort(all_indices[!all_indices %in% training_indices]) # remove training indices from set
testing_set = prologis_data[testing_indices,]
all.equal(sort(c(training_indices, testing_indices)), all_indices) # sanity check to ensure we separated tests correctly
## [1] TRUE
##Fit the full model 
fullmodel <- lm(log_totalrent ~ Lease...Total.Term..Month. + Lease...Free.Rent..Month. + Property...Size..Sq..Ft.. + Property...Speed.Bay +
                     factor(Property...Year.Built) + Property...Office.Area + factor(Transaction.Type) +
                    factor(Customer.Industry) , data = training_set)
summary(fullmodel)
## 
## Call:
## lm(formula = log_totalrent ~ Lease...Total.Term..Month. + Lease...Free.Rent..Month. + 
##     Property...Size..Sq..Ft.. + Property...Speed.Bay + factor(Property...Year.Built) + 
##     Property...Office.Area + factor(Transaction.Type) + factor(Customer.Industry), 
##     data = training_set)
## 
## Residuals:
##      Min       1Q   Median       3Q      Max 
## -0.64855 -0.07872  0.00000  0.10028  0.54965 
## 
## Coefficients:
##                                                            Estimate Std. Error
## (Intercept)                                               1.430e+01  7.583e-01
## Lease...Total.Term..Month.                               -7.007e-03  3.649e-03
## Lease...Free.Rent..Month.                                 5.033e-02  6.696e-02
## Property...Size..Sq..Ft..                                 3.507e-06  4.968e-07
## Property...Speed.Bay                                      1.344e-02  8.741e-03
## factor(Property...Year.Built)1984                        -1.593e+00  5.808e-01
## factor(Property...Year.Built)1985                        -1.241e+00  6.280e-01
## factor(Property...Year.Built)1986                        -1.357e+00  6.198e-01
## factor(Property...Year.Built)1987                        -2.233e+00  5.658e-01
## factor(Property...Year.Built)1988                        -1.639e+00  5.368e-01
## factor(Property...Year.Built)1989                        -2.011e+00  5.315e-01
## factor(Property...Year.Built)1990                        -1.485e+00  5.012e-01
## factor(Property...Year.Built)1995                        -1.298e+00  5.754e-01
## factor(Property...Year.Built)1996                        -1.557e+00  5.626e-01
## factor(Property...Year.Built)1997                        -1.385e+00  5.967e-01
## factor(Property...Year.Built)1998                        -1.476e+00  5.808e-01
## factor(Property...Year.Built)1999                        -1.228e+00  5.916e-01
## factor(Property...Year.Built)2000                        -1.535e+00  5.112e-01
## factor(Property...Year.Built)2001                        -1.547e+00  5.031e-01
## factor(Property...Year.Built)2002                        -1.186e+00  5.125e-01
## factor(Property...Year.Built)2003                        -1.504e+00  5.100e-01
## factor(Property...Year.Built)2005                        -1.437e+00  5.040e-01
## factor(Property...Year.Built)2006                        -1.468e+00  5.241e-01
## factor(Property...Year.Built)2008                        -1.611e+00  5.605e-01
## factor(Property...Year.Built)2014                        -1.689e+00  5.436e-01
## factor(Property...Year.Built)2015                        -1.316e+00  5.787e-01
## factor(Property...Year.Built)2016                        -2.079e+00  7.485e-01
## Property...Office.Area                                   -1.959e-05  2.069e-05
## factor(Transaction.Type)Renewal                           1.869e-01  1.415e-01
## factor(Customer.Industry)Charity/Prof.Services/Other     -1.256e+00  4.393e-01
## factor(Customer.Industry)Manufacturer                    -2.251e-01  2.616e-01
## factor(Customer.Industry)Retailer                        -1.535e-01  2.104e-01
## factor(Customer.Industry)Transportation/Freight/Delivery -1.396e-01  3.220e-01
## factor(Customer.Industry)Unspecified                      1.287e-02  2.223e-01
## factor(Customer.Industry)Wholesaler                      -1.332e-01  1.610e-01
##                                                          t value Pr(>|t|)    
## (Intercept)                                               18.856 2.70e-16 ***
## Lease...Total.Term..Month.                                -1.920 0.066305 .  
## Lease...Free.Rent..Month.                                  0.752 0.459312    
## Property...Size..Sq..Ft..                                  7.059 2.12e-07 ***
## Property...Speed.Bay                                       1.537 0.136817    
## factor(Property...Year.Built)1984                         -2.742 0.011109 *  
## factor(Property...Year.Built)1985                         -1.976 0.059235 .  
## factor(Property...Year.Built)1986                         -2.189 0.038149 *  
## factor(Property...Year.Built)1987                         -3.946 0.000569 ***
## factor(Property...Year.Built)1988                         -3.054 0.005306 ** 
## factor(Property...Year.Built)1989                         -3.784 0.000861 ***
## factor(Property...Year.Built)1990                         -2.963 0.006597 ** 
## factor(Property...Year.Built)1995                         -2.255 0.033108 *  
## factor(Property...Year.Built)1996                         -2.768 0.010465 *  
## factor(Property...Year.Built)1997                         -2.321 0.028759 *  
## factor(Property...Year.Built)1998                         -2.540 0.017661 *  
## factor(Property...Year.Built)1999                         -2.075 0.048419 *  
## factor(Property...Year.Built)2000                         -3.003 0.005994 ** 
## factor(Property...Year.Built)2001                         -3.074 0.005054 ** 
## factor(Property...Year.Built)2002                         -2.315 0.029118 *  
## factor(Property...Year.Built)2003                         -2.950 0.006814 ** 
## factor(Property...Year.Built)2005                         -2.852 0.008585 ** 
## factor(Property...Year.Built)2006                         -2.801 0.009688 ** 
## factor(Property...Year.Built)2008                         -2.874 0.008164 ** 
## factor(Property...Year.Built)2014                         -3.108 0.004653 ** 
## factor(Property...Year.Built)2015                         -2.274 0.031836 *  
## factor(Property...Year.Built)2016                         -2.778 0.010230 *  
## Property...Office.Area                                    -0.947 0.352834    
## factor(Transaction.Type)Renewal                            1.321 0.198589    
## factor(Customer.Industry)Charity/Prof.Services/Other      -2.859 0.008447 ** 
## factor(Customer.Industry)Manufacturer                     -0.860 0.397744    
## factor(Customer.Industry)Retailer                         -0.729 0.472548    
## factor(Customer.Industry)Transportation/Freight/Delivery  -0.433 0.668427    
## factor(Customer.Industry)Unspecified                       0.058 0.954298    
## factor(Customer.Industry)Wholesaler                       -0.827 0.415920    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 0.2999 on 25 degrees of freedom
## Multiple R-squared:  0.9568, Adjusted R-squared:  0.8981 
## F-statistic:  16.3 on 34 and 25 DF,  p-value: 2.07e-10
#Stepwise regression model

step.model <- stepAIC(fullmodel, direction = "both", 
                      trace = FALSE)
step.model$anova
## Stepwise Model Path 
## Analysis of Deviance Table
## 
## Initial Model:
## log_totalrent ~ Lease...Total.Term..Month. + Lease...Free.Rent..Month. + 
##     Property...Size..Sq..Ft.. + Property...Speed.Bay + factor(Property...Year.Built) + 
##     Property...Office.Area + factor(Transaction.Type) + factor(Customer.Industry)
## 
## Final Model:
## log_totalrent ~ Lease...Total.Term..Month. + Property...Size..Sq..Ft.. + 
##     Property...Speed.Bay + factor(Property...Year.Built) + factor(Transaction.Type) + 
##     factor(Customer.Industry)
## 
## 
##                          Step Df   Deviance Resid. Df Resid. Dev       AIC
## 1                                                  25   2.248309 -127.0500
## 2 - Lease...Free.Rent..Month.  1 0.05080236        26   2.299111 -127.7093
## 3    - Property...Office.Area  1 0.04599654        27   2.345108 -128.5208
step.model.backward <- stepAIC(fullmodel, direction = "backward", 
                      trace = FALSE)
summary(step.model.backward)
## 
## Call:
## lm(formula = log_totalrent ~ Lease...Total.Term..Month. + Property...Size..Sq..Ft.. + 
##     Property...Speed.Bay + factor(Property...Year.Built) + factor(Transaction.Type) + 
##     factor(Customer.Industry), data = training_set)
## 
## Residuals:
##      Min       1Q   Median       3Q      Max 
## -0.62376 -0.06495  0.00000  0.09915  0.51053 
## 
## Coefficients:
##                                                            Estimate Std. Error
## (Intercept)                                               1.423e+01  7.010e-01
## Lease...Total.Term..Month.                               -5.416e-03  2.932e-03
## Property...Size..Sq..Ft..                                 3.361e-06  4.663e-07
## Property...Speed.Bay                                      1.534e-02  7.823e-03
## factor(Property...Year.Built)1984                        -1.611e+00  5.600e-01
## factor(Property...Year.Built)1985                        -1.415e+00  5.911e-01
## factor(Property...Year.Built)1986                        -1.543e+00  5.594e-01
## factor(Property...Year.Built)1987                        -2.339e+00  5.358e-01
## factor(Property...Year.Built)1988                        -1.811e+00  4.933e-01
## factor(Property...Year.Built)1989                        -2.143e+00  5.033e-01
## factor(Property...Year.Built)1990                        -1.557e+00  4.724e-01
## factor(Property...Year.Built)1995                        -1.418e+00  5.434e-01
## factor(Property...Year.Built)1996                        -1.660e+00  5.421e-01
## factor(Property...Year.Built)1997                        -1.550e+00  5.516e-01
## factor(Property...Year.Built)1998                        -1.593e+00  5.522e-01
## factor(Property...Year.Built)1999                        -1.432e+00  5.330e-01
## factor(Property...Year.Built)2000                        -1.578e+00  4.750e-01
## factor(Property...Year.Built)2001                        -1.659e+00  4.796e-01
## factor(Property...Year.Built)2002                        -1.235e+00  4.988e-01
## factor(Property...Year.Built)2003                        -1.559e+00  4.916e-01
## factor(Property...Year.Built)2005                        -1.559e+00  4.697e-01
## factor(Property...Year.Built)2006                        -1.604e+00  4.884e-01
## factor(Property...Year.Built)2008                        -1.704e+00  5.436e-01
## factor(Property...Year.Built)2014                        -1.729e+00  5.317e-01
## factor(Property...Year.Built)2015                        -1.393e+00  5.168e-01
## factor(Property...Year.Built)2016                        -2.004e+00  6.172e-01
## factor(Transaction.Type)Renewal                           1.371e-01  1.286e-01
## factor(Customer.Industry)Charity/Prof.Services/Other     -1.233e+00  3.985e-01
## factor(Customer.Industry)Manufacturer                    -1.694e-01  2.454e-01
## factor(Customer.Industry)Retailer                        -1.820e-01  2.033e-01
## factor(Customer.Industry)Transportation/Freight/Delivery -1.341e-01  3.158e-01
## factor(Customer.Industry)Unspecified                      6.473e-03  2.158e-01
## factor(Customer.Industry)Wholesaler                      -7.862e-02  1.485e-01
##                                                          t value Pr(>|t|)    
## (Intercept)                                               20.295  < 2e-16 ***
## Lease...Total.Term..Month.                                -1.847 0.075699 .  
## Property...Size..Sq..Ft..                                  7.208 9.44e-08 ***
## Property...Speed.Bay                                       1.961 0.060249 .  
## factor(Property...Year.Built)1984                         -2.878 0.007736 ** 
## factor(Property...Year.Built)1985                         -2.394 0.023882 *  
## factor(Property...Year.Built)1986                         -2.758 0.010312 *  
## factor(Property...Year.Built)1987                         -4.366 0.000167 ***
## factor(Property...Year.Built)1988                         -3.671 0.001051 ** 
## factor(Property...Year.Built)1989                         -4.258 0.000223 ***
## factor(Property...Year.Built)1990                         -3.296 0.002752 ** 
## factor(Property...Year.Built)1995                         -2.610 0.014600 *  
## factor(Property...Year.Built)1996                         -3.061 0.004940 ** 
## factor(Property...Year.Built)1997                         -2.810 0.009110 ** 
## factor(Property...Year.Built)1998                         -2.885 0.007607 ** 
## factor(Property...Year.Built)1999                         -2.687 0.012201 *  
## factor(Property...Year.Built)2000                         -3.322 0.002572 ** 
## factor(Property...Year.Built)2001                         -3.458 0.001818 ** 
## factor(Property...Year.Built)2002                         -2.475 0.019886 *  
## factor(Property...Year.Built)2003                         -3.171 0.003763 ** 
## factor(Property...Year.Built)2005                         -3.319 0.002591 ** 
## factor(Property...Year.Built)2006                         -3.283 0.002838 ** 
## factor(Property...Year.Built)2008                         -3.134 0.004123 ** 
## factor(Property...Year.Built)2014                         -3.251 0.003077 ** 
## factor(Property...Year.Built)2015                         -2.696 0.011925 *  
## factor(Property...Year.Built)2016                         -3.248 0.003105 ** 
## factor(Transaction.Type)Renewal                            1.066 0.295851    
## factor(Customer.Industry)Charity/Prof.Services/Other      -3.093 0.004570 ** 
## factor(Customer.Industry)Manufacturer                     -0.690 0.495889    
## factor(Customer.Industry)Retailer                         -0.895 0.378592    
## factor(Customer.Industry)Transportation/Freight/Delivery  -0.425 0.674500    
## factor(Customer.Industry)Unspecified                       0.030 0.976287    
## factor(Customer.Industry)Wholesaler                       -0.529 0.600787    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 0.2947 on 27 degrees of freedom
## Multiple R-squared:  0.955,  Adjusted R-squared:  0.9016 
## F-statistic:  17.9 on 32 and 27 DF,  p-value: 1.89e-11
step.model.backward$anova
## Stepwise Model Path 
## Analysis of Deviance Table
## 
## Initial Model:
## log_totalrent ~ Lease...Total.Term..Month. + Lease...Free.Rent..Month. + 
##     Property...Size..Sq..Ft.. + Property...Speed.Bay + factor(Property...Year.Built) + 
##     Property...Office.Area + factor(Transaction.Type) + factor(Customer.Industry)
## 
## Final Model:
## log_totalrent ~ Lease...Total.Term..Month. + Property...Size..Sq..Ft.. + 
##     Property...Speed.Bay + factor(Property...Year.Built) + factor(Transaction.Type) + 
##     factor(Customer.Industry)
## 
## 
##                          Step Df   Deviance Resid. Df Resid. Dev       AIC
## 1                                                  25   2.248309 -127.0500
## 2 - Lease...Free.Rent..Month.  1 0.05080236        26   2.299111 -127.7093
## 3    - Property...Office.Area  1 0.04599654        27   2.345108 -128.5208
library(car)
## Loading required package: carData
## 
## Attaching package: 'car'
## The following object is masked from 'package:dplyr':
## 
##     recode
## Check for multicollinearity 
vif(fullmodel)
##                                       GVIF Df GVIF^(1/(2*Df))
## Lease...Total.Term..Month.        4.135181  1        2.033514
## Lease...Free.Rent..Month.         8.657061  1        2.942288
## Property...Size..Sq..Ft..         8.248839  1        2.872079
## Property...Speed.Bay              4.315187  1        2.077303
## factor(Property...Year.Built) 12160.405547 22        1.238340
## Property...Office.Area            3.214662  1        1.792948
## factor(Transaction.Type)          3.335258  1        1.826269
## factor(Customer.Industry)       429.208312  6        1.657254
##Fit the full model 
fullmodel <- lm(totalrent ~ Lease...Total.Term..Month. + Lease...Free.Rent..Month. + Property...Size..Sq..Ft.. + Property...Speed.Bay +
                     Property...Year.Built + Property...Office.Area + Transaction.Type +
                    Customer.Industry , data = training_set)
summary(fullmodel)
## 
## Call:
## lm(formula = totalrent ~ Lease...Total.Term..Month. + Lease...Free.Rent..Month. + 
##     Property...Size..Sq..Ft.. + Property...Speed.Bay + Property...Year.Built + 
##     Property...Office.Area + Transaction.Type + Customer.Industry, 
##     data = training_set)
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -121285  -40976       0   35722  158048 
## 
## Coefficients:
##                                                    Estimate Std. Error t value
## (Intercept)                                       3.106e+05  2.382e+05   1.304
## Lease...Total.Term..Month.                        1.726e+03  1.146e+03   1.506
## Lease...Free.Rent..Month.                        -1.102e+04  2.103e+04  -0.524
## Property...Size..Sq..Ft..                         6.029e+00  1.561e-01  38.632
## Property...Speed.Bay                             -2.349e+03  2.746e+03  -0.855
## Property...Year.Built1984                        -1.484e+05  1.824e+05  -0.813
## Property...Year.Built1985                        -2.061e+05  1.973e+05  -1.045
## Property...Year.Built1986                        -8.819e+04  1.947e+05  -0.453
## Property...Year.Built1987                        -1.407e+05  1.778e+05  -0.792
## Property...Year.Built1988                        -1.670e+05  1.686e+05  -0.991
## Property...Year.Built1989                        -1.027e+05  1.670e+05  -0.615
## Property...Year.Built1990                        -9.431e+04  1.574e+05  -0.599
## Property...Year.Built1995                        -1.033e+05  1.808e+05  -0.572
## Property...Year.Built1996                         1.527e+05  1.767e+05   0.864
## Property...Year.Built1997                        -1.695e+05  1.875e+05  -0.904
## Property...Year.Built1998                        -2.403e+05  1.825e+05  -1.317
## Property...Year.Built1999                        -4.840e+04  1.858e+05  -0.260
## Property...Year.Built2000                        -7.296e+04  1.606e+05  -0.454
## Property...Year.Built2001                        -6.711e+04  1.581e+05  -0.425
## Property...Year.Built2002                         1.081e+04  1.610e+05   0.067
## Property...Year.Built2003                        -5.783e+03  1.602e+05  -0.036
## Property...Year.Built2005                        -1.681e+05  1.583e+05  -1.062
## Property...Year.Built2006                        -1.136e+05  1.646e+05  -0.690
## Property...Year.Built2008                        -7.774e+04  1.761e+05  -0.442
## Property...Year.Built2014                        -3.610e+04  1.708e+05  -0.211
## Property...Year.Built2015                        -1.194e+05  1.818e+05  -0.657
## Property...Year.Built2016                         5.688e+05  2.351e+05   2.419
## Property...Office.Area                           -1.380e+00  6.499e+00  -0.212
## Transaction.TypeRenewal                          -9.804e+04  4.445e+04  -2.206
## Customer.IndustryCharity/Prof.Services/Other     -2.024e+05  1.380e+05  -1.467
## Customer.IndustryManufacturer                    -4.812e+04  8.218e+04  -0.586
## Customer.IndustryRetailer                        -1.897e+04  6.610e+04  -0.287
## Customer.IndustryTransportation/Freight/Delivery -1.964e+05  1.012e+05  -1.942
## Customer.IndustryUnspecified                     -5.143e+04  6.985e+04  -0.736
## Customer.IndustryWholesaler                       5.362e+04  5.058e+04   1.060
##                                                  Pr(>|t|)    
## (Intercept)                                        0.2041    
## Lease...Total.Term..Month.                         0.1446    
## Lease...Free.Rent..Month.                          0.6051    
## Property...Size..Sq..Ft..                          <2e-16 ***
## Property...Speed.Bay                               0.4005    
## Property...Year.Built1984                          0.4238    
## Property...Year.Built1985                          0.3061    
## Property...Year.Built1986                          0.6545    
## Property...Year.Built1987                          0.4360    
## Property...Year.Built1988                          0.3314    
## Property...Year.Built1989                          0.5441    
## Property...Year.Built1990                          0.5545    
## Property...Year.Built1995                          0.5727    
## Property...Year.Built1996                          0.3957    
## Property...Year.Built1997                          0.3744    
## Property...Year.Built1998                          0.1997    
## Property...Year.Built1999                          0.7967    
## Property...Year.Built2000                          0.6535    
## Property...Year.Built2001                          0.6748    
## Property...Year.Built2002                          0.9470    
## Property...Year.Built2003                          0.9715    
## Property...Year.Built2005                          0.2984    
## Property...Year.Built2006                          0.4966    
## Property...Year.Built2008                          0.6626    
## Property...Year.Built2014                          0.8343    
## Property...Year.Built2015                          0.5174    
## Property...Year.Built2016                          0.0232 *  
## Property...Office.Area                             0.8336    
## Transaction.TypeRenewal                            0.0368 *  
## Customer.IndustryCharity/Prof.Services/Other       0.1550    
## Customer.IndustryManufacturer                      0.5634    
## Customer.IndustryRetailer                          0.7765    
## Customer.IndustryTransportation/Freight/Delivery   0.0635 .  
## Customer.IndustryUnspecified                       0.4684    
## Customer.IndustryWholesaler                        0.2993    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 94210 on 25 degrees of freedom
## Multiple R-squared:  0.9981, Adjusted R-squared:  0.9955 
## F-statistic: 385.9 on 34 and 25 DF,  p-value: < 2.2e-16
library(leaps)


## regression via subsets 

model.regsubsets <- regsubsets(log_totalrent ~ Lease...Total.Term..Month. + Lease...Free.Rent..Month. + Property...Size..Sq..Ft.. + Property...Speed.Bay +
                     Property...Year.Built + Property...Office.Area + Transaction.Type +
                    Customer.Industry , data = training_set, method = "exhaustive", nvmax = 15)
## Warning in leaps.setup(x, y, wt = wt, nbest = nbest, nvmax = nvmax, force.in =
## force.in, : 3 linear dependencies found
## Reordering variables and trying again:
model.regsubsets.s <- summary(model.regsubsets)
model.regsubsets.s$which
##    (Intercept) Lease...Total.Term..Month. Lease...Free.Rent..Month.
## 1         TRUE                      FALSE                     FALSE
## 2         TRUE                      FALSE                     FALSE
## 3         TRUE                       TRUE                     FALSE
## 4         TRUE                       TRUE                     FALSE
## 5         TRUE                       TRUE                     FALSE
## 6         TRUE                       TRUE                     FALSE
## 7         TRUE                       TRUE                     FALSE
## 8         TRUE                       TRUE                     FALSE
## 9         TRUE                       TRUE                     FALSE
## 10        TRUE                       TRUE                     FALSE
## 11        TRUE                       TRUE                     FALSE
## 12        TRUE                       TRUE                     FALSE
## 13        TRUE                       TRUE                     FALSE
## 14        TRUE                       TRUE                     FALSE
## 15        TRUE                       TRUE                      TRUE
## 16        TRUE                       TRUE                      TRUE
##    Property...Size..Sq..Ft.. Property...Speed.Bay Property...Year.Built1983
## 1                       TRUE                FALSE                     FALSE
## 2                       TRUE                 TRUE                     FALSE
## 3                       TRUE                 TRUE                     FALSE
## 4                       TRUE                 TRUE                     FALSE
## 5                       TRUE                 TRUE                     FALSE
## 6                       TRUE                 TRUE                     FALSE
## 7                       TRUE                 TRUE                     FALSE
## 8                       TRUE                 TRUE                     FALSE
## 9                       TRUE                 TRUE                     FALSE
## 10                      TRUE                 TRUE                     FALSE
## 11                      TRUE                 TRUE                     FALSE
## 12                      TRUE                 TRUE                     FALSE
## 13                      TRUE                 TRUE                     FALSE
## 14                      TRUE                 TRUE                     FALSE
## 15                      TRUE                 TRUE                     FALSE
## 16                      TRUE                 TRUE                     FALSE
##    Property...Year.Built1984 Property...Year.Built1985
## 1                      FALSE                     FALSE
## 2                      FALSE                     FALSE
## 3                      FALSE                     FALSE
## 4                      FALSE                     FALSE
## 5                      FALSE                     FALSE
## 6                      FALSE                     FALSE
## 7                      FALSE                     FALSE
## 8                      FALSE                     FALSE
## 9                      FALSE                     FALSE
## 10                     FALSE                     FALSE
## 11                     FALSE                     FALSE
## 12                     FALSE                     FALSE
## 13                     FALSE                     FALSE
## 14                     FALSE                     FALSE
## 15                     FALSE                     FALSE
## 16                      TRUE                     FALSE
##    Property...Year.Built1986 Property...Year.Built1987
## 1                      FALSE                     FALSE
## 2                      FALSE                     FALSE
## 3                      FALSE                     FALSE
## 4                      FALSE                     FALSE
## 5                      FALSE                      TRUE
## 6                      FALSE                      TRUE
## 7                      FALSE                      TRUE
## 8                      FALSE                      TRUE
## 9                      FALSE                      TRUE
## 10                     FALSE                      TRUE
## 11                     FALSE                      TRUE
## 12                     FALSE                      TRUE
## 13                     FALSE                      TRUE
## 14                     FALSE                      TRUE
## 15                     FALSE                      TRUE
## 16                     FALSE                      TRUE
##    Property...Year.Built1988 Property...Year.Built1989
## 1                      FALSE                     FALSE
## 2                      FALSE                     FALSE
## 3                      FALSE                     FALSE
## 4                      FALSE                      TRUE
## 5                      FALSE                      TRUE
## 6                      FALSE                      TRUE
## 7                      FALSE                      TRUE
## 8                       TRUE                      TRUE
## 9                       TRUE                      TRUE
## 10                      TRUE                      TRUE
## 11                      TRUE                      TRUE
## 12                      TRUE                      TRUE
## 13                      TRUE                      TRUE
## 14                      TRUE                      TRUE
## 15                      TRUE                      TRUE
## 16                      TRUE                      TRUE
##    Property...Year.Built1990 Property...Year.Built1995
## 1                      FALSE                     FALSE
## 2                      FALSE                     FALSE
## 3                      FALSE                     FALSE
## 4                      FALSE                     FALSE
## 5                      FALSE                     FALSE
## 6                      FALSE                     FALSE
## 7                      FALSE                     FALSE
## 8                      FALSE                     FALSE
## 9                      FALSE                     FALSE
## 10                     FALSE                     FALSE
## 11                     FALSE                     FALSE
## 12                     FALSE                     FALSE
## 13                      TRUE                     FALSE
## 14                      TRUE                     FALSE
## 15                      TRUE                     FALSE
## 16                      TRUE                     FALSE
##    Property...Year.Built1996 Property...Year.Built1997
## 1                      FALSE                     FALSE
## 2                      FALSE                     FALSE
## 3                      FALSE                     FALSE
## 4                      FALSE                     FALSE
## 5                      FALSE                     FALSE
## 6                      FALSE                     FALSE
## 7                      FALSE                     FALSE
## 8                      FALSE                     FALSE
## 9                      FALSE                     FALSE
## 10                     FALSE                     FALSE
## 11                     FALSE                     FALSE
## 12                     FALSE                     FALSE
## 13                     FALSE                     FALSE
## 14                     FALSE                     FALSE
## 15                     FALSE                     FALSE
## 16                     FALSE                     FALSE
##    Property...Year.Built1998 Property...Year.Built1999
## 1                      FALSE                     FALSE
## 2                      FALSE                     FALSE
## 3                      FALSE                     FALSE
## 4                      FALSE                     FALSE
## 5                      FALSE                     FALSE
## 6                      FALSE                     FALSE
## 7                      FALSE                     FALSE
## 8                      FALSE                     FALSE
## 9                      FALSE                     FALSE
## 10                     FALSE                     FALSE
## 11                     FALSE                     FALSE
## 12                     FALSE                     FALSE
## 13                     FALSE                     FALSE
## 14                     FALSE                     FALSE
## 15                     FALSE                     FALSE
## 16                     FALSE                     FALSE
##    Property...Year.Built2000 Property...Year.Built2001
## 1                      FALSE                     FALSE
## 2                      FALSE                     FALSE
## 3                      FALSE                     FALSE
## 4                      FALSE                     FALSE
## 5                      FALSE                     FALSE
## 6                      FALSE                     FALSE
## 7                      FALSE                     FALSE
## 8                      FALSE                     FALSE
## 9                      FALSE                     FALSE
## 10                     FALSE                     FALSE
## 11                     FALSE                     FALSE
## 12                     FALSE                     FALSE
## 13                     FALSE                     FALSE
## 14                     FALSE                     FALSE
## 15                     FALSE                     FALSE
## 16                     FALSE                     FALSE
##    Property...Year.Built2002 Property...Year.Built2003
## 1                      FALSE                     FALSE
## 2                      FALSE                     FALSE
## 3                      FALSE                     FALSE
## 4                      FALSE                     FALSE
## 5                      FALSE                     FALSE
## 6                       TRUE                     FALSE
## 7                       TRUE                     FALSE
## 8                       TRUE                     FALSE
## 9                       TRUE                     FALSE
## 10                      TRUE                     FALSE
## 11                      TRUE                     FALSE
## 12                      TRUE                     FALSE
## 13                      TRUE                     FALSE
## 14                      TRUE                     FALSE
## 15                      TRUE                     FALSE
## 16                      TRUE                     FALSE
##    Property...Year.Built2004 Property...Year.Built2005
## 1                      FALSE                     FALSE
## 2                      FALSE                     FALSE
## 3                      FALSE                     FALSE
## 4                      FALSE                     FALSE
## 5                      FALSE                     FALSE
## 6                      FALSE                     FALSE
## 7                      FALSE                     FALSE
## 8                      FALSE                     FALSE
## 9                      FALSE                     FALSE
## 10                     FALSE                     FALSE
## 11                     FALSE                     FALSE
## 12                     FALSE                     FALSE
## 13                     FALSE                     FALSE
## 14                     FALSE                     FALSE
## 15                     FALSE                     FALSE
## 16                     FALSE                     FALSE
##    Property...Year.Built2006 Property...Year.Built2007
## 1                      FALSE                     FALSE
## 2                      FALSE                     FALSE
## 3                      FALSE                     FALSE
## 4                      FALSE                     FALSE
## 5                      FALSE                     FALSE
## 6                      FALSE                     FALSE
## 7                      FALSE                     FALSE
## 8                      FALSE                     FALSE
## 9                      FALSE                     FALSE
## 10                     FALSE                     FALSE
## 11                     FALSE                     FALSE
## 12                     FALSE                     FALSE
## 13                     FALSE                     FALSE
## 14                     FALSE                     FALSE
## 15                     FALSE                     FALSE
## 16                     FALSE                     FALSE
##    Property...Year.Built2008 Property...Year.Built2014
## 1                      FALSE                     FALSE
## 2                      FALSE                     FALSE
## 3                      FALSE                     FALSE
## 4                      FALSE                     FALSE
## 5                      FALSE                     FALSE
## 6                      FALSE                     FALSE
## 7                      FALSE                     FALSE
## 8                      FALSE                     FALSE
## 9                      FALSE                     FALSE
## 10                     FALSE                     FALSE
## 11                     FALSE                     FALSE
## 12                     FALSE                     FALSE
## 13                     FALSE                     FALSE
## 14                     FALSE                     FALSE
## 15                     FALSE                     FALSE
## 16                     FALSE                     FALSE
##    Property...Year.Built2015 Property...Year.Built2016 Property...Office.Area
## 1                      FALSE                     FALSE                  FALSE
## 2                      FALSE                     FALSE                  FALSE
## 3                      FALSE                     FALSE                  FALSE
## 4                      FALSE                     FALSE                  FALSE
## 5                      FALSE                     FALSE                  FALSE
## 6                      FALSE                     FALSE                  FALSE
## 7                      FALSE                     FALSE                  FALSE
## 8                      FALSE                     FALSE                  FALSE
## 9                      FALSE                     FALSE                   TRUE
## 10                     FALSE                     FALSE                   TRUE
## 11                     FALSE                     FALSE                   TRUE
## 12                      TRUE                     FALSE                   TRUE
## 13                      TRUE                     FALSE                   TRUE
## 14                      TRUE                     FALSE                   TRUE
## 15                     FALSE                      TRUE                   TRUE
## 16                     FALSE                      TRUE                   TRUE
##    Transaction.TypeRenewal Customer.IndustryCharity/Prof.Services/Other
## 1                    FALSE                                        FALSE
## 2                    FALSE                                        FALSE
## 3                    FALSE                                        FALSE
## 4                    FALSE                                        FALSE
## 5                    FALSE                                        FALSE
## 6                    FALSE                                        FALSE
## 7                     TRUE                                        FALSE
## 8                    FALSE                                         TRUE
## 9                    FALSE                                         TRUE
## 10                   FALSE                                         TRUE
## 11                    TRUE                                         TRUE
## 12                    TRUE                                         TRUE
## 13                    TRUE                                         TRUE
## 14                    TRUE                                         TRUE
## 15                    TRUE                                         TRUE
## 16                    TRUE                                         TRUE
##    Customer.IndustryManufacturer Customer.IndustryRetailer
## 1                          FALSE                     FALSE
## 2                          FALSE                     FALSE
## 3                          FALSE                     FALSE
## 4                          FALSE                     FALSE
## 5                          FALSE                     FALSE
## 6                          FALSE                     FALSE
## 7                          FALSE                     FALSE
## 8                          FALSE                     FALSE
## 9                          FALSE                     FALSE
## 10                          TRUE                     FALSE
## 11                          TRUE                     FALSE
## 12                          TRUE                     FALSE
## 13                          TRUE                     FALSE
## 14                          TRUE                     FALSE
## 15                          TRUE                     FALSE
## 16                          TRUE                     FALSE
##    Customer.IndustryTransportation/Freight/Delivery
## 1                                             FALSE
## 2                                             FALSE
## 3                                             FALSE
## 4                                             FALSE
## 5                                             FALSE
## 6                                             FALSE
## 7                                             FALSE
## 8                                             FALSE
## 9                                             FALSE
## 10                                            FALSE
## 11                                            FALSE
## 12                                            FALSE
## 13                                            FALSE
## 14                                            FALSE
## 15                                            FALSE
## 16                                            FALSE
##    Customer.IndustryUnspecified Customer.IndustryWholesaler
## 1                         FALSE                       FALSE
## 2                         FALSE                       FALSE
## 3                         FALSE                       FALSE
## 4                         FALSE                       FALSE
## 5                         FALSE                       FALSE
## 6                         FALSE                       FALSE
## 7                         FALSE                       FALSE
## 8                         FALSE                       FALSE
## 9                         FALSE                       FALSE
## 10                        FALSE                       FALSE
## 11                        FALSE                       FALSE
## 12                        FALSE                       FALSE
## 13                        FALSE                       FALSE
## 14                        FALSE                        TRUE
## 15                        FALSE                        TRUE
## 16                        FALSE                        TRUE
model.regsubsets.s$cp
##  [1] 51.5645497 29.0177868 16.8419196  7.9383514  0.6733363 -3.1476235
##  [7] -3.2841546 -2.8310920 -2.0449068 -1.0706246  0.0955142  1.5789278
## [13]  3.2278588  4.8721803  6.3992886  8.0273838
model.regsubsets.s$adjr2
##  [1] 0.7853103 0.8313966 0.8576901 0.8780523 0.8956560 0.9064014 0.9093578
##  [8] 0.9110919 0.9121240 0.9127539 0.9129473 0.9123675 0.9113460 0.9102909
## [15] 0.9094962 0.9083927
attempt1 <- lm(log_totalrent ~ Lease...Total.Term..Month. + Lease...Free.Rent..Month. + Property...Size..Sq..Ft.. + Property...Speed.Bay +
                     Property...Year.Built + Property...Office.Area + Transaction.Type +
                    Customer.Industry , data = training_set)


plot( attempt1$fitted.values,attempt1$residuals, main= "Residual plot for attempt1")

Now after the initial analysis, we can observe that there would be some interaction terms required.

Final Multiple Regression Model

finalmodel <- lm(log_totalrent ~ Lease...Total.Term..Month.  + Property...Size..Sq..Ft.. + Property...Speed.Bay +
           + Transaction.Type:Customer.Industry+ Property...Year.Built, data = training_set)
summary(finalmodel)
## 
## Call:
## lm(formula = log_totalrent ~ Lease...Total.Term..Month. + Property...Size..Sq..Ft.. + 
##     Property...Speed.Bay + +Transaction.Type:Customer.Industry + 
##     Property...Year.Built, data = training_set)
## 
## Residuals:
##      Min       1Q   Median       3Q      Max 
## -0.61515 -0.07566  0.00000  0.10563  0.39990 
## 
## Coefficients: (3 not defined because of singularities)
##                                                                                   Estimate
## (Intercept)                                                                      1.423e+01
## Lease...Total.Term..Month.                                                      -5.422e-03
## Property...Size..Sq..Ft..                                                        3.332e-06
## Property...Speed.Bay                                                             1.658e-02
## Property...Year.Built1984                                                       -1.622e+00
## Property...Year.Built1985                                                       -1.468e+00
## Property...Year.Built1986                                                       -1.545e+00
## Property...Year.Built1987                                                       -2.343e+00
## Property...Year.Built1988                                                       -1.814e+00
## Property...Year.Built1989                                                       -2.179e+00
## Property...Year.Built1990                                                       -1.537e+00
## Property...Year.Built1995                                                       -1.431e+00
## Property...Year.Built1996                                                       -1.668e+00
## Property...Year.Built1997                                                       -1.566e+00
## Property...Year.Built1998                                                       -1.591e+00
## Property...Year.Built1999                                                       -1.481e+00
## Property...Year.Built2000                                                       -1.613e+00
## Property...Year.Built2001                                                       -1.671e+00
## Property...Year.Built2002                                                       -1.243e+00
## Property...Year.Built2003                                                       -1.546e+00
## Property...Year.Built2005                                                       -1.618e+00
## Property...Year.Built2006                                                       -1.636e+00
## Property...Year.Built2008                                                       -1.864e+00
## Property...Year.Built2014                                                       -1.691e+00
## Property...Year.Built2015                                                       -1.434e+00
## Property...Year.Built2016                                                       -1.996e+00
## Transaction.TypeOriginal Lease:Customer.Industry3PL                              8.305e-04
## Transaction.TypeRenewal:Customer.Industry3PL                                     3.234e-02
## Transaction.TypeOriginal Lease:Customer.IndustryCharity/Prof.Services/Other     -1.282e+00
## Transaction.TypeRenewal:Customer.IndustryCharity/Prof.Services/Other                    NA
## Transaction.TypeOriginal Lease:Customer.IndustryManufacturer                    -3.436e-01
## Transaction.TypeRenewal:Customer.IndustryManufacturer                            6.453e-02
## Transaction.TypeOriginal Lease:Customer.IndustryRetailer                        -2.363e-01
## Transaction.TypeRenewal:Customer.IndustryRetailer                               -6.869e-02
## Transaction.TypeOriginal Lease:Customer.IndustryTransportation/Freight/Delivery -1.749e-01
## Transaction.TypeRenewal:Customer.IndustryTransportation/Freight/Delivery        -1.154e-01
## Transaction.TypeOriginal Lease:Customer.IndustryUnspecified                     -5.297e-02
## Transaction.TypeRenewal:Customer.IndustryUnspecified                                    NA
## Transaction.TypeOriginal Lease:Customer.IndustryWholesaler                      -8.686e-02
## Transaction.TypeRenewal:Customer.IndustryWholesaler                                     NA
##                                                                                 Std. Error
## (Intercept)                                                                      7.402e-01
## Lease...Total.Term..Month.                                                       3.256e-03
## Property...Size..Sq..Ft..                                                        4.987e-07
## Property...Speed.Bay                                                             8.423e-03
## Property...Year.Built1984                                                        5.952e-01
## Property...Year.Built1985                                                        6.339e-01
## Property...Year.Built1986                                                        5.982e-01
## Property...Year.Built1987                                                        5.694e-01
## Property...Year.Built1988                                                        5.247e-01
## Property...Year.Built1989                                                        5.431e-01
## Property...Year.Built1990                                                        5.033e-01
## Property...Year.Built1995                                                        5.832e-01
## Property...Year.Built1996                                                        5.829e-01
## Property...Year.Built1997                                                        5.916e-01
## Property...Year.Built1998                                                        5.921e-01
## Property...Year.Built1999                                                        6.236e-01
## Property...Year.Built2000                                                        5.188e-01
## Property...Year.Built2001                                                        5.092e-01
## Property...Year.Built2002                                                        5.332e-01
## Property...Year.Built2003                                                        5.233e-01
## Property...Year.Built2005                                                        5.063e-01
## Property...Year.Built2006                                                        5.196e-01
## Property...Year.Built2008                                                        6.065e-01
## Property...Year.Built2014                                                        5.694e-01
## Property...Year.Built2015                                                        5.500e-01
## Property...Year.Built2016                                                        6.599e-01
## Transaction.TypeOriginal Lease:Customer.Industry3PL                              2.056e-01
## Transaction.TypeRenewal:Customer.Industry3PL                                     2.250e-01
## Transaction.TypeOriginal Lease:Customer.IndustryCharity/Prof.Services/Other      4.180e-01
## Transaction.TypeRenewal:Customer.IndustryCharity/Prof.Services/Other                    NA
## Transaction.TypeOriginal Lease:Customer.IndustryManufacturer                     2.866e-01
## Transaction.TypeRenewal:Customer.IndustryManufacturer                            2.928e-01
## Transaction.TypeOriginal Lease:Customer.IndustryRetailer                         5.108e-01
## Transaction.TypeRenewal:Customer.IndustryRetailer                                2.570e-01
## Transaction.TypeOriginal Lease:Customer.IndustryTransportation/Freight/Delivery  4.400e-01
## Transaction.TypeRenewal:Customer.IndustryTransportation/Freight/Delivery         4.222e-01
## Transaction.TypeOriginal Lease:Customer.IndustryUnspecified                      1.903e-01
## Transaction.TypeRenewal:Customer.IndustryUnspecified                                    NA
## Transaction.TypeOriginal Lease:Customer.IndustryWholesaler                       2.103e-01
## Transaction.TypeRenewal:Customer.IndustryWholesaler                                     NA
##                                                                                 t value
## (Intercept)                                                                      19.228
## Lease...Total.Term..Month.                                                       -1.665
## Property...Size..Sq..Ft..                                                         6.682
## Property...Speed.Bay                                                              1.969
## Property...Year.Built1984                                                        -2.725
## Property...Year.Built1985                                                        -2.316
## Property...Year.Built1986                                                        -2.582
## Property...Year.Built1987                                                        -4.115
## Property...Year.Built1988                                                        -3.458
## Property...Year.Built1989                                                        -4.013
## Property...Year.Built1990                                                        -3.055
## Property...Year.Built1995                                                        -2.453
## Property...Year.Built1996                                                        -2.862
## Property...Year.Built1997                                                        -2.647
## Property...Year.Built1998                                                        -2.686
## Property...Year.Built1999                                                        -2.374
## Property...Year.Built2000                                                        -3.109
## Property...Year.Built2001                                                        -3.282
## Property...Year.Built2002                                                        -2.331
## Property...Year.Built2003                                                        -2.953
## Property...Year.Built2005                                                        -3.195
## Property...Year.Built2006                                                        -3.149
## Property...Year.Built2008                                                        -3.074
## Property...Year.Built2014                                                        -2.971
## Property...Year.Built2015                                                        -2.608
## Property...Year.Built2016                                                        -3.026
## Transaction.TypeOriginal Lease:Customer.Industry3PL                               0.004
## Transaction.TypeRenewal:Customer.Industry3PL                                      0.144
## Transaction.TypeOriginal Lease:Customer.IndustryCharity/Prof.Services/Other      -3.067
## Transaction.TypeRenewal:Customer.IndustryCharity/Prof.Services/Other                 NA
## Transaction.TypeOriginal Lease:Customer.IndustryManufacturer                     -1.199
## Transaction.TypeRenewal:Customer.IndustryManufacturer                             0.220
## Transaction.TypeOriginal Lease:Customer.IndustryRetailer                         -0.463
## Transaction.TypeRenewal:Customer.IndustryRetailer                                -0.267
## Transaction.TypeOriginal Lease:Customer.IndustryTransportation/Freight/Delivery  -0.398
## Transaction.TypeRenewal:Customer.IndustryTransportation/Freight/Delivery         -0.273
## Transaction.TypeOriginal Lease:Customer.IndustryUnspecified                      -0.278
## Transaction.TypeRenewal:Customer.IndustryUnspecified                                 NA
## Transaction.TypeOriginal Lease:Customer.IndustryWholesaler                       -0.413
## Transaction.TypeRenewal:Customer.IndustryWholesaler                                  NA
##                                                                                 Pr(>|t|)
## (Intercept)                                                                     1.14e-15
## Lease...Total.Term..Month.                                                      0.109388
## Property...Size..Sq..Ft..                                                       8.13e-07
## Property...Speed.Bay                                                            0.061128
## Property...Year.Built1984                                                       0.012061
## Property...Year.Built1985                                                       0.029852
## Property...Year.Built1986                                                       0.016653
## Property...Year.Built1987                                                       0.000423
## Property...Year.Built1988                                                       0.002138
## Property...Year.Built1989                                                       0.000545
## Property...Year.Built1990                                                       0.005620
## Property...Year.Built1995                                                       0.022155
## Property...Year.Built1996                                                       0.008815
## Property...Year.Built1997                                                       0.014418
## Property...Year.Built1998                                                       0.013181
## Property...Year.Built1999                                                       0.026318
## Property...Year.Built2000                                                       0.004936
## Property...Year.Built2001                                                       0.003270
## Property...Year.Built2002                                                       0.028872
## Property...Year.Built2003                                                       0.007132
## Property...Year.Built2005                                                       0.004025
## Property...Year.Built2006                                                       0.004492
## Property...Year.Built2008                                                       0.005365
## Property...Year.Built2014                                                       0.006846
## Property...Year.Built2015                                                       0.015734
## Property...Year.Built2016                                                       0.006017
## Transaction.TypeOriginal Lease:Customer.Industry3PL                             0.996812
## Transaction.TypeRenewal:Customer.Industry3PL                                    0.886962
## Transaction.TypeOriginal Lease:Customer.IndustryCharity/Prof.Services/Other     0.005460
## Transaction.TypeRenewal:Customer.IndustryCharity/Prof.Services/Other                  NA
## Transaction.TypeOriginal Lease:Customer.IndustryManufacturer                    0.242881
## Transaction.TypeRenewal:Customer.IndustryManufacturer                           0.827497
## Transaction.TypeOriginal Lease:Customer.IndustryRetailer                        0.648060
## Transaction.TypeRenewal:Customer.IndustryRetailer                               0.791594
## Transaction.TypeOriginal Lease:Customer.IndustryTransportation/Freight/Delivery 0.694623
## Transaction.TypeRenewal:Customer.IndustryTransportation/Freight/Delivery        0.787112
## Transaction.TypeOriginal Lease:Customer.IndustryUnspecified                     0.783227
## Transaction.TypeRenewal:Customer.IndustryUnspecified                                  NA
## Transaction.TypeOriginal Lease:Customer.IndustryWholesaler                      0.683408
## Transaction.TypeRenewal:Customer.IndustryWholesaler                                   NA
##                                                                                    
## (Intercept)                                                                     ***
## Lease...Total.Term..Month.                                                         
## Property...Size..Sq..Ft..                                                       ***
## Property...Speed.Bay                                                            .  
## Property...Year.Built1984                                                       *  
## Property...Year.Built1985                                                       *  
## Property...Year.Built1986                                                       *  
## Property...Year.Built1987                                                       ***
## Property...Year.Built1988                                                       ** 
## Property...Year.Built1989                                                       ***
## Property...Year.Built1990                                                       ** 
## Property...Year.Built1995                                                       *  
## Property...Year.Built1996                                                       ** 
## Property...Year.Built1997                                                       *  
## Property...Year.Built1998                                                       *  
## Property...Year.Built1999                                                       *  
## Property...Year.Built2000                                                       ** 
## Property...Year.Built2001                                                       ** 
## Property...Year.Built2002                                                       *  
## Property...Year.Built2003                                                       ** 
## Property...Year.Built2005                                                       ** 
## Property...Year.Built2006                                                       ** 
## Property...Year.Built2008                                                       ** 
## Property...Year.Built2014                                                       ** 
## Property...Year.Built2015                                                       *  
## Property...Year.Built2016                                                       ** 
## Transaction.TypeOriginal Lease:Customer.Industry3PL                                
## Transaction.TypeRenewal:Customer.Industry3PL                                       
## Transaction.TypeOriginal Lease:Customer.IndustryCharity/Prof.Services/Other     ** 
## Transaction.TypeRenewal:Customer.IndustryCharity/Prof.Services/Other               
## Transaction.TypeOriginal Lease:Customer.IndustryManufacturer                       
## Transaction.TypeRenewal:Customer.IndustryManufacturer                              
## Transaction.TypeOriginal Lease:Customer.IndustryRetailer                           
## Transaction.TypeRenewal:Customer.IndustryRetailer                                  
## Transaction.TypeOriginal Lease:Customer.IndustryTransportation/Freight/Delivery    
## Transaction.TypeRenewal:Customer.IndustryTransportation/Freight/Delivery           
## Transaction.TypeOriginal Lease:Customer.IndustryUnspecified                        
## Transaction.TypeRenewal:Customer.IndustryUnspecified                               
## Transaction.TypeOriginal Lease:Customer.IndustryWholesaler                         
## Transaction.TypeRenewal:Customer.IndustryWholesaler                                
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 0.3127 on 23 degrees of freedom
## Multiple R-squared:  0.9568, Adjusted R-squared:  0.8893 
## F-statistic: 14.16 on 36 and 23 DF,  p-value: 3.405e-09
plot(finalmodel$fitted.values , finalmodel$residuals)

### Check for heteroskedasticity :

library(lmtest)
## Loading required package: zoo
## 
## Attaching package: 'zoo'
## The following objects are masked from 'package:base':
## 
##     as.Date, as.Date.numeric
bptest(finalmodel)
## 
##  studentized Breusch-Pagan test
## 
## data:  finalmodel
## BP = 31.785, df = 36, p-value = 0.6693
#While it doesn’t give us the critical value to compare the test statistic, all you need to look at is the p-value to determine whether or not you should reject the null. If the p-value is less than the level of significance (in this case if the p-value is less than α=0.05), then you reject the null hypothesis. Since 0.01 < 0.05, we can reject the null hypothesis. There is heterskedasticity present. 
library(sandwich)

coeftest(finalmodel, vcov = vcovHC(finalmodel, "HC1"))
## 
## t test of coefficients:
## 
##                                                                                    Estimate
## (Intercept)                                                                      1.4233e+01
## Lease...Total.Term..Month.                                                      -5.4220e-03
## Property...Size..Sq..Ft..                                                        3.3323e-06
## Property...Speed.Bay                                                             1.6584e-02
## Property...Year.Built1984                                                       -1.6222e+00
## Property...Year.Built1985                                                       -1.4677e+00
## Property...Year.Built1986                                                       -1.5448e+00
## Property...Year.Built1987                                                       -2.3432e+00
## Property...Year.Built1988                                                       -1.8141e+00
## Property...Year.Built1989                                                       -2.1792e+00
## Property...Year.Built1990                                                       -1.5374e+00
## Property...Year.Built1995                                                       -1.4307e+00
## Property...Year.Built1996                                                       -1.6684e+00
## Property...Year.Built1997                                                       -1.5658e+00
## Property...Year.Built1998                                                       -1.5907e+00
## Property...Year.Built1999                                                       -1.4805e+00
## Property...Year.Built2000                                                       -1.6132e+00
## Property...Year.Built2001                                                       -1.6712e+00
## Property...Year.Built2002                                                       -1.2430e+00
## Property...Year.Built2003                                                       -1.5455e+00
## Property...Year.Built2005                                                       -1.6176e+00
## Property...Year.Built2006                                                       -1.6363e+00
## Property...Year.Built2008                                                       -1.8645e+00
## Property...Year.Built2014                                                       -1.6914e+00
## Property...Year.Built2015                                                       -1.4344e+00
## Property...Year.Built2016                                                       -1.9965e+00
## Transaction.TypeOriginal Lease:Customer.Industry3PL                              8.3047e-04
## Transaction.TypeRenewal:Customer.Industry3PL                                     3.2345e-02
## Transaction.TypeOriginal Lease:Customer.IndustryCharity/Prof.Services/Other     -1.2818e+00
## Transaction.TypeOriginal Lease:Customer.IndustryManufacturer                    -3.4357e-01
## Transaction.TypeRenewal:Customer.IndustryManufacturer                            6.4531e-02
## Transaction.TypeOriginal Lease:Customer.IndustryRetailer                        -2.3625e-01
## Transaction.TypeRenewal:Customer.IndustryRetailer                               -6.8693e-02
## Transaction.TypeOriginal Lease:Customer.IndustryTransportation/Freight/Delivery -1.7492e-01
## Transaction.TypeRenewal:Customer.IndustryTransportation/Freight/Delivery        -1.1536e-01
## Transaction.TypeOriginal Lease:Customer.IndustryUnspecified                     -5.2974e-02
## Transaction.TypeOriginal Lease:Customer.IndustryWholesaler                      -8.6856e-02
##                                                                                  Std. Error
## (Intercept)                                                                      6.4579e-01
## Lease...Total.Term..Month.                                                       3.3435e-03
## Property...Size..Sq..Ft..                                                        4.7572e-07
## Property...Speed.Bay                                                             1.1560e-02
## Property...Year.Built1984                                                        3.1783e-01
## Property...Year.Built1985                                                        2.8098e-01
## Property...Year.Built1986                                                        2.8985e-01
## Property...Year.Built1987                                                        5.4776e-01
## Property...Year.Built1988                                                        3.1860e-01
## Property...Year.Built1989                                                        3.5795e-01
## Property...Year.Built1990                                                        2.8439e-01
## Property...Year.Built1995                                                        3.2016e-01
## Property...Year.Built1996                                                        3.2288e-01
## Property...Year.Built1997                                                        3.3891e-01
## Property...Year.Built1998                                                        2.9107e-01
## Property...Year.Built1999                                                        3.4457e-01
## Property...Year.Built2000                                                        2.8661e-01
## Property...Year.Built2001                                                        2.1947e-01
## Property...Year.Built2002                                                        3.1861e-01
## Property...Year.Built2003                                                        3.2124e-01
## Property...Year.Built2005                                                        2.5182e-01
## Property...Year.Built2006                                                        2.9903e-01
## Property...Year.Built2008                                                        5.6501e-01
## Property...Year.Built2014                                                        1.5129e-01
## Property...Year.Built2015                                                        3.0777e-01
## Property...Year.Built2016                                                        3.2222e-01
## Transaction.TypeOriginal Lease:Customer.Industry3PL                              1.4420e-01
## Transaction.TypeRenewal:Customer.Industry3PL                                     3.2440e-01
## Transaction.TypeOriginal Lease:Customer.IndustryCharity/Prof.Services/Other      2.8870e-01
## Transaction.TypeOriginal Lease:Customer.IndustryManufacturer                     3.2127e-01
## Transaction.TypeRenewal:Customer.IndustryManufacturer                            4.8049e-01
## Transaction.TypeOriginal Lease:Customer.IndustryRetailer                         2.2015e-01
## Transaction.TypeRenewal:Customer.IndustryRetailer                                2.5531e-01
## Transaction.TypeOriginal Lease:Customer.IndustryTransportation/Freight/Delivery  4.0847e-01
## Transaction.TypeRenewal:Customer.IndustryTransportation/Freight/Delivery         3.7247e-01
## Transaction.TypeOriginal Lease:Customer.IndustryUnspecified                      2.3168e-01
## Transaction.TypeOriginal Lease:Customer.IndustryWholesaler                       1.3722e-01
##                                                                                  t value
## (Intercept)                                                                      22.0402
## Lease...Total.Term..Month.                                                       -1.6217
## Property...Size..Sq..Ft..                                                         7.0048
## Property...Speed.Bay                                                              1.4346
## Property...Year.Built1984                                                        -5.1041
## Property...Year.Built1985                                                        -5.2237
## Property...Year.Built1986                                                        -5.3296
## Property...Year.Built1987                                                        -4.2777
## Property...Year.Built1988                                                        -5.6939
## Property...Year.Built1989                                                        -6.0882
## Property...Year.Built1990                                                        -5.4059
## Property...Year.Built1995                                                        -4.4688
## Property...Year.Built1996                                                        -5.1672
## Property...Year.Built1997                                                        -4.6200
## Property...Year.Built1998                                                        -5.4649
## Property...Year.Built1999                                                        -4.2968
## Property...Year.Built2000                                                        -5.6284
## Property...Year.Built2001                                                        -7.6146
## Property...Year.Built2002                                                        -3.9014
## Property...Year.Built2003                                                        -4.8111
## Property...Year.Built2005                                                        -6.4236
## Property...Year.Built2006                                                        -5.4722
## Property...Year.Built2008                                                        -3.2999
## Property...Year.Built2014                                                       -11.1799
## Property...Year.Built2015                                                        -4.6606
## Property...Year.Built2016                                                        -6.1961
## Transaction.TypeOriginal Lease:Customer.Industry3PL                               0.0058
## Transaction.TypeRenewal:Customer.Industry3PL                                      0.0997
## Transaction.TypeOriginal Lease:Customer.IndustryCharity/Prof.Services/Other      -4.4400
## Transaction.TypeOriginal Lease:Customer.IndustryManufacturer                     -1.0694
## Transaction.TypeRenewal:Customer.IndustryManufacturer                             0.1343
## Transaction.TypeOriginal Lease:Customer.IndustryRetailer                         -1.0731
## Transaction.TypeRenewal:Customer.IndustryRetailer                                -0.2691
## Transaction.TypeOriginal Lease:Customer.IndustryTransportation/Freight/Delivery  -0.4282
## Transaction.TypeRenewal:Customer.IndustryTransportation/Freight/Delivery         -0.3097
## Transaction.TypeOriginal Lease:Customer.IndustryUnspecified                      -0.2287
## Transaction.TypeOriginal Lease:Customer.IndustryWholesaler                       -0.6330
##                                                                                  Pr(>|t|)
## (Intercept)                                                                     < 2.2e-16
## Lease...Total.Term..Month.                                                      0.1185041
## Property...Size..Sq..Ft..                                                       3.871e-07
## Property...Speed.Bay                                                            0.1648580
## Property...Year.Built1984                                                       3.605e-05
## Property...Year.Built1985                                                       2.683e-05
## Property...Year.Built1986                                                       2.067e-05
## Property...Year.Built1987                                                       0.0002818
## Property...Year.Built1988                                                       8.489e-06
## Property...Year.Built1989                                                       3.286e-06
## Property...Year.Built1990                                                       1.714e-05
## Property...Year.Built1995                                                       0.0001750
## Property...Year.Built1996                                                       3.084e-05
## Property...Year.Built1997                                                       0.0001200
## Property...Year.Built1998                                                       1.483e-05
## Property...Year.Built1999                                                       0.0002687
## Property...Year.Built2000                                                       9.952e-06
## Property...Year.Built2001                                                       9.900e-08
## Property...Year.Built2002                                                       0.0007184
## Property...Year.Built2003                                                       7.456e-05
## Property...Year.Built2005                                                       1.485e-06
## Property...Year.Built2006                                                       1.457e-05
## Property...Year.Built2008                                                       0.0031308
## Property...Year.Built2014                                                       8.956e-11
## Property...Year.Built2015                                                       0.0001084
## Property...Year.Built2016                                                       2.541e-06
## Transaction.TypeOriginal Lease:Customer.Industry3PL                             0.9954544
## Transaction.TypeRenewal:Customer.Industry3PL                                    0.9214413
## Transaction.TypeOriginal Lease:Customer.IndustryCharity/Prof.Services/Other     0.0001880
## Transaction.TypeOriginal Lease:Customer.IndustryManufacturer                    0.2959753
## Transaction.TypeRenewal:Customer.IndustryManufacturer                           0.8943318
## Transaction.TypeOriginal Lease:Customer.IndustryRetailer                        0.2943448
## Transaction.TypeRenewal:Customer.IndustryRetailer                               0.7902853
## Transaction.TypeOriginal Lease:Customer.IndustryTransportation/Freight/Delivery 0.6724629
## Transaction.TypeRenewal:Customer.IndustryTransportation/Freight/Delivery        0.7595722
## Transaction.TypeOriginal Lease:Customer.IndustryUnspecified                     0.8211608
## Transaction.TypeOriginal Lease:Customer.IndustryWholesaler                      0.5330073
##                                                                                    
## (Intercept)                                                                     ***
## Lease...Total.Term..Month.                                                         
## Property...Size..Sq..Ft..                                                       ***
## Property...Speed.Bay                                                               
## Property...Year.Built1984                                                       ***
## Property...Year.Built1985                                                       ***
## Property...Year.Built1986                                                       ***
## Property...Year.Built1987                                                       ***
## Property...Year.Built1988                                                       ***
## Property...Year.Built1989                                                       ***
## Property...Year.Built1990                                                       ***
## Property...Year.Built1995                                                       ***
## Property...Year.Built1996                                                       ***
## Property...Year.Built1997                                                       ***
## Property...Year.Built1998                                                       ***
## Property...Year.Built1999                                                       ***
## Property...Year.Built2000                                                       ***
## Property...Year.Built2001                                                       ***
## Property...Year.Built2002                                                       ***
## Property...Year.Built2003                                                       ***
## Property...Year.Built2005                                                       ***
## Property...Year.Built2006                                                       ***
## Property...Year.Built2008                                                       ** 
## Property...Year.Built2014                                                       ***
## Property...Year.Built2015                                                       ***
## Property...Year.Built2016                                                       ***
## Transaction.TypeOriginal Lease:Customer.Industry3PL                                
## Transaction.TypeRenewal:Customer.Industry3PL                                       
## Transaction.TypeOriginal Lease:Customer.IndustryCharity/Prof.Services/Other     ***
## Transaction.TypeOriginal Lease:Customer.IndustryManufacturer                       
## Transaction.TypeRenewal:Customer.IndustryManufacturer                              
## Transaction.TypeOriginal Lease:Customer.IndustryRetailer                           
## Transaction.TypeRenewal:Customer.IndustryRetailer                                  
## Transaction.TypeOriginal Lease:Customer.IndustryTransportation/Freight/Delivery    
## Transaction.TypeRenewal:Customer.IndustryTransportation/Freight/Delivery           
## Transaction.TypeOriginal Lease:Customer.IndustryUnspecified                        
## Transaction.TypeOriginal Lease:Customer.IndustryWholesaler                         
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

Cross Validation:

library(caret)
plot(finalmodel)
anova(fullmodel, finalmodel)
predictions = finalmodel %>% predict(testing_set, interval = "prediction")
RMSE(predictions, testing_set$log_totalrent)
22.39863/mean(testing_set$log_totalrent)
R2(predictions, testing_set$log_totalrent)

mydata <- cbind(testing_set, predictions)
p <- ggplot(mydata, aes( (Property...Size..Sq..Ft../10000), (log_totalrent))) +
geom_point() +
 stat_smooth(method = lm)
p + geom_line(aes(y = (lwr)), color = "red", linetype = "dashed")+
  geom_line(aes(y = (upr)), color = "red", linetype = "dashed")

From the output above, the R2 is 0.84, meaning that the observed and the predicted outcome values are highly correlated, which is good. The prediction error RMSE is 22.29, representing an error rate of 1.58% which is good.

Clearly we can observe that it violating the assumptions of normality in the predicted dataset and the MLR is not an ideal regression model for this.

ggplot(prologis_data, aes(x = prologis_data$Property...Size..Sq..Ft.., y = prologis_data$log_totalrent)) +
  geom_point() +
  stat_smooth()
## Warning: Use of `prologis_data$Property...Size..Sq..Ft..` is discouraged. Use
## `Property...Size..Sq..Ft..` instead.
## Warning: Use of `prologis_data$log_totalrent` is discouraged. Use
## `log_totalrent` instead.
## Warning: Use of `prologis_data$Property...Size..Sq..Ft..` is discouraged. Use
## `Property...Size..Sq..Ft..` instead.
## Warning: Use of `prologis_data$log_totalrent` is discouraged. Use
## `log_totalrent` instead.
## `geom_smooth()` using method = 'loess' and formula 'y ~ x'

Polynomial Model

We can see that there needs to be polyomial terms added to the dataset from the graph above.

Once you have detected a non-linear relationship in your data, the polynomial terms may not be flexible enough to capture the relationship, and spline terms require specifying the knots.

Generalized additive models, or GAM, are a technique to automatically fit a spline regression. This can be done using the mgcv R package:

library(mgcv)
## Loading required package: nlme
## 
## Attaching package: 'nlme'
## The following object is masked from 'package:dplyr':
## 
##     collapse
## This is mgcv 1.8-35. For overview type 'help("mgcv-package")'.
library(itsadug)
## Warning: package 'itsadug' was built under R version 4.1.2
## Loading required package: plotfunctions
## Warning: package 'plotfunctions' was built under R version 4.1.2
## 
## Attaching package: 'plotfunctions'
## The following object is masked from 'package:ggplot2':
## 
##     alpha
## Loaded package itsadug 2.4 (see 'help("itsadug")' ).
model <- bam(log_totalrent ~ s(Lease...Total.Term..Month.)   + s(Property...Size..Sq..Ft..) + s(Property...Speed.Bay)  + (Transaction.Type:Customer.Industry)+ Property...Year.Built , data = training_set, discrete=TRUE)

summary(model)
## 
## Family: gaussian 
## Link function: identity 
## 
## Formula:
## log_totalrent ~ s(Lease...Total.Term..Month.) + s(Property...Size..Sq..Ft..) + 
##     s(Property...Speed.Bay) + (Transaction.Type:Customer.Industry) + 
##     Property...Year.Built
## 
## Parametric coefficients:
##                                                                                 Estimate
## (Intercept)                                                                       0.0000
## Property...Year.Built1984                                                        -0.6370
## Property...Year.Built1985                                                        -0.5624
## Property...Year.Built1986                                                        -0.4729
## Property...Year.Built1987                                                        -0.5210
## Property...Year.Built1988                                                        -0.5124
## Property...Year.Built1989                                                        -0.3716
## Property...Year.Built1990                                                        -0.4843
## Property...Year.Built1995                                                        -0.4709
## Property...Year.Built1996                                                        -0.2281
## Property...Year.Built1997                                                        -0.4314
## Property...Year.Built1998                                                        -0.4080
## Property...Year.Built1999                                                        -0.3677
## Property...Year.Built2000                                                        -0.3638
## Property...Year.Built2001                                                        -0.4140
## Property...Year.Built2002                                                        -0.4028
## Property...Year.Built2003                                                        -0.3011
## Property...Year.Built2005                                                        -0.3828
## Property...Year.Built2006                                                        -0.5052
## Property...Year.Built2008                                                        -0.2312
## Property...Year.Built2014                                                        -0.3017
## Property...Year.Built2015                                                        -0.4091
## Property...Year.Built2016                                                        -0.3843
## Transaction.TypeOriginal Lease:Customer.Industry3PL                              14.3470
## Transaction.TypeRenewal:Customer.Industry3PL                                     14.2914
## Transaction.TypeOriginal Lease:Customer.IndustryCharity/Prof.Services/Other      13.7774
## Transaction.TypeRenewal:Customer.IndustryCharity/Prof.Services/Other              0.0000
## Transaction.TypeOriginal Lease:Customer.IndustryManufacturer                     14.2818
## Transaction.TypeRenewal:Customer.IndustryManufacturer                            14.2124
## Transaction.TypeOriginal Lease:Customer.IndustryRetailer                         14.3336
## Transaction.TypeRenewal:Customer.IndustryRetailer                                14.2901
## Transaction.TypeOriginal Lease:Customer.IndustryTransportation/Freight/Delivery  14.2889
## Transaction.TypeRenewal:Customer.IndustryTransportation/Freight/Delivery         14.1775
## Transaction.TypeOriginal Lease:Customer.IndustryUnspecified                      14.3604
## Transaction.TypeRenewal:Customer.IndustryUnspecified                              0.0000
## Transaction.TypeOriginal Lease:Customer.IndustryWholesaler                       14.3839
## Transaction.TypeRenewal:Customer.IndustryWholesaler                              14.3000
##                                                                                 Std. Error
## (Intercept)                                                                         0.0000
## Property...Year.Built1984                                                           0.1980
## Property...Year.Built1985                                                           0.2110
## Property...Year.Built1986                                                           0.2050
## Property...Year.Built1987                                                           0.2124
## Property...Year.Built1988                                                           0.1832
## Property...Year.Built1989                                                           0.2112
## Property...Year.Built1990                                                           0.1819
## Property...Year.Built1995                                                           0.2160
## Property...Year.Built1996                                                           0.2357
## Property...Year.Built1997                                                           0.2124
## Property...Year.Built1998                                                           0.2297
## Property...Year.Built1999                                                           0.2266
## Property...Year.Built2000                                                           0.2068
## Property...Year.Built2001                                                           0.1929
## Property...Year.Built2002                                                           0.1803
## Property...Year.Built2003                                                           0.2009
## Property...Year.Built2005                                                           0.2113
## Property...Year.Built2006                                                           0.1949
## Property...Year.Built2008                                                           0.2592
## Property...Year.Built2014                                                           0.2426
## Property...Year.Built2015                                                           0.2071
## Property...Year.Built2016                                                           0.5276
## Transaction.TypeOriginal Lease:Customer.Industry3PL                                 0.1954
## Transaction.TypeRenewal:Customer.Industry3PL                                        0.1992
## Transaction.TypeOriginal Lease:Customer.IndustryCharity/Prof.Services/Other         0.1114
## Transaction.TypeRenewal:Customer.IndustryCharity/Prof.Services/Other                0.0000
## Transaction.TypeOriginal Lease:Customer.IndustryManufacturer                        0.1955
## Transaction.TypeRenewal:Customer.IndustryManufacturer                               0.2166
## Transaction.TypeOriginal Lease:Customer.IndustryRetailer                            0.2452
## Transaction.TypeRenewal:Customer.IndustryRetailer                                   0.2106
## Transaction.TypeOriginal Lease:Customer.IndustryTransportation/Freight/Delivery     0.2404
## Transaction.TypeRenewal:Customer.IndustryTransportation/Freight/Delivery            0.2356
## Transaction.TypeOriginal Lease:Customer.IndustryUnspecified                         0.1771
## Transaction.TypeRenewal:Customer.IndustryUnspecified                                0.0000
## Transaction.TypeOriginal Lease:Customer.IndustryWholesaler                          0.2047
## Transaction.TypeRenewal:Customer.IndustryWholesaler                                 0.1908
##                                                                                 t value
## (Intercept)                                                                         NaN
## Property...Year.Built1984                                                        -3.218
## Property...Year.Built1985                                                        -2.666
## Property...Year.Built1986                                                        -2.307
## Property...Year.Built1987                                                        -2.453
## Property...Year.Built1988                                                        -2.797
## Property...Year.Built1989                                                        -1.759
## Property...Year.Built1990                                                        -2.662
## Property...Year.Built1995                                                        -2.180
## Property...Year.Built1996                                                        -0.968
## Property...Year.Built1997                                                        -2.031
## Property...Year.Built1998                                                        -1.776
## Property...Year.Built1999                                                        -1.623
## Property...Year.Built2000                                                        -1.759
## Property...Year.Built2001                                                        -2.146
## Property...Year.Built2002                                                        -2.234
## Property...Year.Built2003                                                        -1.499
## Property...Year.Built2005                                                        -1.812
## Property...Year.Built2006                                                        -2.592
## Property...Year.Built2008                                                        -0.892
## Property...Year.Built2014                                                        -1.244
## Property...Year.Built2015                                                        -1.976
## Property...Year.Built2016                                                        -0.728
## Transaction.TypeOriginal Lease:Customer.Industry3PL                              73.419
## Transaction.TypeRenewal:Customer.Industry3PL                                     71.760
## Transaction.TypeOriginal Lease:Customer.IndustryCharity/Prof.Services/Other     123.656
## Transaction.TypeRenewal:Customer.IndustryCharity/Prof.Services/Other                NaN
## Transaction.TypeOriginal Lease:Customer.IndustryManufacturer                     73.071
## Transaction.TypeRenewal:Customer.IndustryManufacturer                            65.629
## Transaction.TypeOriginal Lease:Customer.IndustryRetailer                         58.452
## Transaction.TypeRenewal:Customer.IndustryRetailer                                67.847
## Transaction.TypeOriginal Lease:Customer.IndustryTransportation/Freight/Delivery  59.450
## Transaction.TypeRenewal:Customer.IndustryTransportation/Freight/Delivery         60.172
## Transaction.TypeOriginal Lease:Customer.IndustryUnspecified                      81.084
## Transaction.TypeRenewal:Customer.IndustryUnspecified                                NaN
## Transaction.TypeOriginal Lease:Customer.IndustryWholesaler                       70.284
## Transaction.TypeRenewal:Customer.IndustryWholesaler                              74.963
##                                                                                 Pr(>|t|)
## (Intercept)                                                                          NaN
## Property...Year.Built1984                                                        0.00522
## Property...Year.Built1985                                                        0.01663
## Property...Year.Built1986                                                        0.03437
## Property...Year.Built1987                                                        0.02566
## Property...Year.Built1988                                                        0.01267
## Property...Year.Built1989                                                        0.09711
## Property...Year.Built1990                                                        0.01676
## Property...Year.Built1995                                                        0.04413
## Property...Year.Built1996                                                        0.34726
## Property...Year.Built1997                                                        0.05876
## Property...Year.Built1998                                                        0.09419
## Property...Year.Built1999                                                        0.12368
## Property...Year.Built2000                                                        0.09715
## Property...Year.Built2001                                                        0.04713
## Property...Year.Built2002                                                        0.03966
## Property...Year.Built2003                                                        0.15290
## Property...Year.Built2005                                                        0.08828
## Property...Year.Built2006                                                        0.01933
## Property...Year.Built2008                                                        0.38514
## Property...Year.Built2014                                                        0.23098
## Property...Year.Built2015                                                        0.06522
## Property...Year.Built2016                                                        0.47666
## Transaction.TypeOriginal Lease:Customer.Industry3PL                              < 2e-16
## Transaction.TypeRenewal:Customer.Industry3PL                                     < 2e-16
## Transaction.TypeOriginal Lease:Customer.IndustryCharity/Prof.Services/Other      < 2e-16
## Transaction.TypeRenewal:Customer.IndustryCharity/Prof.Services/Other                 NaN
## Transaction.TypeOriginal Lease:Customer.IndustryManufacturer                     < 2e-16
## Transaction.TypeRenewal:Customer.IndustryManufacturer                            < 2e-16
## Transaction.TypeOriginal Lease:Customer.IndustryRetailer                         < 2e-16
## Transaction.TypeRenewal:Customer.IndustryRetailer                                < 2e-16
## Transaction.TypeOriginal Lease:Customer.IndustryTransportation/Freight/Delivery  < 2e-16
## Transaction.TypeRenewal:Customer.IndustryTransportation/Freight/Delivery         < 2e-16
## Transaction.TypeOriginal Lease:Customer.IndustryUnspecified                      < 2e-16
## Transaction.TypeRenewal:Customer.IndustryUnspecified                                 NaN
## Transaction.TypeOriginal Lease:Customer.IndustryWholesaler                       < 2e-16
## Transaction.TypeRenewal:Customer.IndustryWholesaler                              < 2e-16
##                                                                                    
## (Intercept)                                                                        
## Property...Year.Built1984                                                       ** 
## Property...Year.Built1985                                                       *  
## Property...Year.Built1986                                                       *  
## Property...Year.Built1987                                                       *  
## Property...Year.Built1988                                                       *  
## Property...Year.Built1989                                                       .  
## Property...Year.Built1990                                                       *  
## Property...Year.Built1995                                                       *  
## Property...Year.Built1996                                                          
## Property...Year.Built1997                                                       .  
## Property...Year.Built1998                                                       .  
## Property...Year.Built1999                                                          
## Property...Year.Built2000                                                       .  
## Property...Year.Built2001                                                       *  
## Property...Year.Built2002                                                       *  
## Property...Year.Built2003                                                          
## Property...Year.Built2005                                                       .  
## Property...Year.Built2006                                                       *  
## Property...Year.Built2008                                                          
## Property...Year.Built2014                                                          
## Property...Year.Built2015                                                       .  
## Property...Year.Built2016                                                          
## Transaction.TypeOriginal Lease:Customer.Industry3PL                             ***
## Transaction.TypeRenewal:Customer.Industry3PL                                    ***
## Transaction.TypeOriginal Lease:Customer.IndustryCharity/Prof.Services/Other     ***
## Transaction.TypeRenewal:Customer.IndustryCharity/Prof.Services/Other               
## Transaction.TypeOriginal Lease:Customer.IndustryManufacturer                    ***
## Transaction.TypeRenewal:Customer.IndustryManufacturer                           ***
## Transaction.TypeOriginal Lease:Customer.IndustryRetailer                        ***
## Transaction.TypeRenewal:Customer.IndustryRetailer                               ***
## Transaction.TypeOriginal Lease:Customer.IndustryTransportation/Freight/Delivery ***
## Transaction.TypeRenewal:Customer.IndustryTransportation/Freight/Delivery        ***
## Transaction.TypeOriginal Lease:Customer.IndustryUnspecified                     ***
## Transaction.TypeRenewal:Customer.IndustryUnspecified                               
## Transaction.TypeOriginal Lease:Customer.IndustryWholesaler                      ***
## Transaction.TypeRenewal:Customer.IndustryWholesaler                             ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Approximate significance of smooth terms:
##                                 edf Ref.df      F p-value    
## s(Lease...Total.Term..Month.) 1.000  1.000  0.406   0.533    
## s(Property...Size..Sq..Ft..)  7.207  7.795 98.676  <2e-16 ***
## s(Property...Speed.Bay)       1.343  1.585  0.385   0.557    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Rank: 61/64
## R-sq.(adj) =  0.993   Deviance explained = 99.8%
## fREML = 5.3422  Scale est. = 0.0079524  n = 60
plot(model, all.terms=TRUE, rug=FALSE)

#predictions <- model %>% predict(testing_set)
#data.frame(
 #RMSE = RMSE(predictions, testing_set$log_totalrent),
 #R2 = R2(predictions, testing_set$log_totalrent)
#)
plot_parametric(model, pred=list(Transaction.Type=c('Renewal', 'Original Lease')))
## Summary:
##  * Property...Year.Built : factor; set to the value(s): 1988. 
##  * Transaction.Type : factor; set to the value(s): Original Lease, Renewal. 
##  * Customer.Industry : factor; set to the value(s): Wholesaler. 
##  * Lease...Total.Term..Month. : numeric predictor; set to the value(s): 61. 
##  * Property...Size..Sq..Ft.. : numeric predictor; set to the value(s): 186300. 
##  * Property...Speed.Bay : numeric predictor; set to the value(s): 58. 
##  * NOTE : No random effects in the model to cancel.
## 

plot_parametric(model, pred=list(Customer.Industry=c('3PL', 'Charity/Prof.Services/Other', 'Transportation/Freight/Delivery' , 'Retailer', 'Unspecified', 'Wholesaler' )))
## Summary:
##  * Property...Year.Built : factor; set to the value(s): 1988. 
##  * Transaction.Type : factor; set to the value(s): Original Lease. 
##  * Customer.Industry : factor; set to the value(s): 3PL, Charity/Prof.Services/Other, Retailer, Transportation/Freight/Delivery, Unspecified, Wholesaler. 
##  * Lease...Total.Term..Month. : numeric predictor; set to the value(s): 61. 
##  * Property...Size..Sq..Ft.. : numeric predictor; set to the value(s): 186300. 
##  * Property...Speed.Bay : numeric predictor; set to the value(s): 58. 
##  * NOTE : No random effects in the model to cancel.
## 

#plot_data(model, view="Property...Year.Built", split_by="Transaction.Type", cex=.5)

## Finally we check the relative importance of our model:

#predictions = model %>% predict(testing_set, interval = "prediction")
#RMSE(predictions, testing_set$log_totalrent)
#5.425138/mean(testing_set$log_totalrent)
#R2(predictions, testing_set$log_totalrent)



coeftest(model, vcov = vcovHC(model, "HC1"))
## Warning in model.matrix.default(fm, data, contrasts.arg): variable
## 'Transaction.Type' is absent, its contrast will be ignored
## Warning in model.matrix.default(fm, data, contrasts.arg): variable
## 'Customer.Industry' is absent, its contrast will be ignored
## Warning in model.matrix.default(fm, data, contrasts.arg): variable
## 'Property...Year.Built' is absent, its contrast will be ignored
## Warning in model.matrix.default(fm, data, contrasts.arg): variable
## 'Transaction.Type' is absent, its contrast will be ignored
## Warning in model.matrix.default(fm, data, contrasts.arg): variable
## 'Property...Year.Built' is absent, its contrast will be ignored
## Warning in model.matrix.default(fm, data, contrasts.arg): variable
## 'Customer.Industry' is absent, its contrast will be ignored
## Warning in model.matrix.default(fm, data, contrasts.arg): variable
## 'Transaction.Type' is absent, its contrast will be ignored
## Warning in model.matrix.default(fm, data, contrasts.arg): variable
## 'Customer.Industry' is absent, its contrast will be ignored
## Warning in model.matrix.default(fm, data, contrasts.arg): variable
## 'Property...Year.Built' is absent, its contrast will be ignored
## Warning in model.matrix.default(fm, data, contrasts.arg): variable
## 'Transaction.Type' is absent, its contrast will be ignored
## Warning in model.matrix.default(fm, data, contrasts.arg): variable
## 'Property...Year.Built' is absent, its contrast will be ignored
## Warning in model.matrix.default(fm, data, contrasts.arg): variable
## 'Customer.Industry' is absent, its contrast will be ignored
## Warning in sqrt(omega): NaNs produced
## Warning in model.matrix.default(fm, data, contrasts.arg): variable
## 'Transaction.Type' is absent, its contrast will be ignored
## Warning in model.matrix.default(fm, data, contrasts.arg): variable
## 'Customer.Industry' is absent, its contrast will be ignored
## Warning in model.matrix.default(fm, data, contrasts.arg): variable
## 'Property...Year.Built' is absent, its contrast will be ignored
## Warning in model.matrix.default(fm, data, contrasts.arg): variable
## 'Transaction.Type' is absent, its contrast will be ignored
## Warning in model.matrix.default(fm, data, contrasts.arg): variable
## 'Property...Year.Built' is absent, its contrast will be ignored
## Warning in model.matrix.default(fm, data, contrasts.arg): variable
## 'Customer.Industry' is absent, its contrast will be ignored
## 
## z test of coefficients:
## 
##                                                                                    Estimate
## (Intercept)                                                                      0.0000e+00
## Property...Year.Built1984                                                       -6.3698e-01
## Property...Year.Built1985                                                       -5.6241e-01
## Property...Year.Built1986                                                       -4.7286e-01
## Property...Year.Built1987                                                       -5.2098e-01
## Property...Year.Built1988                                                       -5.1244e-01
## Property...Year.Built1989                                                       -3.7163e-01
## Property...Year.Built1990                                                       -4.8434e-01
## Property...Year.Built1995                                                       -4.7092e-01
## Property...Year.Built1996                                                       -2.2806e-01
## Property...Year.Built1997                                                       -4.3137e-01
## Property...Year.Built1998                                                       -4.0800e-01
## Property...Year.Built1999                                                       -3.6769e-01
## Property...Year.Built2000                                                       -3.6376e-01
## Property...Year.Built2001                                                       -4.1402e-01
## Property...Year.Built2002                                                       -4.0282e-01
## Property...Year.Built2003                                                       -3.0110e-01
## Property...Year.Built2005                                                       -3.8283e-01
## Property...Year.Built2006                                                       -5.0522e-01
## Property...Year.Built2008                                                       -2.3124e-01
## Property...Year.Built2014                                                       -3.0171e-01
## Property...Year.Built2015                                                       -4.0911e-01
## Property...Year.Built2016                                                       -3.8429e-01
## Transaction.TypeOriginal Lease:Customer.Industry3PL                              1.4347e+01
## Transaction.TypeRenewal:Customer.Industry3PL                                     1.4291e+01
## Transaction.TypeOriginal Lease:Customer.IndustryCharity/Prof.Services/Other      1.3777e+01
## Transaction.TypeRenewal:Customer.IndustryCharity/Prof.Services/Other             0.0000e+00
## Transaction.TypeOriginal Lease:Customer.IndustryManufacturer                     1.4282e+01
## Transaction.TypeRenewal:Customer.IndustryManufacturer                            1.4212e+01
## Transaction.TypeOriginal Lease:Customer.IndustryRetailer                         1.4334e+01
## Transaction.TypeRenewal:Customer.IndustryRetailer                                1.4290e+01
## Transaction.TypeOriginal Lease:Customer.IndustryTransportation/Freight/Delivery  1.4289e+01
## Transaction.TypeRenewal:Customer.IndustryTransportation/Freight/Delivery         1.4178e+01
## Transaction.TypeOriginal Lease:Customer.IndustryUnspecified                      1.4360e+01
## Transaction.TypeRenewal:Customer.IndustryUnspecified                             0.0000e+00
## Transaction.TypeOriginal Lease:Customer.IndustryWholesaler                       1.4384e+01
## Transaction.TypeRenewal:Customer.IndustryWholesaler                              1.4300e+01
## s(Lease...Total.Term..Month.).1                                                  3.1265e-08
## s(Lease...Total.Term..Month.).2                                                 -2.7646e-08
## s(Lease...Total.Term..Month.).3                                                 -1.7344e-08
## s(Lease...Total.Term..Month.).4                                                 -1.8344e-08
## s(Lease...Total.Term..Month.).5                                                 -1.4584e-08
## s(Lease...Total.Term..Month.).6                                                  1.6960e-08
## s(Lease...Total.Term..Month.).7                                                 -1.0242e-08
## s(Lease...Total.Term..Month.).8                                                  1.1175e-07
## s(Lease...Total.Term..Month.).9                                                  2.7576e-02
## s(Property...Size..Sq..Ft..).1                                                  -1.4301e+00
## s(Property...Size..Sq..Ft..).2                                                  -3.2084e+00
## s(Property...Size..Sq..Ft..).3                                                  -9.7465e-01
## s(Property...Size..Sq..Ft..).4                                                  -1.8902e+00
## s(Property...Size..Sq..Ft..).5                                                  -1.4539e+00
## s(Property...Size..Sq..Ft..).6                                                   1.3591e+00
## s(Property...Size..Sq..Ft..).7                                                  -1.0584e+00
## s(Property...Size..Sq..Ft..).8                                                   3.8868e+00
## s(Property...Size..Sq..Ft..).9                                                   2.8781e+00
## s(Property...Speed.Bay).1                                                        1.0377e-02
## s(Property...Speed.Bay).2                                                        6.3200e-03
## s(Property...Speed.Bay).3                                                        6.5931e-03
## s(Property...Speed.Bay).4                                                       -6.9459e-03
## s(Property...Speed.Bay).5                                                        2.0085e-03
## s(Property...Speed.Bay).6                                                        9.0063e-03
## s(Property...Speed.Bay).7                                                        6.9554e-03
## s(Property...Speed.Bay).8                                                        4.0825e-02
## s(Property...Speed.Bay).9                                                       -3.6304e-02
##                                                                                 Std. Error
## (Intercept)                                                                            NaN
## Property...Year.Built1984                                                              NaN
## Property...Year.Built1985                                                              NaN
## Property...Year.Built1986                                                              NaN
## Property...Year.Built1987                                                              NaN
## Property...Year.Built1988                                                              NaN
## Property...Year.Built1989                                                              NaN
## Property...Year.Built1990                                                              NaN
## Property...Year.Built1995                                                              NaN
## Property...Year.Built1996                                                              NaN
## Property...Year.Built1997                                                              NaN
## Property...Year.Built1998                                                              NaN
## Property...Year.Built1999                                                              NaN
## Property...Year.Built2000                                                              NaN
## Property...Year.Built2001                                                              NaN
## Property...Year.Built2002                                                              NaN
## Property...Year.Built2003                                                              NaN
## Property...Year.Built2005                                                              NaN
## Property...Year.Built2006                                                              NaN
## Property...Year.Built2008                                                              NaN
## Property...Year.Built2014                                                              NaN
## Property...Year.Built2015                                                              NaN
## Property...Year.Built2016                                                              NaN
## Transaction.TypeOriginal Lease:Customer.Industry3PL                                    NaN
## Transaction.TypeRenewal:Customer.Industry3PL                                           NaN
## Transaction.TypeOriginal Lease:Customer.IndustryCharity/Prof.Services/Other            NaN
## Transaction.TypeRenewal:Customer.IndustryCharity/Prof.Services/Other                   NaN
## Transaction.TypeOriginal Lease:Customer.IndustryManufacturer                           NaN
## Transaction.TypeRenewal:Customer.IndustryManufacturer                                  NaN
## Transaction.TypeOriginal Lease:Customer.IndustryRetailer                               NaN
## Transaction.TypeRenewal:Customer.IndustryRetailer                                      NaN
## Transaction.TypeOriginal Lease:Customer.IndustryTransportation/Freight/Delivery        NaN
## Transaction.TypeRenewal:Customer.IndustryTransportation/Freight/Delivery               NaN
## Transaction.TypeOriginal Lease:Customer.IndustryUnspecified                            NaN
## Transaction.TypeRenewal:Customer.IndustryUnspecified                                   NaN
## Transaction.TypeOriginal Lease:Customer.IndustryWholesaler                             NaN
## Transaction.TypeRenewal:Customer.IndustryWholesaler                                    NaN
## s(Lease...Total.Term..Month.).1                                                        NaN
## s(Lease...Total.Term..Month.).2                                                        NaN
## s(Lease...Total.Term..Month.).3                                                        NaN
## s(Lease...Total.Term..Month.).4                                                        NaN
## s(Lease...Total.Term..Month.).5                                                        NaN
## s(Lease...Total.Term..Month.).6                                                        NaN
## s(Lease...Total.Term..Month.).7                                                        NaN
## s(Lease...Total.Term..Month.).8                                                        NaN
## s(Lease...Total.Term..Month.).9                                                        NaN
## s(Property...Size..Sq..Ft..).1                                                         NaN
## s(Property...Size..Sq..Ft..).2                                                         NaN
## s(Property...Size..Sq..Ft..).3                                                         NaN
## s(Property...Size..Sq..Ft..).4                                                         NaN
## s(Property...Size..Sq..Ft..).5                                                         NaN
## s(Property...Size..Sq..Ft..).6                                                         NaN
## s(Property...Size..Sq..Ft..).7                                                         NaN
## s(Property...Size..Sq..Ft..).8                                                         NaN
## s(Property...Size..Sq..Ft..).9                                                         NaN
## s(Property...Speed.Bay).1                                                              NaN
## s(Property...Speed.Bay).2                                                              NaN
## s(Property...Speed.Bay).3                                                              NaN
## s(Property...Speed.Bay).4                                                              NaN
## s(Property...Speed.Bay).5                                                              NaN
## s(Property...Speed.Bay).6                                                              NaN
## s(Property...Speed.Bay).7                                                              NaN
## s(Property...Speed.Bay).8                                                              NaN
## s(Property...Speed.Bay).9                                                              NaN
##                                                                                 z value
## (Intercept)                                                                         NaN
## Property...Year.Built1984                                                           NaN
## Property...Year.Built1985                                                           NaN
## Property...Year.Built1986                                                           NaN
## Property...Year.Built1987                                                           NaN
## Property...Year.Built1988                                                           NaN
## Property...Year.Built1989                                                           NaN
## Property...Year.Built1990                                                           NaN
## Property...Year.Built1995                                                           NaN
## Property...Year.Built1996                                                           NaN
## Property...Year.Built1997                                                           NaN
## Property...Year.Built1998                                                           NaN
## Property...Year.Built1999                                                           NaN
## Property...Year.Built2000                                                           NaN
## Property...Year.Built2001                                                           NaN
## Property...Year.Built2002                                                           NaN
## Property...Year.Built2003                                                           NaN
## Property...Year.Built2005                                                           NaN
## Property...Year.Built2006                                                           NaN
## Property...Year.Built2008                                                           NaN
## Property...Year.Built2014                                                           NaN
## Property...Year.Built2015                                                           NaN
## Property...Year.Built2016                                                           NaN
## Transaction.TypeOriginal Lease:Customer.Industry3PL                                 NaN
## Transaction.TypeRenewal:Customer.Industry3PL                                        NaN
## Transaction.TypeOriginal Lease:Customer.IndustryCharity/Prof.Services/Other         NaN
## Transaction.TypeRenewal:Customer.IndustryCharity/Prof.Services/Other                NaN
## Transaction.TypeOriginal Lease:Customer.IndustryManufacturer                        NaN
## Transaction.TypeRenewal:Customer.IndustryManufacturer                               NaN
## Transaction.TypeOriginal Lease:Customer.IndustryRetailer                            NaN
## Transaction.TypeRenewal:Customer.IndustryRetailer                                   NaN
## Transaction.TypeOriginal Lease:Customer.IndustryTransportation/Freight/Delivery     NaN
## Transaction.TypeRenewal:Customer.IndustryTransportation/Freight/Delivery            NaN
## Transaction.TypeOriginal Lease:Customer.IndustryUnspecified                         NaN
## Transaction.TypeRenewal:Customer.IndustryUnspecified                                NaN
## Transaction.TypeOriginal Lease:Customer.IndustryWholesaler                          NaN
## Transaction.TypeRenewal:Customer.IndustryWholesaler                                 NaN
## s(Lease...Total.Term..Month.).1                                                     NaN
## s(Lease...Total.Term..Month.).2                                                     NaN
## s(Lease...Total.Term..Month.).3                                                     NaN
## s(Lease...Total.Term..Month.).4                                                     NaN
## s(Lease...Total.Term..Month.).5                                                     NaN
## s(Lease...Total.Term..Month.).6                                                     NaN
## s(Lease...Total.Term..Month.).7                                                     NaN
## s(Lease...Total.Term..Month.).8                                                     NaN
## s(Lease...Total.Term..Month.).9                                                     NaN
## s(Property...Size..Sq..Ft..).1                                                      NaN
## s(Property...Size..Sq..Ft..).2                                                      NaN
## s(Property...Size..Sq..Ft..).3                                                      NaN
## s(Property...Size..Sq..Ft..).4                                                      NaN
## s(Property...Size..Sq..Ft..).5                                                      NaN
## s(Property...Size..Sq..Ft..).6                                                      NaN
## s(Property...Size..Sq..Ft..).7                                                      NaN
## s(Property...Size..Sq..Ft..).8                                                      NaN
## s(Property...Size..Sq..Ft..).9                                                      NaN
## s(Property...Speed.Bay).1                                                           NaN
## s(Property...Speed.Bay).2                                                           NaN
## s(Property...Speed.Bay).3                                                           NaN
## s(Property...Speed.Bay).4                                                           NaN
## s(Property...Speed.Bay).5                                                           NaN
## s(Property...Speed.Bay).6                                                           NaN
## s(Property...Speed.Bay).7                                                           NaN
## s(Property...Speed.Bay).8                                                           NaN
## s(Property...Speed.Bay).9                                                           NaN
##                                                                                 Pr(>|z|)
## (Intercept)                                                                          NaN
## Property...Year.Built1984                                                            NaN
## Property...Year.Built1985                                                            NaN
## Property...Year.Built1986                                                            NaN
## Property...Year.Built1987                                                            NaN
## Property...Year.Built1988                                                            NaN
## Property...Year.Built1989                                                            NaN
## Property...Year.Built1990                                                            NaN
## Property...Year.Built1995                                                            NaN
## Property...Year.Built1996                                                            NaN
## Property...Year.Built1997                                                            NaN
## Property...Year.Built1998                                                            NaN
## Property...Year.Built1999                                                            NaN
## Property...Year.Built2000                                                            NaN
## Property...Year.Built2001                                                            NaN
## Property...Year.Built2002                                                            NaN
## Property...Year.Built2003                                                            NaN
## Property...Year.Built2005                                                            NaN
## Property...Year.Built2006                                                            NaN
## Property...Year.Built2008                                                            NaN
## Property...Year.Built2014                                                            NaN
## Property...Year.Built2015                                                            NaN
## Property...Year.Built2016                                                            NaN
## Transaction.TypeOriginal Lease:Customer.Industry3PL                                  NaN
## Transaction.TypeRenewal:Customer.Industry3PL                                         NaN
## Transaction.TypeOriginal Lease:Customer.IndustryCharity/Prof.Services/Other          NaN
## Transaction.TypeRenewal:Customer.IndustryCharity/Prof.Services/Other                 NaN
## Transaction.TypeOriginal Lease:Customer.IndustryManufacturer                         NaN
## Transaction.TypeRenewal:Customer.IndustryManufacturer                                NaN
## Transaction.TypeOriginal Lease:Customer.IndustryRetailer                             NaN
## Transaction.TypeRenewal:Customer.IndustryRetailer                                    NaN
## Transaction.TypeOriginal Lease:Customer.IndustryTransportation/Freight/Delivery      NaN
## Transaction.TypeRenewal:Customer.IndustryTransportation/Freight/Delivery             NaN
## Transaction.TypeOriginal Lease:Customer.IndustryUnspecified                          NaN
## Transaction.TypeRenewal:Customer.IndustryUnspecified                                 NaN
## Transaction.TypeOriginal Lease:Customer.IndustryWholesaler                           NaN
## Transaction.TypeRenewal:Customer.IndustryWholesaler                                  NaN
## s(Lease...Total.Term..Month.).1                                                      NaN
## s(Lease...Total.Term..Month.).2                                                      NaN
## s(Lease...Total.Term..Month.).3                                                      NaN
## s(Lease...Total.Term..Month.).4                                                      NaN
## s(Lease...Total.Term..Month.).5                                                      NaN
## s(Lease...Total.Term..Month.).6                                                      NaN
## s(Lease...Total.Term..Month.).7                                                      NaN
## s(Lease...Total.Term..Month.).8                                                      NaN
## s(Lease...Total.Term..Month.).9                                                      NaN
## s(Property...Size..Sq..Ft..).1                                                       NaN
## s(Property...Size..Sq..Ft..).2                                                       NaN
## s(Property...Size..Sq..Ft..).3                                                       NaN
## s(Property...Size..Sq..Ft..).4                                                       NaN
## s(Property...Size..Sq..Ft..).5                                                       NaN
## s(Property...Size..Sq..Ft..).6                                                       NaN
## s(Property...Size..Sq..Ft..).7                                                       NaN
## s(Property...Size..Sq..Ft..).8                                                       NaN
## s(Property...Size..Sq..Ft..).9                                                       NaN
## s(Property...Speed.Bay).1                                                            NaN
## s(Property...Speed.Bay).2                                                            NaN
## s(Property...Speed.Bay).3                                                            NaN
## s(Property...Speed.Bay).4                                                            NaN
## s(Property...Speed.Bay).5                                                            NaN
## s(Property...Speed.Bay).6                                                            NaN
## s(Property...Speed.Bay).7                                                            NaN
## s(Property...Speed.Bay).8                                                            NaN
## s(Property...Speed.Bay).9                                                            NaN

The prediction error RMSE is 5.425138, representing an error rate of 0.38% which is good.