#Thesis

Homes with a greater above ground square footage will generally have a higher sale price, with above ground square footage being a decent predictor of sale price.

#Data Setup

#Histograms #Correlation #Model 1 - Living Area

## 
## Call:
## lm(formula = sale_price ~ gr_liv_area, data = t_train)
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -187636  -28206   -1869   21512  328885 
## 
## Coefficients:
##              Estimate Std. Error t value Pr(>|t|)    
## (Intercept) 17643.688   5272.755   3.346 0.000849 ***
## gr_liv_area   108.693      3.421  31.772  < 2e-16 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 50640 on 1028 degrees of freedom
## Multiple R-squared:  0.4955, Adjusted R-squared:  0.495 
## F-statistic:  1009 on 1 and 1028 DF,  p-value: < 2.2e-16

#Model 2 - Garage Area

## 
## Call:
## lm(formula = sale_price ~ garage_area, data = t_train)
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -169773  -31754   -5151   25786  364049 
## 
## Coefficients:
##              Estimate Std. Error t value Pr(>|t|)    
## (Intercept) 73091.683   4299.027   17.00   <2e-16 ***
## garage_area   225.424      8.514   26.48   <2e-16 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 54970 on 1028 degrees of freedom
## Multiple R-squared:  0.4055, Adjusted R-squared:  0.4049 
## F-statistic: 701.1 on 1 and 1028 DF,  p-value: < 2.2e-16

#Model 3 - Overall Condition

## 
## Call:
## lm(formula = sale_price ~ overall_cond_numeric, data = t_train)
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -170143  -46317  -14743   31734  431757 
## 
## Coefficients:
##                      Estimate Std. Error t value Pr(>|t|)    
## (Intercept)            228031      11351  20.088  < 2e-16 ***
## overall_cond_numeric    -8958       1974  -4.538 6.35e-06 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 70590 on 1028 degrees of freedom
## Multiple R-squared:  0.01964,    Adjusted R-squared:  0.01869 
## F-statistic: 20.59 on 1 and 1028 DF,  p-value: 6.348e-06

#Model 4 - Total Basement SQft

## 
## Call:
## lm(formula = sale_price ~ total_bsmt_sf, data = t_train)
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -139709  -37251  -10779   33638  261732 
## 
## Coefficients:
##                Estimate Std. Error t value Pr(>|t|)    
## (Intercept)   56013.732   4657.051   12.03   <2e-16 ***
## total_bsmt_sf   117.260      4.195   27.95   <2e-16 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 53740 on 1028 degrees of freedom
## Multiple R-squared:  0.4319, Adjusted R-squared:  0.4313 
## F-statistic: 781.5 on 1 and 1028 DF,  p-value: < 2.2e-16

#Testing the best model

## [1] -3499.117

#Visualization

#Analysis

Through this project I have shown that there is a correlation between above ground square footage and sales price, with an r-squared of 0.494, which means it accurately predicts about half of the data. It is evident from the poor correlation between basement square footage and sales price when compared to the decent correlation between above ground footage and sales price. The residuals in the model show the difference between the actual values (dots on the graph, and predicted (line on the graph), which proves my thesis to be somewhat accurate. This was interesting to me because going into the project I assumed more square footage would equate to a higher sales price but now I see that is not always the case.