Hey Yuki,
I wanted to send you an update on my progress with the Hedonic Pricing Model (i.e. HPM or OLS) portion of my thesis and figured this would be the best way to do it since I have so many methods and lines of code to share with you and notate on.
I have a section at the end (6) with questions and next steps, but the main thing I’m asking for here is your approval (or suggestions) about the current process. If you are satisfied with the way I analyzed the Corona subset, and the method used for the specific beta coefficient comparisons across the corona subset (see results in section 5.3 for example of final statement), I will begin to complete the rest of the subsects in a similar way.
Note:
Thanks!
Sawyer
After cleaning the original data set of 5000 observations, I realized just how many observations are lost in the process of the first-stage cleaning (e.g. removing all #N/A) and how unbalanced the cleaned set was in terms of post and pre-corona observations.
So, I decided to do another, larger data pull with the following results:
This model is just to see where we are in terms of data consistency and relevance.
attach(data)
summary(lm_raw)
Call:
lm(formula = sold_price ~ . - mls_number - school_high - school_junior -
school_middle - roof_type_shingle_bi - sold_date - total_area -
corona_crisis - post_corona_bi, data = data)
Residuals:
Min 1Q Median 3Q Max
-661307 -37161 -573 33353 1746936
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 1.176e+05 6.404e+04 1.837 0.066268 .
property_typeDUP 4.597e+03 4.584e+04 0.100 0.920117
property_typeOTH 1.204e+05 4.598e+04 2.617 0.008867 **
property_typePAT 1.245e+04 1.635e+04 0.762 0.446193
property_typeSGL 5.470e+04 5.654e+03 9.675 < 2e-16 ***
property_typeTNH 2.772e+04 7.616e+03 3.639 0.000274 ***
air_conditioningnot_central -2.581e+04 2.599e+03 -9.931 < 2e-16 ***
appartment_bi -1.226e+04 1.993e+04 -0.615 0.538653
patio_bi 6.882e+03 1.489e+03 4.623 3.82e-06 ***
school_general 2.611e+04 2.779e+03 9.397 < 2e-16 ***
photo_count 1.473e+03 8.050e+01 18.299 < 2e-16 ***
pool_bi 2.035e+04 2.365e+03 8.605 < 2e-16 ***
rear_yard_access_bi -4.922e+02 4.627e+03 -0.106 0.915277
roof_typeother -8.992e+02 2.498e+03 -0.360 0.718919
roof_typeshingle 2.820e+04 2.820e+03 9.998 < 2e-16 ***
roof_typeslate 1.236e+04 1.085e+04 1.139 0.254770
gas_typeNatural -8.737e+04 5.617e+04 -1.555 0.119877
gas_typeNone -9.020e+04 5.618e+04 -1.606 0.108370
gas_typePropane -2.815e+04 5.878e+04 -0.479 0.631982
out_building_livable_bi 4.749e+04 1.197e+04 3.969 7.25e-05 ***
out_building_not_livable_bi -7.553e+03 1.571e+03 -4.807 1.55e-06 ***
living_area 8.170e+01 1.736e+00 47.051 < 2e-16 ***
land_acres -3.619e-01 4.141e+00 -0.087 0.930370
appliances_included_bi 2.187e+04 1.978e+03 11.060 < 2e-16 ***
garage_bi 1.108e+04 1.477e+03 7.500 6.74e-14 ***
conditionExcellent 8.670e+04 8.505e+03 10.194 < 2e-16 ***
conditionFair -4.604e+04 1.211e+04 -3.803 0.000144 ***
conditionNew 8.495e+04 1.211e+04 7.013 2.44e-12 ***
conditionOther 2.756e+04 8.981e+03 3.069 0.002152 **
conditionPoor -5.053e+04 1.542e+04 -3.278 0.001049 **
conditionVrgd 3.133e+04 8.680e+03 3.609 0.000308 ***
energy_efficient_bi 1.384e+04 1.647e+03 8.402 < 2e-16 ***
exterior_typemetal 7.434e+03 4.497e+03 1.653 0.098357 .
exterior_typeother 1.260e+04 2.113e+03 5.963 2.53e-09 ***
exterior_typevinyl 3.459e+03 2.417e+03 1.431 0.152507
exterior_typewood -2.405e+02 3.470e+03 -0.069 0.944740
exterior_featurescourtyard 6.573e+03 1.331e+04 0.494 0.621506
exterior_featuresfence -9.261e+04 8.013e+03 -11.559 < 2e-16 ***
exterior_featuresnone -8.187e+04 8.007e+03 -10.225 < 2e-16 ***
exterior_featuresporch -8.265e+04 8.171e+03 -10.116 < 2e-16 ***
exterior_featurestennis_court -7.168e+04 3.316e+04 -2.161 0.030686 *
fire_place_bi 8.144e+03 1.544e+03 5.273 1.36e-07 ***
foundation_typeraised -1.661e+04 2.454e+03 -6.768 1.35e-11 ***
foundation_typeslab 1.697e+03 2.182e+03 0.778 0.436555
beds_total -7.684e+03 1.349e+03 -5.698 1.24e-08 ***
bath_full 2.830e+04 1.503e+03 18.829 < 2e-16 ***
bath_half 2.430e+04 1.734e+03 14.012 < 2e-16 ***
age 6.546e+02 5.991e+01 10.926 < 2e-16 ***
days_on_market -7.690e+01 7.085e+00 -10.853 < 2e-16 ***
sewer_typeother -3.691e+03 1.568e+03 -2.354 0.018604 *
sewer_typeseptic -6.044e+03 2.414e+03 -2.504 0.012286 *
spa_locationNone -8.745e+04 2.327e+04 -3.758 0.000172 ***
spa_locationOutside 7.885e+03 3.035e+04 0.260 0.794999
stories -2.618e+03 2.340e+03 -1.119 0.263341
property_styleArts and Crafts 8.724e+04 3.055e+04 2.856 0.004297 **
property_styleCamelback 1.736e+05 2.837e+04 6.120 9.58e-10 ***
property_styleCamp 2.627e+04 9.572e+03 2.745 0.006066 **
property_styleCape Cod -9.783e+04 4.586e+04 -2.133 0.032914 *
property_styleColonial 1.981e+04 1.478e+04 1.340 0.180138
property_styleContemporary -5.681e+03 4.659e+03 -1.219 0.222700
property_styleCottage 8.189e+03 5.495e+03 1.490 0.136166
property_styleCraftsman 9.607e+04 3.259e+04 2.948 0.003206 **
property_styleCreole Cottage 1.038e+05 2.258e+04 4.595 4.37e-06 ***
property_styleCreole/French Colonial -7.754e+04 4.629e+04 -1.675 0.093901 .
property_styleFarm 3.365e+04 4.662e+04 0.722 0.470416
property_styleFrench Country 5.213e+03 4.978e+03 1.047 0.295029
property_styleFrench Provincial 1.350e+05 2.325e+04 5.807 6.48e-09 ***
property_styleGeorgian 2.751e+05 4.618e+04 5.956 2.64e-09 ***
property_styleLog Home 1.295e+05 7.922e+04 1.634 0.102191
property_styleMid Century Modern 2.856e+04 3.987e+04 0.716 0.473809
property_styleMobile Home -1.003e+05 5.431e+03 -18.475 < 2e-16 ***
property_styleModular -7.862e+04 1.596e+04 -4.927 8.45e-07 ***
property_styleNot Specific -5.837e+04 4.225e+03 -13.816 < 2e-16 ***
property_styleOther 1.672e+04 6.285e+03 2.661 0.007804 **
property_styleParty Wall Double 8.516e+03 1.068e+04 0.797 0.425404
property_styleRaised Basement 1.442e+05 3.272e+04 4.408 1.05e-05 ***
property_styleRanch -4.359e+04 4.097e+03 -10.639 < 2e-16 ***
property_styleShot Gun 4.879e+03 1.285e+04 0.380 0.704116
property_styleSplit Level -4.373e+04 4.041e+04 -1.082 0.279165
property_styleTownhouse -3.516e+04 8.713e+03 -4.036 5.47e-05 ***
property_styleTraditional -1.610e+04 3.309e+03 -4.864 1.16e-06 ***
property_styleTudor 2.319e+05 5.587e+04 4.150 3.34e-05 ***
property_styleVictorian 9.847e+04 1.375e+04 7.159 8.51e-13 ***
city_limit_bi 3.560e+04 4.433e+03 8.031 1.04e-15 ***
subdivision_bi -3.279e+03 2.783e+03 -1.178 0.238689
tennis_court_bi -8.952e+04 3.054e+04 -2.931 0.003379 **
termite_contractUnknown -2.548e+04 6.732e+03 -3.785 0.000155 ***
termite_contractYes 2.949e+04 4.851e+03 6.080 1.23e-09 ***
water_typeOther -2.110e+03 1.805e+04 -0.117 0.906958
water_typePublic 1.103e+04 1.776e+04 0.621 0.534341
water_typeWell 1.712e+04 1.904e+04 0.899 0.368461
waterfront_bi 3.789e+04 2.583e+03 14.671 < 2e-16 ***
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Residual standard error: 78740 on 14517 degrees of freedom
Multiple R-squared: 0.6486, Adjusted R-squared: 0.6464
F-statistic: 294.5 on 91 and 14517 DF, p-value: < 2.2e-16
par(mfrow = c(2,2))
plot(lm_raw)
All variables subject to outliers are tested and outliers are removed.
All observations more than 1.5 standard deviations from the mean are considered outliers, except for in the case of ‘age,’ which is restricted to 3.5 standard deviations.
table(data_no_outliers$corona_crisis)
Note: Names of variables are on the left, data with outliers is on the left, and outliers removed are on the right.
Note: the folloiwng variables’ outliers were delt with in Excel
We now can see the results of removing outliers on our most general model.
These differences are particulary clear when comparing the two groupings of four diagnostic plots at the end of this regression to see the reduction in both extreme residual values and high-leverage points.
summary(lm_clean)
Call:
lm(formula = sold_price ~ . - mls_number - school_high - school_junior -
school_middle - roof_type_shingle_bi - sold_date - total_area -
corona_crisis - post_corona_bi, data = data_no_outliers)
Residuals:
Min 1Q Median 3Q Max
-277056 -28678 -371 28506 277632
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 1.384e+05 5.433e+04 2.548 0.010862 *
property_typeDUP -1.742e+04 2.853e+04 -0.611 0.541401
property_typeOTH 1.060e+05 2.865e+04 3.699 0.000218 ***
property_typePAT 3.921e+03 1.070e+04 0.367 0.713903
property_typeSGL 2.976e+04 3.803e+03 7.824 5.57e-15 ***
property_typeTNH 2.022e+04 4.995e+03 4.048 5.19e-05 ***
air_conditioningnot_central -2.816e+04 1.807e+03 -15.583 < 2e-16 ***
appartment_bi -6.655e+03 2.108e+04 -0.316 0.752215
patio_bi 8.603e+03 1.032e+03 8.340 < 2e-16 ***
school_general 2.626e+04 1.980e+03 13.261 < 2e-16 ***
photo_count 1.004e+03 6.061e+01 16.556 < 2e-16 ***
pool_bi 1.142e+04 1.777e+03 6.426 1.36e-10 ***
rear_yard_access_bi -1.209e+04 3.930e+03 -3.078 0.002090 **
roof_typeother 2.178e+03 1.811e+03 1.203 0.229086
roof_typeshingle 3.245e+04 2.057e+03 15.775 < 2e-16 ***
roof_typeslate 2.030e+03 8.264e+03 0.246 0.806012
gas_typeNatural -1.477e+05 4.951e+04 -2.984 0.002849 **
gas_typeNone -1.458e+05 4.951e+04 -2.945 0.003239 **
gas_typePropane -8.344e+04 5.361e+04 -1.557 0.119589
out_building_livable_bi 2.139e+04 1.259e+04 1.699 0.089299 .
out_building_not_livable_bi -8.125e+03 1.114e+03 -7.293 3.24e-13 ***
living_area 6.133e+01 1.576e+00 38.917 < 2e-16 ***
land_acres 1.366e+03 1.337e+03 1.021 0.307039
appliances_included_bi 2.271e+04 1.360e+03 16.695 < 2e-16 ***
garage_bi 1.417e+04 1.021e+03 13.886 < 2e-16 ***
conditionExcellent 6.011e+04 6.572e+03 9.146 < 2e-16 ***
conditionFair -3.016e+04 9.250e+03 -3.261 0.001114 **
conditionOther 1.905e+04 6.752e+03 2.821 0.004795 **
conditionPoor -3.701e+04 1.157e+04 -3.200 0.001378 **
conditionVrgd 2.836e+04 6.571e+03 4.315 1.61e-05 ***
energy_efficient_bi 1.440e+04 1.159e+03 12.423 < 2e-16 ***
exterior_typemetal -2.640e+03 3.190e+03 -0.828 0.407914
exterior_typeother 5.009e+03 1.472e+03 3.403 0.000670 ***
exterior_typevinyl -9.798e+02 1.673e+03 -0.586 0.558148
exterior_typewood -1.111e+04 2.419e+03 -4.595 4.38e-06 ***
exterior_featurescourtyard -8.801e+03 1.235e+04 -0.712 0.476230
exterior_featuresfence -3.169e+04 6.614e+03 -4.791 1.68e-06 ***
exterior_featuresnone -2.234e+04 6.600e+03 -3.385 0.000713 ***
exterior_featuresporch -2.366e+04 6.719e+03 -3.522 0.000430 ***
exterior_featurestennis_court -2.078e+04 2.537e+04 -0.819 0.412714
fire_place_bi 1.422e+04 1.079e+03 13.173 < 2e-16 ***
foundation_typeraised -2.128e+04 1.710e+03 -12.444 < 2e-16 ***
foundation_typeslab 4.839e+03 1.511e+03 3.203 0.001365 **
beds_total 3.961e+03 9.945e+02 3.983 6.85e-05 ***
bath_full 1.614e+04 1.073e+03 15.033 < 2e-16 ***
bath_half 1.258e+04 1.285e+03 9.789 < 2e-16 ***
age 5.138e+02 1.070e+02 4.803 1.58e-06 ***
days_on_market -7.547e+01 7.698e+00 -9.804 < 2e-16 ***
sewer_typeother -1.871e+03 1.126e+03 -1.661 0.096745 .
sewer_typeseptic -3.047e+03 1.840e+03 -1.656 0.097779 .
spa_locationNone -2.680e+04 1.695e+04 -1.581 0.113912
spa_locationOutside 7.579e+04 2.988e+04 2.536 0.011213 *
stories -1.576e+04 1.999e+03 -7.883 3.48e-15 ***
property_styleCamelback 1.402e+05 4.933e+04 2.843 0.004474 **
property_styleCamp 2.315e+04 7.236e+03 3.199 0.001383 **
property_styleCape Cod -3.307e+04 2.864e+04 -1.155 0.248199
property_styleColonial -2.189e+04 1.216e+04 -1.800 0.071825 .
property_styleContemporary -1.165e+04 3.236e+03 -3.600 0.000319 ***
property_styleCottage 6.121e+03 3.961e+03 1.545 0.122290
property_styleCreole Cottage 3.259e+04 2.846e+04 1.145 0.252138
property_styleFrench Country 3.262e+03 3.506e+03 0.930 0.352182
property_styleFrench Provincial 8.103e+03 2.856e+04 0.284 0.776589
property_styleGeorgian 6.654e+04 4.931e+04 1.349 0.177275
property_styleMid Century Modern 7.290e+04 3.537e+04 2.061 0.039349 *
property_styleMobile Home -8.901e+04 3.837e+03 -23.198 < 2e-16 ***
property_styleModular -6.680e+04 1.159e+04 -5.763 8.46e-09 ***
property_styleNot Specific -4.082e+04 2.963e+03 -13.773 < 2e-16 ***
property_styleOther -1.233e+04 4.639e+03 -2.658 0.007882 **
property_styleParty Wall Double -1.958e+02 6.919e+03 -0.028 0.977423
property_styleRaised Basement -1.243e+05 4.930e+04 -2.522 0.011682 *
property_styleRanch -3.768e+04 2.841e+03 -13.263 < 2e-16 ***
property_styleShot Gun 1.007e+04 1.009e+04 0.998 0.318300
property_styleSplit Level -4.310e+04 2.990e+04 -1.441 0.149522
property_styleTownhouse -2.185e+04 5.752e+03 -3.799 0.000146 ***
property_styleTraditional -1.587e+04 2.334e+03 -6.799 1.11e-11 ***
property_styleVictorian -1.282e+03 1.378e+04 -0.093 0.925900
city_limit_bi 1.002e+04 3.451e+03 2.905 0.003679 **
subdivision_bi 1.021e+04 2.038e+03 5.007 5.61e-07 ***
tennis_court_bi -3.960e+04 2.060e+04 -1.922 0.054617 .
termite_contractUnknown -2.399e+04 5.128e+03 -4.679 2.91e-06 ***
termite_contractYes -7.041e+02 4.198e+03 -0.168 0.866787
water_typeOther -4.291e+03 1.338e+04 -0.321 0.748394
water_typePublic 1.056e+03 1.319e+04 0.080 0.936233
water_typeWell 3.811e+03 1.442e+04 0.264 0.791590
waterfront_bi 3.275e+04 1.955e+03 16.748 < 2e-16 ***
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Residual standard error: 48920 on 11728 degrees of freedom
Multiple R-squared: 0.6772, Adjusted R-squared: 0.6749
F-statistic: 292.9 on 84 and 11728 DF, p-value: < 2.2e-16
par(mfrow = c(2,2))
plot(lm_clean)
not plotting observations with leverage one:
11243, 11307, 11322, 11352
par(mfrow = c(2,2))
plot(lm_raw)
not plotting observations with leverage one:
12398
Here I test the following:
We see that belonging to the ‘post-corona’ subset is associated on average with a market price premium of +$26,750, ceteris parabus. This finding is statistically significant with p-value < 0.00 under the most controlled model. In other words, one could also say:
A house with similar physical features sold after the first mandated COVID_19 lockdown will, on average, sell for $26,750 more than it would have before this event.
summary(lm_corona_test)
Call:
lm(formula = sold_price ~ post_corona_bi + . - mls_number - school_high -
school_junior - school_middle - roof_type_shingle_bi - sold_date -
total_area - corona_crisis, data = data_no_outliers)
Residuals:
Min 1Q Median 3Q Max
-282122 -28410 -127 28419 285225
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 1.146e+05 5.365e+04 2.136 0.032715 *
post_corona_bi 2.675e+04 1.522e+03 17.575 < 2e-16 ***
property_typeDUP -1.892e+04 2.816e+04 -0.672 0.501674
property_typeOTH 1.029e+05 2.828e+04 3.639 0.000275 ***
property_typePAT 3.402e+03 1.056e+04 0.322 0.747305
property_typeSGL 2.942e+04 3.754e+03 7.837 5.02e-15 ***
property_typeTNH 1.949e+04 4.931e+03 3.952 7.78e-05 ***
air_conditioningnot_central -2.834e+04 1.784e+03 -15.885 < 2e-16 ***
appartment_bi -7.143e+03 2.081e+04 -0.343 0.731396
patio_bi 8.529e+03 1.018e+03 8.376 < 2e-16 ***
school_general 9.670e+03 2.171e+03 4.455 8.49e-06 ***
photo_count 8.839e+02 6.022e+01 14.679 < 2e-16 ***
pool_bi 1.175e+04 1.754e+03 6.702 2.15e-11 ***
rear_yard_access_bi -1.064e+04 3.880e+03 -2.743 0.006091 **
roof_typeother 3.407e+03 1.789e+03 1.905 0.056828 .
roof_typeshingle 3.202e+04 2.031e+03 15.768 < 2e-16 ***
roof_typeslate 1.650e+03 8.158e+03 0.202 0.839677
gas_typeNatural -1.440e+05 4.887e+04 -2.947 0.003210 **
gas_typeNone -1.436e+05 4.888e+04 -2.938 0.003306 **
gas_typePropane -8.036e+04 5.292e+04 -1.519 0.128869
out_building_livable_bi 9.217e+03 1.244e+04 0.741 0.458934
out_building_not_livable_bi -8.061e+03 1.100e+03 -7.329 2.47e-13 ***
living_area 6.178e+01 1.556e+00 39.714 < 2e-16 ***
land_acres 8.981e+02 1.320e+03 0.680 0.496389
appliances_included_bi 2.280e+04 1.343e+03 16.977 < 2e-16 ***
garage_bi 1.430e+04 1.008e+03 14.193 < 2e-16 ***
conditionExcellent 6.016e+04 6.488e+03 9.272 < 2e-16 ***
conditionFair -3.058e+04 9.131e+03 -3.349 0.000813 ***
conditionOther 2.066e+04 6.665e+03 3.099 0.001946 **
conditionPoor -3.731e+04 1.142e+04 -3.268 0.001085 **
conditionVrgd 2.969e+04 6.487e+03 4.576 4.78e-06 ***
energy_efficient_bi 1.464e+04 1.144e+03 12.796 < 2e-16 ***
exterior_typemetal -5.789e+02 3.151e+03 -0.184 0.854243
exterior_typeother 6.929e+03 1.457e+03 4.755 2.01e-06 ***
exterior_typevinyl 7.649e+02 1.655e+03 0.462 0.643895
exterior_typewood -1.010e+04 2.388e+03 -4.231 2.35e-05 ***
exterior_featurescourtyard -5.153e+03 1.220e+04 -0.422 0.672680
exterior_featuresfence -2.848e+04 6.531e+03 -4.361 1.31e-05 ***
exterior_featuresnone -1.939e+04 6.517e+03 -2.975 0.002937 **
exterior_featuresporch -2.021e+04 6.635e+03 -3.045 0.002330 **
exterior_featurestennis_court -1.613e+04 2.505e+04 -0.644 0.519694
fire_place_bi 1.506e+04 1.067e+03 14.122 < 2e-16 ***
foundation_typeraised -2.036e+04 1.689e+03 -12.056 < 2e-16 ***
foundation_typeslab 5.394e+03 1.492e+03 3.616 0.000301 ***
beds_total 3.729e+03 9.818e+02 3.799 0.000146 ***
bath_full 1.631e+04 1.060e+03 15.394 < 2e-16 ***
bath_half 1.258e+04 1.269e+03 9.918 < 2e-16 ***
age 4.695e+02 1.056e+02 4.445 8.86e-06 ***
days_on_market -5.026e+01 7.733e+00 -6.499 8.41e-11 ***
sewer_typeother -1.160e+03 1.113e+03 -1.043 0.297015
sewer_typeseptic -2.555e+03 1.817e+03 -1.406 0.159621
spa_locationNone -2.644e+04 1.673e+04 -1.580 0.114098
spa_locationOutside 7.640e+04 2.950e+04 2.590 0.009610 **
stories -1.654e+04 1.974e+03 -8.377 < 2e-16 ***
property_styleCamelback 1.331e+05 4.869e+04 2.734 0.006260 **
property_styleCamp 2.132e+04 7.144e+03 2.984 0.002853 **
property_styleCape Cod -2.997e+04 2.827e+04 -1.060 0.289183
property_styleColonial -2.391e+04 1.200e+04 -1.992 0.046413 *
property_styleContemporary -1.345e+04 3.196e+03 -4.209 2.58e-05 ***
property_styleCottage 5.569e+03 3.910e+03 1.424 0.154374
property_styleCreole Cottage 2.804e+04 2.809e+04 0.998 0.318148
property_styleFrench Country 3.100e+03 3.460e+03 0.896 0.370371
property_styleFrench Provincial 4.712e+03 2.819e+04 0.167 0.867240
property_styleGeorgian 6.082e+04 4.868e+04 1.249 0.211530
property_styleMid Century Modern 6.977e+04 3.492e+04 1.998 0.045742 *
property_styleMobile Home -8.925e+04 3.788e+03 -23.564 < 2e-16 ***
property_styleModular -6.851e+04 1.144e+04 -5.988 2.19e-09 ***
property_styleNot Specific -4.194e+04 2.926e+03 -14.334 < 2e-16 ***
property_styleOther -1.300e+04 4.579e+03 -2.839 0.004527 **
property_styleParty Wall Double -2.545e+03 6.831e+03 -0.373 0.709437
property_styleRaised Basement -1.092e+05 4.867e+04 -2.244 0.024833 *
property_styleRanch -3.796e+04 2.804e+03 -13.536 < 2e-16 ***
property_styleShot Gun 9.938e+03 9.963e+03 0.997 0.318564
property_styleSplit Level -4.244e+04 2.952e+04 -1.438 0.150537
property_styleTownhouse -2.246e+04 5.678e+03 -3.956 7.66e-05 ***
property_styleTraditional -1.593e+04 2.304e+03 -6.914 4.95e-12 ***
property_styleVictorian -9.880e+02 1.361e+04 -0.073 0.942113
city_limit_bi 9.052e+03 3.407e+03 2.657 0.007893 **
subdivision_bi 1.019e+04 2.012e+03 5.065 4.14e-07 ***
tennis_court_bi -4.177e+04 2.034e+04 -2.054 0.039978 *
termite_contractUnknown -9.997e+03 5.124e+03 -1.951 0.051077 .
termite_contractYes -2.259e+02 4.144e+03 -0.055 0.956515
water_typeOther -4.896e+03 1.320e+04 -0.371 0.710818
water_typePublic -2.841e+03 1.303e+04 -0.218 0.827328
water_typeWell -6.071e+01 1.424e+04 -0.004 0.996598
waterfront_bi 3.316e+04 1.930e+03 17.180 < 2e-16 ***
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Residual standard error: 48290 on 11727 degrees of freedom
Multiple R-squared: 0.6855, Adjusted R-squared: 0.6832
F-statistic: 300.7 on 85 and 11727 DF, p-value: < 2.2e-16
par(mfrow = c(2,2))
plot(lm_corona_test)
not plotting observations with leverage one:
11243, 11307, 11322, 11352
This UCLA method is implimented with the following steps:
Note: The results of the significance level for the interaction term’s beta coefficient tests the null hypothesis: H0: βpre = βpost.
As you can see, the interaction term (i.e. beds_total*post_corona_bi) is statistically significant at the 0.00 level, suggesting we reject the null hypothesis that βpre = βpost.
This result can also be interpreted as:
The average premium for each additional bedroom significantly increased after the outbreak of COVID-19 in March 23, 2020, resulting in an average premium increase of $8,583 per room, ceteris parabus.
My (the author’s) hypothesis is that this result is likely driven by an increased demand for an additional bedroom functioning as a ‘home office’ as many workers were legally compelled to work from home, with many of them never returning to full-time, on-site working schedules.
summary(lm_beds_corona_test)
Call:
lm(formula = sold_price ~ post_corona_bi + beds_total + beds_total *
post_corona_bi, data = data_no_outliers)
Residuals:
Min 1Q Median 3Q Max
-293588 -49022 1404 44578 335004
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) -12004 4274 -2.809 0.004982 **
post_corona_bi 21178 7297 2.902 0.003711 **
beds_total 53500 1366 39.151 < 2e-16 ***
post_corona_bi:beds_total 8583 2316 3.706 0.000212 ***
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Residual standard error: 74840 on 11809 degrees of freedom
Multiple R-squared: 0.2392, Adjusted R-squared: 0.239
F-statistic: 1238 on 3 and 11809 DF, p-value: < 2.2e-16
End of Document