The data set contain information for Rental price base on additional number of room in MSA levels, observation start in 2001 to 2005 with annual frequency observation, its also contain information like Unemployee Rate,Personal Income and Resident Population.
We also create dummy date that indicate, an observation happens in a specifict year, for example A has observation in 2002, so d.2002 will assign to 1.
We log response variables, and regress with other variables but in event study we will focus on time effect in this case is dummy time, treatment is for every msa that in LA is equal to 1, and non-LA is 0.
-NOTE : In this analysis, we Keep New Orlean MSA as treated MSA.
library(readxl)
library(ggplot2)
library(readr)
library(dplyr)
library(stringr)
library(plm)
library(lmtest)
RENT.merge<-read_xlsx("MSA-RENT merge All.xlsx")
RENT.merge$treat<-ifelse(RENT.merge$state=="LA",1,0)
colnames(RENT.merge)
## [1] "FirstNAME" "AREANAME" "RENT_0"
## [4] "RENT_1" "RENT_2" "RENT_3"
## [7] "RENT_4" "YEAR" "NAME.x"
## [10] "state" "Unemployee.Rate" "Personal.Income"
## [13] "Resident.Population" "nyear" "MSA"
## [16] "MSA.Code" "Price" "Change"
## [19] "NAME.y" "treat"
# Remove NA
RENT.merge<-RENT.merge%>%
group_by(MSA)%>%
filter(!any(is.na(Unemployee.Rate)))
dloop<-data.frame(YEAR=unique(RENT.merge$YEAR))
## YEAR DUMMY
for (i in 1:nrow(dloop)) {
RENT.merge[paste0("d.", dloop$YEAR[i])] <- as.numeric(RENT.merge$YEAR == unique(RENT.merge$YEAR)[i])
}
#KEEP NEW ORLEAN
RENT.merge1<-RENT.merge
RENT.merge1$NS<-paste0(RENT.merge1$FirstNAME,RENT.merge1$state)
RENT.NEWLA<-RENT.merge1%>%
filter(NS=="newLA")
RENTUS<-RENT.merge1%>%
filter(state!="LA")
RENT.merge1<-RENT.merge1%>%
filter(NS!="newLA")
## WITH NEW ORLEAN ONLY
RENT.merge2<-rbind(RENT.NEWLA,RENTUS)
mpl.00<-plm(log(RENT_0)~treat+Price+Unemployee.Rate+
Personal.Income+Resident.Population+treat:(d.2001+d.2002+d.2003+
d.2005+d.2006+d.2007+d.2008+
d.2009+d.2010+d.2011+d.2012+
d.2013+d.2014+d.2015),
data = RENT.merge2, model = "between",cluster="MSA", index=c("MSA", "YEAR"))
summary(mpl.00)
## Oneway (individual) effect Between Model
##
## Call:
## plm(formula = log(RENT_0) ~ treat + Price + Unemployee.Rate +
## Personal.Income + Resident.Population + treat:(d.2001 + d.2002 +
## d.2003 + d.2005 + d.2006 + d.2007 + d.2008 + d.2009 + d.2010 +
## d.2011 + d.2012 + d.2013 + d.2014 + d.2015), data = RENT.merge2,
## model = "between", index = c("MSA", "YEAR"), cluster = "MSA")
##
## Unbalanced Panel: n = 211, T = 13-15, N = 3133
## Observations used in estimation: 211
##
## Residuals:
## Min. 1st Qu. Median 3rd Qu. Max.
## -0.4320406 -0.0795429 -0.0029649 0.0677943 0.3512158
##
## Coefficients: (14 dropped because of singularities)
## Estimate Std. Error t-value Pr(>|t|)
## (Intercept) 5.1040e+00 8.9987e-02 56.7189 < 2.2e-16 ***
## treat 1.1662e-01 1.1681e-01 0.9984 0.3193
## Price 3.6316e-03 4.2228e-04 8.5998 2.067e-15 ***
## Unemployee.Rate 2.2772e-02 4.8209e-03 4.7237 4.294e-06 ***
## Personal.Income 1.0502e-05 1.8911e-06 5.5533 8.631e-08 ***
## Resident.Population 2.6279e-05 5.2085e-06 5.0454 9.951e-07 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Total Sum of Squares: 6.6362
## Residual Sum of Squares: 2.7698
## R-Squared: 0.58262
## Adj. R-Squared: 0.57244
## F-statistic: 57.2325 on 5 and 205 DF, p-value: < 2.22e-16
mpl.01<-plm(log(RENT_1)~treat+Price+Unemployee.Rate+
Personal.Income+Resident.Population+treat:(d.2001+d.2002+d.2003+
d.2005+d.2006+d.2007+d.2008+
d.2009+d.2010+d.2011+d.2012+
d.2013+d.2014+d.2015),
data = RENT.merge2, model = "between",cluster="MSA", index=c("MSA", "YEAR"))
summary(mpl.01)
## Oneway (individual) effect Between Model
##
## Call:
## plm(formula = log(RENT_1) ~ treat + Price + Unemployee.Rate +
## Personal.Income + Resident.Population + treat:(d.2001 + d.2002 +
## d.2003 + d.2005 + d.2006 + d.2007 + d.2008 + d.2009 + d.2010 +
## d.2011 + d.2012 + d.2013 + d.2014 + d.2015), data = RENT.merge2,
## model = "between", index = c("MSA", "YEAR"), cluster = "MSA")
##
## Unbalanced Panel: n = 211, T = 13-15, N = 3133
## Observations used in estimation: 211
##
## Residuals:
## Min. 1st Qu. Median 3rd Qu. Max.
## -4.8566e-01 -7.4449e-02 4.6534e-16 6.3256e-02 3.4672e-01
##
## Coefficients: (14 dropped because of singularities)
## Estimate Std. Error t-value Pr(>|t|)
## (Intercept) 5.1759e+00 8.5832e-02 60.3020 < 2.2e-16 ***
## treat 1.0352e-01 1.1141e-01 0.9292 0.3539
## Price 3.4198e-03 4.0279e-04 8.4903 4.160e-15 ***
## Unemployee.Rate 2.2288e-02 4.5983e-03 4.8470 2.472e-06 ***
## Personal.Income 1.3335e-05 1.8038e-06 7.3927 3.598e-12 ***
## Resident.Population 2.3323e-05 4.9680e-06 4.6946 4.883e-06 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Total Sum of Squares: 6.5914
## Residual Sum of Squares: 2.5199
## R-Squared: 0.6177
## Adj. R-Squared: 0.60837
## F-statistic: 66.2446 on 5 and 205 DF, p-value: < 2.22e-16
mpl.02<-plm(log(RENT_2)~treat+Price+Unemployee.Rate+
Personal.Income+Resident.Population+treat:(d.2001+d.2002+d.2003+
d.2005+d.2006+d.2007+d.2008+
d.2009+d.2010+d.2011+d.2012+
d.2013+d.2014+d.2015),
data = RENT.merge2, model = "between",cluster="MSA", index=c("MSA", "YEAR"))
summary(mpl.02)
## Oneway (individual) effect Between Model
##
## Call:
## plm(formula = log(RENT_2) ~ treat + Price + Unemployee.Rate +
## Personal.Income + Resident.Population + treat:(d.2001 + d.2002 +
## d.2003 + d.2005 + d.2006 + d.2007 + d.2008 + d.2009 + d.2010 +
## d.2011 + d.2012 + d.2013 + d.2014 + d.2015), data = RENT.merge2,
## model = "between", index = c("MSA", "YEAR"), cluster = "MSA")
##
## Unbalanced Panel: n = 211, T = 13-15, N = 3133
## Observations used in estimation: 211
##
## Residuals:
## Min. 1st Qu. Median 3rd Qu. Max.
## -0.4462407 -0.0675305 0.0027348 0.0672879 0.3209078
##
## Coefficients: (14 dropped because of singularities)
## Estimate Std. Error t-value Pr(>|t|)
## (Intercept) 5.4266e+00 7.9904e-02 67.9133 < 2.2e-16 ***
## treat 8.8724e-02 1.0372e-01 0.8554 0.3933143
## Price 3.0801e-03 3.7497e-04 8.2143 2.378e-14 ***
## Unemployee.Rate 2.1046e-02 4.2807e-03 4.9165 1.803e-06 ***
## Personal.Income 1.4078e-05 1.6792e-06 8.3834 8.197e-15 ***
## Resident.Population 1.8196e-05 4.6249e-06 3.9344 0.0001142 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Total Sum of Squares: 5.782
## Residual Sum of Squares: 2.1839
## R-Squared: 0.6223
## Adj. R-Squared: 0.61309
## F-statistic: 67.5513 on 5 and 205 DF, p-value: < 2.22e-16
mpl.03<-plm(log(RENT_3)~treat+Price+Unemployee.Rate+
Personal.Income+Resident.Population+treat:(d.2001+d.2002+d.2003+
d.2005+d.2006+d.2007+d.2008+
d.2009+d.2010+d.2011+d.2012+
d.2013+d.2014+d.2015),
data = RENT.merge2, model = "between",cluster="MSA", index=c("MSA", "YEAR"))
summary(mpl.03)
## Oneway (individual) effect Between Model
##
## Call:
## plm(formula = log(RENT_3) ~ treat + Price + Unemployee.Rate +
## Personal.Income + Resident.Population + treat:(d.2001 + d.2002 +
## d.2003 + d.2005 + d.2006 + d.2007 + d.2008 + d.2009 + d.2010 +
## d.2011 + d.2012 + d.2013 + d.2014 + d.2015), data = RENT.merge2,
## model = "between", index = c("MSA", "YEAR"), cluster = "MSA")
##
## Unbalanced Panel: n = 211, T = 13-15, N = 3133
## Observations used in estimation: 211
##
## Residuals:
## Min. 1st Qu. Median 3rd Qu. Max.
## -0.4188622 -0.0743348 -0.0018536 0.0765187 0.3284524
##
## Coefficients: (14 dropped because of singularities)
## Estimate Std. Error t-value Pr(>|t|)
## (Intercept) 5.6177e+00 8.6877e-02 64.6627 < 2.2e-16 ***
## treat 5.1917e-02 1.1277e-01 0.4604 0.64573
## Price 3.9354e-03 4.0769e-04 9.6529 < 2.2e-16 ***
## Unemployee.Rate 2.0330e-02 4.6543e-03 4.3679 1.99e-05 ***
## Personal.Income 1.3255e-05 1.8257e-06 7.2598 7.89e-12 ***
## Resident.Population 1.2454e-05 5.0285e-06 2.4767 0.01407 *
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Total Sum of Squares: 6.504
## Residual Sum of Squares: 2.5817
## R-Squared: 0.60306
## Adj. R-Squared: 0.59338
## F-statistic: 62.2912 on 5 and 205 DF, p-value: < 2.22e-16
mpl.04<-plm(log(RENT_4)~treat+Price+Unemployee.Rate+
Personal.Income+Resident.Population+treat:(d.2001+d.2002+d.2003+
d.2005+d.2006+d.2007+d.2008+
d.2009+d.2010+d.2011+d.2012+
d.2013+d.2014+d.2015),
data = RENT.merge2, model = "between",cluster="MSA", index=c("MSA", "YEAR"))
summary(mpl.04)
## Oneway (individual) effect Between Model
##
## Call:
## plm(formula = log(RENT_4) ~ treat + Price + Unemployee.Rate +
## Personal.Income + Resident.Population + treat:(d.2001 + d.2002 +
## d.2003 + d.2005 + d.2006 + d.2007 + d.2008 + d.2009 + d.2010 +
## d.2011 + d.2012 + d.2013 + d.2014 + d.2015), data = RENT.merge2,
## model = "between", index = c("MSA", "YEAR"), cluster = "MSA")
##
## Unbalanced Panel: n = 211, T = 13-15, N = 3133
## Observations used in estimation: 211
##
## Residuals:
## Min. 1st Qu. Median 3rd Qu. Max.
## -0.4152238 -0.0902304 -0.0084745 0.0825797 0.3470382
##
## Coefficients: (14 dropped because of singularities)
## Estimate Std. Error t-value Pr(>|t|)
## (Intercept) 5.6218e+00 9.9104e-02 56.7263 < 2.2e-16 ***
## treat 4.0336e-02 1.2864e-01 0.3136 0.754177
## Price 5.0489e-03 4.6506e-04 10.8564 < 2.2e-16 ***
## Unemployee.Rate 1.7201e-02 5.3093e-03 3.2397 0.001396 **
## Personal.Income 1.2052e-05 2.0827e-06 5.7869 2.656e-08 ***
## Resident.Population 1.1223e-05 5.7362e-06 1.9565 0.051763 .
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Total Sum of Squares: 8.1796
## Residual Sum of Squares: 3.3594
## R-Squared: 0.58929
## Adj. R-Squared: 0.57927
## F-statistic: 58.8273 on 5 and 205 DF, p-value: < 2.22e-16