Final Project: Cincinnati Housing Data

February 25th, 2024

Caylee Rosa

Overview

The goal of this data exploration is to determine which variable has the greatest impact on sale price along with any secondary influences. From there, the objective is to conclude what changes could be made when searching for houses to help buyers find desirable homes at a reasonable price.

Additionally, we want to understand the strength of our models and what potential changes we can make to improve our overall predictability.

Data Preparation

Packages Required

# Add libraries
library(tidyverse)
library(ggplot2)
library(lubridate)
library(cowplot)
library(leaps)
library(DAAG)
library(MASS)

Clean Data

Before importing to R, a visual inspection was completed to ensure our data was consistent and accurate. Through this inspection, the following issues were addressed:
- Duplicate entries were removed (not exact match, but still duplicate).
- Contributor column was removed (not relevant to this analysis).
- Empty and null values were updated to show as “NA” values.
- Measurements were standardized (i.e., house sizes converted to square feet).

As detailed below, additional data clean up was completed before starting our analysis. This clean up included:
- Renaming column headers.
- Updating data types.
- Adding additional quantitative data.
- Evaluating and managing NA values.

# Import data 
housing <- read.csv("BANA 7038 Course Data Files/BANA7038_Housing_Data.csv", 
                    h = T)

# Update column names 
colnames(housing) <- c("address", "zip", "price_sold", "date_sold", 
                       "num_of_bedrooms", "num_of_bathrooms", "year_built", 
                       "square_feet", "lot_size", "num_parking_spots")

# Update data type to numeric (where needed)
housing$num_parking_spots = as.numeric(housing$num_parking_spots)

# Add month column and house age (in years)
housing <- housing %>%
  mutate(month_sold = month(date_sold), # month sold
         house_age = (year(Sys.Date()) - year_built)) # house age in years

head(housing)
##                                    address   zip price_sold  date_sold
## 1       2442 Elderberry Ct, Cincinnati, OH 45239     214300 2023-12-08
## 2 2444 Madison Rd UNIT 904, Cincinnati, OH 45208     339900 2023-11-15
## 3 3004 Glenmore Ave UNIT 314,Cincinnati,OH 45238      90000 2024-01-11
## 4       5644 Springdale Rd, Cincinnati, OH 45251     178000 2023-11-27
## 5    5921 Squirrelsnest Ln, Cincinnati, OH 45252     585000 2023-10-03
## 6    7844 Gapstow Brg #303, Cincinnati, OH 45231     269900 2024-01-05
##   num_of_bedrooms num_of_bathrooms year_built square_feet lot_size
## 1               2                3       2006        1456       NA
## 2               2                2       1967        1800       NA
## 3               2                1       1983         882       NA
## 4               2                2       1980        1150       NA
## 5               3                4         NA          NA       NA
## 6               3                3       1988        1848       NA
##   num_parking_spots month_sold house_age
## 1                 2         12        18
## 2                 0         11        57
## 3                 3          1        41
## 4                 1         11        44
## 5                NA         10        NA
## 6                NA          1        36

Updating Missing Values

Before we can start our data analysis, we need to decide how to handle our missing values. To do this, we can use imputation by looking at a variety of potential replacements.For this data set, we will review how our data would be impacted by replacing NA values with 0, the mean of the column data, the median of the column data, and removing the data all together. From there we can select the option with the least impact to our original data as our replacement.

# Check for missing values 
colSums(is.na(housing))
##           address               zip        price_sold         date_sold 
##                 0                 0                 3                 3 
##   num_of_bedrooms  num_of_bathrooms        year_built       square_feet 
##                 9                 8                26                28 
##          lot_size num_parking_spots        month_sold         house_age 
##                70               276                 3                26

Evaluating NA values for Number of Parking Spots

We can see from the distribution that there is minimal impact to our original data when we use the mean or median as our replacement for our NA values. We do see an impact when using zero as our replacement. Since there is such minimal difference between the mean and median, we will use the mean as our replacement value.

# Create data frame of imputation options - number of parking spots 
park_imputed_values <- data.frame(
  original = housing$num_parking_spots,
  imputed_zero = replace(housing$num_parking_spots, 
                         is.na(housing$num_parking_spots), 0),
  imputed_mean = replace(housing$num_parking_spots, 
                         is.na(housing$num_parking_spots), 
                         mean(housing$num_parking_spots, na.rm = TRUE)),
  imputed_median = replace(housing$num_parking_spots, 
                           is.na(housing$num_parking_spots), 
                           median(housing$num_parking_spots, na.rm = TRUE))
)

# NA value change for each option
head(park_imputed_values)
##   original imputed_zero imputed_mean imputed_median
## 1        2            2     2.000000              2
## 2        0            0     0.000000              0
## 3        3            3     3.000000              3
## 4        1            1     1.000000              1
## 5       NA            0     1.798077              2
## 6       NA            0     1.798077              2
# Create histogram for each option
park_h1 <- ggplot(park_imputed_values, aes(x = original)) +
  geom_histogram(bins = 20, fill = "red3") +
  labs(title = "Original distribution", x = "Original")

park_h2 <- ggplot(park_imputed_values, aes(x = imputed_zero)) +
  geom_histogram(bins = 20, fill = "green3") +
  labs(title = "Zero-imputed distribution", x = "Imputed Zero")

park_h3 <- ggplot(park_imputed_values, aes(x = imputed_mean)) +
  geom_histogram(bins = 20, fill = "blue4") +
  labs(title = "Mean-imputed distribution", x = "Imputed Mean")

park_h4 <- ggplot(park_imputed_values, aes(x = imputed_median)) +
  geom_histogram(bins = 20, fill = "yellow3") +
  labs(title = "Median-imputed distribution", x = "Imputed Median")

# Plot grid of each histogram 
plot_grid(park_h1, park_h2, park_h3, park_h4, nrow = 2, ncol = 2)

# Replace NA values with median for number of parking spots 
housing$num_parking_spots[is.na(housing$num_parking_spots)] <- 
  mean(housing$num_parking_spots, na.rm = T)

Evaluating NA values for Size of Lot

We can see from the distribution that there is likely outliers present that are heavily skewing our data. As a result, it is hard to tell from our histograms what the right replacement is. While having a 0 lot size doesn’t make sense and our mean is likely heavily impacted by outliers, using our median is likely our best approach.

# Create data frame of imputation options - size of lot 
lot_imputed_values <- data.frame(
  original = housing$lot_size,
  imputed_zero = replace(housing$lot_size, 
                         is.na(housing$lot_size), 0),
  imputed_mean = replace(housing$lot_size, 
                         is.na(housing$lot_size), 
                         mean(housing$lot_size, na.rm = TRUE)),
  imputed_median = replace(housing$lot_size, 
                           is.na(housing$lot_size), 
                           median(housing$lot_size, na.rm = TRUE))
)

# NA value change for each option
head(lot_imputed_values)
##   original imputed_zero imputed_mean imputed_median
## 1       NA            0     829287.1         8820.5
## 2       NA            0     829287.1         8820.5
## 3       NA            0     829287.1         8820.5
## 4       NA            0     829287.1         8820.5
## 5       NA            0     829287.1         8820.5
## 6       NA            0     829287.1         8820.5
# Create histogram for each option
lot_h1 <- ggplot(lot_imputed_values, aes(x = original)) +
  geom_histogram(bins = 20, fill = "red3") + 
  labs(title = "Original distribution", x = "Original")

lot_h2 <- ggplot(lot_imputed_values, aes(x = imputed_zero)) +
  geom_histogram(bins = 20, fill = "green3") +
  labs(title = "Zero-imputed distribution", x = "Imputed Zero")

lot_h3 <- ggplot(lot_imputed_values, aes(x = imputed_mean)) +
  geom_histogram(bins = 20, fill = "blue4") +
  labs(title = "Mean-imputed distribution", x = "Imputed Mean")

lot_h4 <- ggplot(lot_imputed_values, aes(x = imputed_median)) +
  geom_histogram(bins = 20, fill = "yellow3") +
  labs(title = "Median-imputed distribution", x = "Imputed Median")

# Plot grid of each histogram 
plot_grid(lot_h1, lot_h2, lot_h3, lot_h4, nrow = 2, ncol = 2)

# Replace NA values with median for size of lot
housing$lot_size[is.na(housing$lot_size)] <- 
  median(housing$lot_size, na.rm = T)

Evaluating NA values for Square Feet

We see some variability between the mean, median, and zero histograms. Zero has the largest impact, although small. Between mean and median, we see the least impact with the mean even though we see some variability across all options. For this data set we will go with the mean to keep the impact minimized.

# Create data frame of imputation options - square feet 
sqrft_imputed_values <- data.frame(
  original = housing$square_feet,
  imputed_zero = replace(housing$square_feet, 
                         is.na(housing$square_feet), 0),
  imputed_mean = replace(housing$square_feet, 
                         is.na(housing$square_feet), 
                         mean(housing$square_feet, na.rm = TRUE)),
  imputed_median = replace(housing$square_feet, 
                           is.na(housing$square_feet), 
                           median(housing$square_feet, na.rm = TRUE))
)

# NA value change for each option
head(sqrft_imputed_values)
##   original imputed_zero imputed_mean imputed_median
## 1     1456         1456     1456.000           1456
## 2     1800         1800     1800.000           1800
## 3      882          882      882.000            882
## 4     1150         1150     1150.000           1150
## 5       NA            0     2210.193           1820
## 6     1848         1848     1848.000           1848
# Create histogram for each option
sqrft_h1 <- ggplot(sqrft_imputed_values, aes(x = original)) +
  geom_histogram(bins = 20, fill = "red3") +
  labs(title = "Original distribution", x = "Original")

sqrft_h2 <- ggplot(sqrft_imputed_values, aes(x = imputed_zero)) +
  geom_histogram(bins = 20, fill = "green3") +
  labs(title = "Zero-imputed distribution", x = "Imputed Zero")

sqrft_h3 <- ggplot(sqrft_imputed_values, aes(x = imputed_mean)) +
  geom_histogram(bins = 20, fill = "blue4") +
  labs(title = "Mean-imputed distribution", x = "Imputed Mean")

sqrft_h4 <- ggplot(sqrft_imputed_values, aes(x = imputed_median)) +
  geom_histogram(bins = 20, fill = "yellow3") +
  labs(title = "Median-imputed distribution", x = "Imputed Median")

# Plot grid of each histogram 
plot_grid(sqrft_h1, sqrft_h2, sqrft_h3, sqrft_h4, nrow = 2, ncol = 2)

# Replace NA values with mean for square feet
housing$square_feet[is.na(housing$square_feet)] <- 
  mean(housing$square_feet, na.rm = T)

Evaluating NA values for Number of Bedrooms

We see almost some variability across all options when looking at the number of bedrooms. For this case, we will go with the median as it has the minimum impact.

# Create data frame of imputation options - number of bedrooms 
beds_imputed_values <- data.frame(
  original = housing$num_of_bedrooms,
  imputed_zero = replace(housing$num_of_bedrooms, 
                         is.na(housing$num_of_bedrooms), 0),
  imputed_mean = replace(housing$num_of_bedrooms, 
                         is.na(housing$num_of_bedrooms), 
                         mean(housing$num_of_bedrooms, na.rm = TRUE)),
  imputed_median = replace(housing$num_of_bedrooms, 
                           is.na(housing$num_of_bedrooms), 
                           median(housing$num_of_bedrooms, na.rm = TRUE))
)

# NA value change for each option
head(beds_imputed_values)
##   original imputed_zero imputed_mean imputed_median
## 1        2            2            2              2
## 2        2            2            2              2
## 3        2            2            2              2
## 4        2            2            2              2
## 5        3            3            3              3
## 6        3            3            3              3
# Create histogram for each option
bed_h1 <- ggplot(beds_imputed_values, aes(x = original)) +
  geom_histogram(bins = 20, fill = "red3") +
  labs(title = "Original distribution", x = "Original")

bed_h2 <- ggplot(beds_imputed_values, aes(x = imputed_zero)) +
  geom_histogram(bins = 20, fill = "green3") +
  labs(title = "Zero-imputed distribution", x = "Imputed Zero")

bed_h3 <- ggplot(beds_imputed_values, aes(x = imputed_mean)) +
  geom_histogram(bins = 20, fill = "blue4") +
  labs(title = "Mean-imputed distribution", x = "Imputed Mean")

bed_h4 <- ggplot(beds_imputed_values, aes(x = imputed_median)) +
  geom_histogram(bins = 20, fill = "yellow3") +
  labs(title = "Median-imputed distribution", x = "Imputed Median")

# Plot grid of each histogram 
plot_grid(bed_h1, bed_h2, bed_h3, bed_h4, nrow = 2, ncol = 2)

# Replace NA values with median for number of bedrooms 
housing$num_of_bedrooms[is.na(housing$num_of_bedrooms)] <- 
  median(housing$num_of_bedrooms, na.rm = T)

Evaluating NA values for Number of Bathrooms

We again here see some variability in our distribution. We can choose the median as our replacement as it has the least impact.

# Create data frame of imputation options - number of bathrooms 
baths_imputed_values <- data.frame(
  original = housing$num_of_bathrooms,
  imputed_zero = replace(housing$num_of_bathrooms, 
                         is.na(housing$num_of_bathrooms), 0),
  imputed_mean = replace(housing$num_of_bathrooms, 
                         is.na(housing$num_of_bathrooms), 
                         mean(housing$num_of_bathrooms, na.rm = TRUE)),
  imputed_median = replace(housing$num_of_bathrooms, 
                           is.na(housing$num_of_bathrooms), 
                           median(housing$num_of_bathrooms, na.rm = TRUE))
)

# NA value change for each option
head(baths_imputed_values)
##   original imputed_zero imputed_mean imputed_median
## 1        3            3            3              3
## 2        2            2            2              2
## 3        1            1            1              1
## 4        2            2            2              2
## 5        4            4            4              4
## 6        3            3            3              3
# Create histogram for each option
bath_h1 <- ggplot(baths_imputed_values, aes(x = original)) +
  geom_histogram(bins = 20, fill = "red3") +
  labs(title = "Original distribution", x = "Original")

bath_h2 <- ggplot(baths_imputed_values, aes(x = imputed_zero)) +
  geom_histogram(bins = 20, fill = "green3") +
  labs(title = "Zero-imputed distribution", x = "Imputed Zero")

bath_h3 <- ggplot(baths_imputed_values, aes(x = imputed_mean)) +
  geom_histogram(bins = 20, fill = "blue4") +
  labs(title = "Mean-imputed distribution", x = "Imputed Mean")

bath_h4 <- ggplot(baths_imputed_values, aes(x = imputed_median)) +
  geom_histogram(bins = 20, fill = "yellow3") +
  labs(title = "Median-imputed distribution", x = "Imputed Median")

# Plot grid of each histogram 
plot_grid(bath_h1, bath_h2, bath_h3, bath_h4, nrow = 2, ncol = 2)

# Replace NA values with median for number of bathrooms 
housing$num_of_bathrooms[is.na(housing$num_of_bathrooms)] <- 
  round(median(housing$num_of_bathrooms, na.rm = T), 0)

Removing NA Values

Due to the variability in price sold, the unpredictability of year built, and the minimum number of records missing from date sold, these 3 columns had any remaining NA values removed from the data set.

# Reviewing imputation histograms to determine how to handle NA values

# Remove NA price sold values from the data set
housing <- housing %>% drop_na(price_sold)

# Remove NA year built sold from data set
housing <- housing %>% drop_na(year_built)

# Remove NA date sold from data set 
housing <- housing %>% drop_na(date_sold)

# Check for missing values 
colSums(is.na(housing))
##           address               zip        price_sold         date_sold 
##                 0                 0                 0                 0 
##   num_of_bedrooms  num_of_bathrooms        year_built       square_feet 
##                 0                 0                 0                 0 
##          lot_size num_parking_spots        month_sold         house_age 
##                 0                 0                 0                 0
# Snapshot of cleaned data 
head(housing)
##                                    address   zip price_sold  date_sold
## 1       2442 Elderberry Ct, Cincinnati, OH 45239     214300 2023-12-08
## 2 2444 Madison Rd UNIT 904, Cincinnati, OH 45208     339900 2023-11-15
## 3 3004 Glenmore Ave UNIT 314,Cincinnati,OH 45238      90000 2024-01-11
## 4       5644 Springdale Rd, Cincinnati, OH 45251     178000 2023-11-27
## 5    7844 Gapstow Brg #303, Cincinnati, OH 45231     269900 2024-01-05
## 6    7909 Cheviot Rd UNIT 18,Cincinnati,OH 45247     170000 2024-01-12
##   num_of_bedrooms num_of_bathrooms year_built square_feet lot_size
## 1               2                3       2006        1456   8820.5
## 2               2                2       1967        1800   8820.5
## 3               2                1       1983         882   8820.5
## 4               2                2       1980        1150   8820.5
## 5               3                3       1988        1848   8820.5
## 6               2                3       1991        2400   8820.5
##   num_parking_spots month_sold house_age
## 1          2.000000         12        18
## 2          0.000000         11        57
## 3          3.000000          1        41
## 4          1.000000         11        44
## 5          1.798077          1        36
## 6          1.000000          1        33

Data Exploration

Visual Analysis

Below are some plots to help visualize our data.

# Histogram
ggplot(housing, aes(x = price_sold)) + 
  geom_histogram(fill = "blue4") +
  labs(title = "Price Sold", x = "Price")
## `stat_bin()` using `bins = 30`. Pick better value with `binwidth`.

ggplot(housing, aes(x = log(price_sold))) + 
  geom_histogram(fill = "blue4") +
  labs(title = "Price Sold", x = "Price")
## `stat_bin()` using `bins = 30`. Pick better value with `binwidth`.

# Plot pairs 
pairs(housing[c(3,5:6,8:10,12)], pch = 20)

# Plot points
plot1 <- ggplot(housing, aes(x = num_of_bedrooms, y = price_sold)) + 
  geom_point(color = "red3") +
  labs(Title = "Price Sold vs. Bedroom Count", x = "# of Bedrooms", y = "Sale Price")
plot2 <- ggplot(housing, aes(x = num_of_bathrooms, y = price_sold)) + 
  geom_point(color = "green3") +
  labs(Title = "Price Sold vs. Bathroom Count", x = "# of Bathrooms", y = "Sale Price")
plot3 <- ggplot(housing, aes(x = square_feet, y = price_sold)) + 
  geom_point(color = "blue4") +
  labs(Title = "Price Sold vs. Square Feet", x = "Square Feet", y = "Sale Price")
plot4 <- ggplot(housing, aes(x = lot_size, y = price_sold)) + 
  geom_point(color = "yellow3") +
  labs(Title = "Price Sold vs. Lot Size", x = "Lot Size", y = "Sale Price")
plot5 <- ggplot(housing, aes(x = house_age, y = price_sold)) + 
  geom_point(color = "orange3") + 
  labs(Title = "Price Sold vs. House Age", x = "House Age", y = "Sale Price")
plot6 <- ggplot(housing, aes(x = num_parking_spots, y = price_sold)) + 
  geom_point(color = "pink3") + 
  labs(Title = "Price Sold vs. Parking Spots", x = "# of Parking Spots", y = "Sale Price")

# Create grid of different key plots 
plot_grid(plot1, plot2, plot3, plot4, plot5, plot6, nrow = 2, ncol = 3) 

Create Model & Evaluate for Outliers

Below we create our first model that includes all potential independent variables using our original data set.

# Create model 
housing_model1 <- lm(price_sold ~ num_of_bedrooms + num_of_bathrooms + 
                      square_feet + lot_size + num_parking_spots + house_age, 
                     data = housing)

Evaluate Outliers: Using Residuals

Next, we need to evaluate our model for outliers. There are 3 measures we can look at regarding residuals that help us check the adequacy of our model and ensure our model fits our data well. They can also be used to help identify outliers in our data set.

Measure 1: Residuals vs. Response and Independent Variables

Measure one looks at the residuals against the response variable and the residuals against the independent variables. When looking at residuals vs. the response variable, we are checking for linearity, equal variance, and potential outliers. Here, we do not see a equal distribution around zero, but a funnel indicating we may have outliers.

Looking at the residuals against the independent variable we see a fairly random distribution of number of bedrooms and number of bathrooms. However, we again see a funnel with square feet indicating it lacks “randomness”. Additionally, we see a heavy skew of data for our lot size.

# Get residuals
head(housing_model1$residuals)
##          1          2          3          4          5          6 
## -143943.98   16052.33   58808.73  -22604.05 -116330.04 -364505.01
# Create scatter plots with the residuals and price sold 
ggplot(housing, aes(x = price_sold, y = housing_model1$residuals)) + 
  geom_point(color = "blue4") +
  geom_hline(yintercept = 0, col = "black") + 
  labs(Title = "Residuals vs. Price Sold", x = "Price Sold", y = "Residuals")

# Mean of residuals 
mean(housing_model1$residuals)
## [1] -2.064841e-11
# Check residuals against the independent variables

# Plot the relationships
bed_res <- ggplot(housing, aes(num_of_bedrooms, housing_model1$residuals)) + 
  geom_point(color = "red3") + 
  geom_hline(yintercept = 0, col = "black") + 
  labs(Title = "Residuals vs. # of Bedrooms", x = "# of Bedrooms", y = "Residuals")
bath_res <- ggplot(housing, aes(num_of_bathrooms, housing_model1$residuals)) + 
  geom_point(color = "green3") + 
  geom_hline(yintercept = 0, col = "black") + 
  labs(Title = "Residuals vs. # of Bathrooms", x = "# of Bathrooms", y = "Residuals")
sqrft_res <- ggplot(housing, aes(square_feet, housing_model1$residuals)) + 
  geom_point(color = "blue4") + 
  geom_hline(yintercept = 0, col = "black") + 
  labs(Title = "Residuals vs. Square Feet", x = "Square Feet", y = "Residuals")
lot_res <- ggplot(housing, aes(lot_size, housing_model1$residuals)) + 
  geom_point(color = "yellow3") + 
  geom_hline(yintercept = 0, col = "black") + 
  labs(Title = "Residuals vs. Lot Size", x = "Lot Size", y = "Residuals")
park_res <- ggplot(housing, aes(num_parking_spots, housing_model1$residuals)) + 
  geom_point(color = "orange3") + 
  geom_hline(yintercept = 0, col = "black") +
  labs(Title = "Residuals vs. # of Parking Spots", x = "# of Parking Spots", y = "Residuals")
age_res <- ggplot(housing, aes(house_age, housing_model1$residuals)) + 
  geom_point(color = "pink3") + 
  geom_hline(yintercept = 0, col = "black") + 
  labs(Title = "Residuals vs. House Age", x = "House Age", y = "Residuals")

plot_grid(bed_res, bath_res, sqrft_res,lot_res, park_res, age_res,
          nrow = 2, ncol = 3) 

Measure 2: Residual Normality Assumption

Measure 2 uses QQ-plots to evaluate the normal distribution and evaluates if there are potential outliers. We see a little bit of curve at the beginning and end of our qq-plot. This variability isn’t ideal, but not bad as majority of the data follows a normal distribution. The value at the far right of the graph also looks to be an outlier.

# Create histogram 
hist(housing_model1$residuals, col = "blue4")

hist(housing_model1$residuals, breaks = 30, col = "blue4")

# QQ-Plots 
qqnorm(housing_model1$residuals, col = "blue4")
qqline(housing_model1$residuals, col = "blue4")

Measure 3: Identifying Outliers using Residuals

Measure 3 looks at residuals to determine if there are outliers.

From our results, we identify 23 outliers that fall outside of the normal distribution of our data (+- 3 standard deviations). Based on this, we can remove these 22 outliers. First, lets take a look at cooks distance.

# Get Residuals 
head(housing_model1$residuals)
##          1          2          3          4          5          6 
## -143943.98   16052.33   58808.73  -22604.05 -116330.04 -364505.01
# Get sigma - estimator of the standard deviation of our residuals 
summary(housing_model1)$sigma
## [1] 300619.3
# standardize residuals 
stdRes = housing_model1$residuals / summary(housing_model1)$sigma
head(stdRes)
##           1           2           3           4           5           6 
## -0.47882488  0.05339753  0.19562530 -0.07519162 -0.38696802 -1.21251381
# Combine data points with standardized residuals 
housing_residuals = cbind(housing, stdRes)
head(housing_residuals)
##                                    address   zip price_sold  date_sold
## 1       2442 Elderberry Ct, Cincinnati, OH 45239     214300 2023-12-08
## 2 2444 Madison Rd UNIT 904, Cincinnati, OH 45208     339900 2023-11-15
## 3 3004 Glenmore Ave UNIT 314,Cincinnati,OH 45238      90000 2024-01-11
## 4       5644 Springdale Rd, Cincinnati, OH 45251     178000 2023-11-27
## 5    7844 Gapstow Brg #303, Cincinnati, OH 45231     269900 2024-01-05
## 6    7909 Cheviot Rd UNIT 18,Cincinnati,OH 45247     170000 2024-01-12
##   num_of_bedrooms num_of_bathrooms year_built square_feet lot_size
## 1               2                3       2006        1456   8820.5
## 2               2                2       1967        1800   8820.5
## 3               2                1       1983         882   8820.5
## 4               2                2       1980        1150   8820.5
## 5               3                3       1988        1848   8820.5
## 6               2                3       1991        2400   8820.5
##   num_parking_spots month_sold house_age      stdRes
## 1          2.000000         12        18 -0.47882488
## 2          0.000000         11        57  0.05339753
## 3          3.000000          1        41  0.19562530
## 4          1.000000         11        44 -0.07519162
## 5          1.798077          1        36 -0.38696802
## 6          1.000000          1        33 -1.21251381
# Number of rows with outliers 
NROW(housing_residuals %>% filter(stdRes > 3 | stdRes < -3)) 
## [1] 22
# Create list of outliers
housing_outliers <- housing_residuals %>% 
  filter(stdRes > 3 | stdRes < -3)
housing_outliers
##                                      address   zip price_sold  date_sold
## 31          3026 Woodburn Ave, Cincinnati OH 45206    2050000 2023-11-20
## 35       3900 West St #301/3, Cincinnati, OH 45227    2275000 2023-12-20
## 37     3900 West St UNIT 203, Cincinnati, OH 45227    1650000 2023-07-28
## 39    3900 West Street #301/3, Cincinnati OH 45227    2275000 2023-12-20
## 105          8705 Camargo Dr, Cincinnati, OH 45243    3500000 2023-07-27
## 108 9200 Old Indian Hill Rd, Cincinnati, OH  45243    3500000 2023-11-21
## 158         805 Tusculum Ave, Cincinnati, OH 45226    2525000 2021-06-30
## 164          2501 Grandin Rd, Cincinnati, OH 45208    3850000 2023-02-24
## 167      7995 Ayers Rd, Cincinnati, OH 45255 45255    7500000 2023-07-12
## 172             10 Gradin Ln, Cincinnati, OH 45208    3600000 2021-10-12
## 175            10 Grandin Ln, Cincinnati, OH 45208    3650000 2021-10-12
## 191  9200 Old Indian Hill Rd, Cincinnati, OH 45243    3500000 2023-11-21
## 194            7886 Ayers Rd, Cincinnati, OH 45255    2495000 2023-05-31
## 210           2 Taft Road Ln, Cincinnati, OH 45206    2800000 2022-12-16
## 228         1269 Balmoral Dr, Cincinnati, OH 45233     697600 2021-04-30
## 264            7640 Demar Rd, Cincinnati, OH 45243    2200000 2023-06-23
## 293       1240 W Rookwood Dr, Cincinnati, OH 45208    1900000 2023-04-19
## 328       6473 Beechmont Ave, Cincinnati, OH 45230     350000 2023-07-26
## 337       3980 Rose Hill Ave, Cincinnati, OH 45229     609000 2022-01-13
## 535                        1722 Wolfangel Rd 45255     110111 2023-06-22
## 613        1059 Celestial St, Cincinnati, OH 45202    3025000 2021-06-18
## 837              1056 Bluejay Dr, Cincinnati 45231     215000 2023-12-22
##     num_of_bedrooms num_of_bathrooms year_built square_feet lot_size
## 31                6                2       1886        3921   8820.5
## 35                4                5       2014        4592   8820.5
## 37                3                3       2014        3288   8820.5
## 39                4                5       2014        4592   8820.5
## 105               5                8       1929        7980 334540.0
## 108               5                8       1935       10119 264409.0
## 158               6                5       1869        5255 178596.0
## 164               5                6       1958        7091 143748.0
## 167               4                6       2016        7370 132422.0
## 172               5                6       1925        8374 129373.0
## 175               5                6       1925        8374 126324.0
## 191               5                8       1999       10119  87555.0
## 194               4                5       2016        6552  87120.0
## 210               5                5       2001        7537  64469.0
## 228               6                7       1964        7875  52708.0
## 264               5                6       2012        4976  43560.0
## 293               4                4       1939        4413  30492.0
## 328               6                4       1917        7874  23522.0
## 337               6                7       1903        7586  22216.0
## 535               3                1       1940       12170  12632.0
## 613               4                4       2017        6778  10585.0
## 837               4                2       1956        7620   7620.0
##     num_parking_spots month_sold house_age    stdRes
## 31                  1         11       138  5.063546
## 35                  5         12        10  4.121264
## 37                  2          7        10  3.361515
## 39                  5         12        10  4.121264
## 105                 3          7        95  5.141399
## 108                 3         11        89  3.868778
## 158                 2          6       155  4.742521
## 164                 3          2        66  7.592333
## 167                 1          7         8 19.412750
## 172                 3         10        99  5.978702
## 175                 3         10        99  6.145026
## 191                 4         11        25  3.917128
## 194                 3          5         8  3.653819
## 210                 3         12        23  4.226332
## 228                 6          4        60 -3.529289
## 264                 3          6        12  3.392602
## 293                 2          4        85  3.266123
## 328                 6          7       107 -3.596462
## 337                 2          1       121 -3.745484
## 535                 2          6        84 -6.354153
## 613                 3          6         7  5.653408
## 837                 0         12        68 -3.532621

Evaluate Outliers: Using Cooks Distance to find outliers

Using cooks distance, we can determine how impactful or influential each of the values in our data set are and how great the impact would be to keep or remove them from the data set.

As outlined below, there are only three values that are great than one, indicating they will have significant influence depending on whether we keep them or remove them from our data.

# Cooks distance 
head(cooks.distance(housing_model1))
##            1            2            3            4            5            6 
## 1.586563e-04 2.049027e-06 3.025714e-05 2.377928e-06 3.813411e-05 1.058249e-03
# Combine with original data and filter for values over one
cbind(housing, cooks = cooks.distance(housing_model1)) %>%
  filter(cooks >= 1)
##                                 address   zip price_sold  date_sold
## 66      2635 Struble Rd. Cincinnati, OH 45231     160000 2023-07-10
## 167 7995 Ayers Rd, Cincinnati, OH 45255 45255    7500000 2023-07-12
## 535                   1722 Wolfangel Rd 45255     110111 2023-06-22
##     num_of_bedrooms num_of_bathrooms year_built square_feet  lot_size
## 66                3                2       1951        1080 943030440
## 167               4                6       2016        7370    132422
## 535               3                1       1940       12170     12632
##     num_parking_spots month_sold house_age     cooks
## 66           1.798077          7        73 17.533746
## 167          1.000000          7         8  1.151670
## 535          2.000000          6        84  1.038217

Evaluating Results & Removing Outliers

After investigation, we see that the second house listed, 1722 Wolfangel Rd., was incorrectly captured. Our first steps is to correct this.

The other two are both true outliers. One being a high end home sold for 7.5 million dollars and the other being on a 943030440 lot size; both highly uncommon.

Once we correct the first, we can remove the 22 remaining outliers found using our residuals and cooks distance.

# Correct incorrect data
housing$square_feet[housing$address == "1722 Wolfangel Rd"] <- 1270

# Remove corrected data from outliers list 
housing_outliers <- housing_outliers %>%
  filter(address != "1722 Wolfangel Rd")

# Add Struble Rd. to outliers 
housing_outliers <- housing_outliers %>%
  rbind(c("2635 Struble Rd. Cincinnati, OH", 45231, 160000, "2023-07-10", 3, 2, 
          1951, 1080, 943030440, 2, 7, 73, NA))

# Remove outliers from housing data
clean_housing <- housing %>%
  filter(!(address %in% housing_outliers$address))

# Create new model 
housing_model2 <- lm(price_sold ~ num_of_bedrooms + num_of_bathrooms + 
                      square_feet + lot_size + num_parking_spots + house_age, 
                     data = clean_housing)

# Review new model 
summary(housing_model2)
## 
## Call:
## lm(formula = price_sold ~ num_of_bedrooms + num_of_bathrooms + 
##     square_feet + lot_size + num_parking_spots + house_age, data = clean_housing)
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -643581  -95423  -13986   74081  988217 
## 
## Coefficients:
##                     Estimate Std. Error t value Pr(>|t|)    
## (Intercept)       -1.094e+05  2.280e+04  -4.796  1.8e-06 ***
## num_of_bedrooms   -1.968e+04  6.787e+03  -2.900  0.00379 ** 
## num_of_bathrooms   9.000e+04  7.231e+03  12.446  < 2e-16 ***
## square_feet        1.307e+02  6.991e+00  18.694  < 2e-16 ***
## lot_size           6.569e-03  6.388e-03   1.028  0.30395    
## num_parking_spots  8.542e+03  5.481e+03   1.558  0.11936    
## house_age          1.847e+02  1.394e+02   1.325  0.18537    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 179700 on 1359 degrees of freedom
## Multiple R-squared:  0.625,  Adjusted R-squared:  0.6234 
## F-statistic: 377.5 on 6 and 1359 DF,  p-value: < 2.2e-16

Variable Selection

To determine which variables we should use in our model, we will walk through each of the 3 techniques to determine our potential models.

Adjusted R-Squared

When looking at the adjusted r-squared, we see the model with the highest adjusted r-squared would include all potential covariates and would give us a 62.32% adjusted r-squared. This means that we can explain 62.32% of the variability in our model. Since our this is the same as our second model we created, no new model will be created here.

However, when looking at our p-values, we see that lot size, number of parking spots, and house age all have greater than 5% indicating that we would likely encounter a type 1 error for these covariates using this model.

# Create a model for all potential combinations 
allModels <- leaps(x = clean_housing[,c(5:6, 8:10, 12)], y = clean_housing[,3], 
                   method = "adjr2")

# Combine the new model with the adjusted r-squared for a better visual
cbind(allModels$which, adjrsq = allModels$adjr2)
##   1 2 3 4 5 6      adjrsq
## 1 0 0 1 0 0 0 0.578668556
## 1 0 1 0 0 0 0 0.514210635
## 1 1 0 0 0 0 0 0.220757580
## 1 0 0 0 0 1 0 0.113732220
## 1 0 0 0 0 0 1 0.028689108
## 1 0 0 0 1 0 0 0.004691932
## 2 0 1 1 0 0 0 0.620963018
## 2 0 0 1 0 0 1 0.580318909
## 2 0 0 1 0 1 0 0.580306517
## 2 0 0 1 1 0 0 0.578613268
## 2 1 0 1 0 0 0 0.578380785
## 2 0 1 0 0 1 0 0.521802117
## 2 1 1 0 0 0 0 0.516953243
## 2 0 1 0 0 0 1 0.515633047
## 2 0 1 0 1 0 0 0.515615676
## 2 1 0 0 0 1 0 0.271141182
## 3 1 1 1 0 0 0 0.622836599
## 3 0 1 1 0 1 0 0.621317501
## 3 0 1 1 1 0 0 0.621106795
## 3 0 1 1 0 0 1 0.620794889
## 3 0 0 1 0 1 1 0.581281670
## 3 0 0 1 1 0 1 0.580164420
## 3 0 0 1 1 1 0 0.580081922
## 3 1 0 1 0 0 1 0.580052550
## 3 1 0 1 0 1 0 0.580011995
## 3 1 0 1 1 0 0 0.578329066
## 4 1 1 1 0 1 0 0.623190011
## 4 1 1 1 1 0 0 0.622944711
## 4 1 1 1 0 0 1 0.622808914
## 4 0 1 1 1 1 0 0.621320048
## 4 0 1 1 0 1 1 0.621284137
## 4 0 1 1 1 0 1 0.620982152
## 4 0 0 1 1 1 1 0.581028308
## 4 1 0 1 0 1 1 0.581002963
## 4 1 0 1 1 0 1 0.579901293
## 4 1 0 1 1 1 0 0.579789019
## 5 1 1 1 0 1 1 0.623357027
## 5 1 1 1 1 1 0 0.623163675
## 5 1 1 1 1 0 1 0.622977308
## 5 0 1 1 1 1 1 0.621320860
## 5 1 0 1 1 1 1 0.580751344
## 5 1 1 0 1 1 1 0.526869388
## 6 1 1 1 1 1 1 0.623372977
# Look at the summary of the model with the largest adjusted r-squared
summary(lm(price_sold ~ num_of_bedrooms + num_of_bathrooms + 
                      square_feet + lot_size + num_parking_spots + house_age, 
                     data = clean_housing)) 
## 
## Call:
## lm(formula = price_sold ~ num_of_bedrooms + num_of_bathrooms + 
##     square_feet + lot_size + num_parking_spots + house_age, data = clean_housing)
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -643581  -95423  -13986   74081  988217 
## 
## Coefficients:
##                     Estimate Std. Error t value Pr(>|t|)    
## (Intercept)       -1.094e+05  2.280e+04  -4.796  1.8e-06 ***
## num_of_bedrooms   -1.968e+04  6.787e+03  -2.900  0.00379 ** 
## num_of_bathrooms   9.000e+04  7.231e+03  12.446  < 2e-16 ***
## square_feet        1.307e+02  6.991e+00  18.694  < 2e-16 ***
## lot_size           6.569e-03  6.388e-03   1.028  0.30395    
## num_parking_spots  8.542e+03  5.481e+03   1.558  0.11936    
## house_age          1.847e+02  1.394e+02   1.325  0.18537    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 179700 on 1359 degrees of freedom
## Multiple R-squared:  0.625,  Adjusted R-squared:  0.6234 
## F-statistic: 377.5 on 6 and 1359 DF,  p-value: < 2.2e-16

Stepwise Regression - Forward Selection

When using stepwise regression (forward selection), we take the approach of starting with an empty model and adding independent variables based on the results we see. Here, we see that the convariates number of bathrooms, number of bedrooms, and square feet are the best performers. The p-values for lot size, number of parking spots, and house age are greater than 5%, we hold off from adding any additional covariates to our new model, model 3.

# Start with an empty model 
add1(lm(price_sold ~ 1, data = clean_housing), price_sold ~ num_of_bedrooms + 
       num_of_bathrooms + square_feet + lot_size + num_parking_spots + 
       house_age, test = "F")
## Single term additions
## 
## Model:
## price_sold ~ 1
##                   Df  Sum of Sq        RSS   AIC   F value    Pr(>F)    
## <none>                          1.1705e+14 34390                        
## num_of_bedrooms    1 2.5906e+13 9.1142e+13 34050  387.7014 < 2.2e-16 ***
## num_of_bathrooms   1 6.0229e+13 5.6819e+13 33404 1445.8598 < 2.2e-16 ***
## square_feet        1 6.7768e+13 4.9280e+13 33210 1875.7297 < 2.2e-16 ***
## lot_size           1 6.3453e+11 1.1641e+14 34384    7.4347   0.00648 ** 
## num_parking_spots  1 1.3388e+13 1.0366e+14 34226  176.1666 < 2.2e-16 ***
## house_age          1 3.4413e+12 1.1361e+14 34351   41.3173 1.785e-10 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
# Add the covariate with the highest f-value and lowest p-value and repeat 
add1(lm(price_sold ~ square_feet, data = clean_housing), price_sold ~ num_of_bedrooms + 
       num_of_bathrooms + square_feet + lot_size + num_parking_spots + 
       house_age, test = "F")
## Single term additions
## 
## Model:
## price_sold ~ square_feet
##                   Df  Sum of Sq        RSS   AIC  F value  Pr(>F)    
## <none>                          4.9280e+13 33210                     
## num_of_bedrooms    1 2.4952e+09 4.9277e+13 33212   0.0690 0.79281    
## num_of_bathrooms   1 4.9793e+12 4.4300e+13 33066 153.2006 < 2e-16 ***
## lot_size           1 2.9667e+10 4.9250e+13 33211   0.8210 0.36504    
## num_parking_spots  1 2.2757e+11 4.9052e+13 33206   6.3234 0.01203 *  
## house_age          1 2.2902e+11 4.9051e+13 33206   6.3638 0.01176 *  
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
# Add the next covariate with the highest f-value and lowest p-value and repeat 
add1(lm(price_sold ~ square_feet + num_of_bathrooms, data = clean_housing), 
     price_sold ~ num_of_bedrooms + num_of_bathrooms + square_feet + lot_size + 
       num_parking_spots + house_age, test = "F")
## Single term additions
## 
## Model:
## price_sold ~ square_feet + num_of_bathrooms
##                   Df  Sum of Sq        RSS   AIC F value   Pr(>F)   
## <none>                          4.4300e+13 33066                    
## num_of_bedrooms    1 2.5132e+11 4.4049e+13 33061  7.7708 0.005384 **
## lot_size           1 4.9294e+10 4.4251e+13 33067  1.5172 0.218255   
## num_parking_spots  1 7.3902e+10 4.4226e+13 33066  2.2759 0.131631   
## house_age          1 1.2866e+10 4.4287e+13 33068  0.3957 0.529432   
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
# Add the next covariate with the highest f-value and lowest p-value and repeat 
add1(lm(price_sold ~ square_feet + num_of_bathrooms + num_of_bedrooms, 
        data = clean_housing), price_sold ~ num_of_bedrooms + num_of_bathrooms + 
       square_feet + lot_size + num_parking_spots + house_age, test = "F")
## Single term additions
## 
## Model:
## price_sold ~ square_feet + num_of_bathrooms + num_of_bedrooms
##                   Df  Sum of Sq        RSS   AIC F value Pr(>F)
## <none>                          4.4049e+13 33061               
## lot_size           1 4.4959e+10 4.4004e+13 33061  1.3905 0.2385
## num_parking_spots  1 7.3586e+10 4.3975e+13 33060  2.2774 0.1315
## house_age          1 2.9111e+10 4.4020e+13 33062  0.9000 0.3429
# Create a model for the selected covariates
summary(lm(price_sold ~ square_feet + num_of_bathrooms + num_of_bedrooms, 
        data = clean_housing))
## 
## Call:
## lm(formula = price_sold ~ square_feet + num_of_bathrooms + num_of_bedrooms, 
##     data = clean_housing)
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -639756  -95345  -14342   73654  990772 
## 
## Coefficients:
##                    Estimate Std. Error t value Pr(>|t|)    
## (Intercept)      -85198.344  18285.022  -4.659 3.48e-06 ***
## square_feet         133.825      6.832  19.587  < 2e-16 ***
## num_of_bathrooms  88131.166   6931.618  12.714  < 2e-16 ***
## num_of_bedrooms  -18809.275   6747.451  -2.788  0.00538 ** 
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 179800 on 1362 degrees of freedom
## Multiple R-squared:  0.6237, Adjusted R-squared:  0.6228 
## F-statistic: 752.4 on 3 and 1362 DF,  p-value: < 2.2e-16
housing_model3 <- lm(price_sold ~ square_feet + num_of_bathrooms + num_of_bedrooms, 
        data = clean_housing)

Stepwise Regression - Backward Selection

When using stepwise regression (backward selection), we take the approach of starting with a complete model and removing independent variables based on the results we see. Here, we see that the same covariates of number of bathrooms, number of bedrooms, and square feet are the winner so we continue with model 3.

# Start with a full model
drop1(lm(price_sold ~ num_of_bedrooms + num_of_bathrooms + 
                      square_feet + lot_size + num_parking_spots + house_age, 
                    data = clean_housing), test = "F")
## Single term deletions
## 
## Model:
## price_sold ~ num_of_bedrooms + num_of_bathrooms + square_feet + 
##     lot_size + num_parking_spots + house_age
##                   Df  Sum of Sq        RSS   AIC  F value    Pr(>F)    
## <none>                          4.3889e+13 33062                       
## num_of_bedrooms    1 2.7161e+11 4.4161e+13 33068   8.4102  0.003791 ** 
## num_of_bathrooms   1 5.0028e+12 4.8892e+13 33207 154.9067 < 2.2e-16 ***
## square_feet        1 1.1286e+13 5.5176e+13 33372 349.4744 < 2.2e-16 ***
## lot_size           1 3.4156e+10 4.3924e+13 33061   1.0576  0.303947    
## num_parking_spots  1 7.8438e+10 4.3968e+13 33062   2.4288  0.119360    
## house_age          1 5.6704e+10 4.3946e+13 33061   1.7558  0.185373    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
# Remove the covariates with the lowest f-value and highest p-value and repeat
drop1(lm(price_sold ~ num_of_bedrooms + num_of_bathrooms + 
                      square_feet + num_parking_spots + house_age, 
                    data = housing), test = "F")
## Single term deletions
## 
## Model:
## price_sold ~ num_of_bedrooms + num_of_bathrooms + square_feet + 
##     num_parking_spots + house_age
##                   Df  Sum of Sq        RSS   AIC  F value    Pr(>F)    
## <none>                          1.2059e+14 34973                       
## num_of_bedrooms    1 1.9964e+12 1.2259e+14 34993  22.8796 1.909e-06 ***
## num_of_bathrooms   1 5.4026e+12 1.2599e+14 35031  61.9167 7.181e-15 ***
## square_feet        1 3.4219e+13 1.5481e+14 35317 392.1690 < 2.2e-16 ***
## num_parking_spots  1 7.1055e+10 1.2066e+14 34971   0.8143    0.3670    
## house_age          1 1.4646e+10 1.2060e+14 34971   0.1679    0.6821    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
# Remove the next covariates with the lowest f-value and highest p-value and repeat
drop1(lm(price_sold ~ num_of_bedrooms + num_of_bathrooms + square_feet + 
           num_parking_spots, data = clean_housing), test = "F")
## Single term deletions
## 
## Model:
## price_sold ~ num_of_bedrooms + num_of_bathrooms + square_feet + 
##     num_parking_spots
##                   Df  Sum of Sq        RSS   AIC  F value    Pr(>F)    
## <none>                          4.3975e+13 33060                       
## num_of_bedrooms    1 2.5100e+11 4.4226e+13 33066   7.7683  0.005391 ** 
## num_of_bathrooms   1 5.0751e+12 4.9051e+13 33208 157.0693 < 2.2e-16 ***
## square_feet        1 1.1616e+13 5.5592e+13 33379 359.5184 < 2.2e-16 ***
## num_parking_spots  1 7.3586e+10 4.4049e+13 33061   2.2774  0.131502    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
# Remove the next covariates with the lowest f-value and highest p-value and repeat
drop1(lm(price_sold ~ num_of_bedrooms + num_of_bathrooms + 
                      square_feet, data = clean_housing), test = "F")
## Single term deletions
## 
## Model:
## price_sold ~ num_of_bedrooms + num_of_bathrooms + square_feet
##                  Df  Sum of Sq        RSS   AIC  F value    Pr(>F)    
## <none>                         4.4049e+13 33061                       
## num_of_bedrooms   1 2.5132e+11 4.4300e+13 33066   7.7708  0.005384 ** 
## num_of_bathrooms  1 5.2282e+12 4.9277e+13 33212 161.6552 < 2.2e-16 ***
## square_feet       1 1.2408e+13 5.6457e+13 33398 383.6432 < 2.2e-16 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
#Create a model for the selected covariates - Same as forward approach 
summary(lm(price_sold ~ num_of_bedrooms + num_of_bathrooms + 
                      square_feet, data = housing))
## 
## Call:
## lm(formula = price_sold ~ num_of_bedrooms + num_of_bathrooms + 
##     square_feet, data = housing)
## 
## Residuals:
##      Min       1Q   Median       3Q      Max 
## -1200674  -112274   -11350    87062  5781909 
## 
## Coefficients:
##                    Estimate Std. Error t value Pr(>|t|)    
## (Intercept)      -108876.42   29744.32  -3.660 0.000261 ***
## num_of_bedrooms   -51965.48   10877.42  -4.777 1.96e-06 ***
## num_of_bathrooms   88364.14   11051.65   7.996 2.70e-15 ***
## square_feet          204.16      10.15  20.117  < 2e-16 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 295300 on 1384 degrees of freedom
## Multiple R-squared:  0.5516, Adjusted R-squared:  0.5507 
## F-statistic: 567.6 on 3 and 1384 DF,  p-value: < 2.2e-16

Multilinear Regression

Create Models

Below is a summary of the models we have created up to this point. We will be validating each of these models in the next section to determine which of our models is the best predictor of our housing sale price.

Model 1: All covariates and original housing data

# Contains all covariates and original housing data (resolved NA values)
summary(housing_model1)
## 
## Call:
## lm(formula = price_sold ~ num_of_bedrooms + num_of_bathrooms + 
##     square_feet + lot_size + num_parking_spots + house_age, data = housing)
## 
## Residuals:
##      Min       1Q   Median       3Q      Max 
## -1910181  -116738   -12530    89325  5835847 
## 
## Coefficients:
##                     Estimate Std. Error t value Pr(>|t|)    
## (Intercept)       -1.386e+05  3.716e+04  -3.729   0.0002 ***
## num_of_bedrooms   -4.601e+04  1.112e+04  -4.139  3.7e-05 ***
## num_of_bathrooms   1.115e+05  1.135e+04   9.819  < 2e-16 ***
## square_feet        1.793e+02  9.841e+00  18.219  < 2e-16 ***
## lot_size           2.146e-05  3.189e-04   0.067   0.9464    
## num_parking_spots -4.712e+03  8.883e+03  -0.531   0.5958    
## house_age          1.534e+02  2.294e+02   0.669   0.5037    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 300600 on 1381 degrees of freedom
## Multiple R-squared:  0.5364, Adjusted R-squared:  0.5343 
## F-statistic: 266.3 on 6 and 1381 DF,  p-value: < 2.2e-16
# Plot model1
plot(housing_model1)

Model 2: All covariates and cleaned housing data (resolved outliers)

This model was also selected as part of our variable selection using our adjusted r-squared.

# Contains all covariates and cleaned housing data (resolved outliers)
summary(housing_model2)
## 
## Call:
## lm(formula = price_sold ~ num_of_bedrooms + num_of_bathrooms + 
##     square_feet + lot_size + num_parking_spots + house_age, data = clean_housing)
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -643581  -95423  -13986   74081  988217 
## 
## Coefficients:
##                     Estimate Std. Error t value Pr(>|t|)    
## (Intercept)       -1.094e+05  2.280e+04  -4.796  1.8e-06 ***
## num_of_bedrooms   -1.968e+04  6.787e+03  -2.900  0.00379 ** 
## num_of_bathrooms   9.000e+04  7.231e+03  12.446  < 2e-16 ***
## square_feet        1.307e+02  6.991e+00  18.694  < 2e-16 ***
## lot_size           6.569e-03  6.388e-03   1.028  0.30395    
## num_parking_spots  8.542e+03  5.481e+03   1.558  0.11936    
## house_age          1.847e+02  1.394e+02   1.325  0.18537    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 179700 on 1359 degrees of freedom
## Multiple R-squared:  0.625,  Adjusted R-squared:  0.6234 
## F-statistic: 377.5 on 6 and 1359 DF,  p-value: < 2.2e-16
# Plot model2
plot(housing_model2)

Model 3: Stepwise variable selection and cleaned housing data

This model selected using both the forward and backward approach of the stepwise variable selection process.

# Adjusted r-squared variable selection 
summary(housing_model3)
## 
## Call:
## lm(formula = price_sold ~ square_feet + num_of_bathrooms + num_of_bedrooms, 
##     data = clean_housing)
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -639756  -95345  -14342   73654  990772 
## 
## Coefficients:
##                    Estimate Std. Error t value Pr(>|t|)    
## (Intercept)      -85198.344  18285.022  -4.659 3.48e-06 ***
## square_feet         133.825      6.832  19.587  < 2e-16 ***
## num_of_bathrooms  88131.166   6931.618  12.714  < 2e-16 ***
## num_of_bedrooms  -18809.275   6747.451  -2.788  0.00538 ** 
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 179800 on 1362 degrees of freedom
## Multiple R-squared:  0.6237, Adjusted R-squared:  0.6228 
## F-statistic: 752.4 on 3 and 1362 DF,  p-value: < 2.2e-16
# Plot model3
plot(housing_model3)

Model Validation

The below model validation will be done for each of the models we created in order to see how they perform throughout the validation process.

Adjusted R-Squared: Our adjusted r-squared indicates how much variability we can explain in our model.

Model 1:

We can explain 53.43% of the variability in model 1.

# Adjusted r-squared 
summary(housing_model1)$adj.r.squared
## [1] 0.5343469

Model 2:

We can explain 62.32% of the variability in model 2.

# Adjusted r-squared 
summary(housing_model2)$adj.r.squared
## [1] 0.623373

Model 3:

We can explain 62.28% of the variability in model 3.

# Adjusted r-squared 
summary(housing_model3)$adj.r.squared
## [1] 0.6228366

Hypothesis Testing: Hypothesis testing determines the probability that we will incur a type 1 error. Generally, if greater than 5%, we are likely to incur a type 1 error.

Model 1:

All of our covariates except for lot size, number of parking spots, and house age are less than 5%. Those lower than 5% we can say we are unlikely to incur a type 1 error.

# Hypothesis testing
summary(housing_model1)$coefficients[,4] 
##       (Intercept)   num_of_bedrooms  num_of_bathrooms       square_feet 
##      2.002805e-04      3.700219e-05      4.828470e-22      1.239074e-66 
##          lot_size num_parking_spots         house_age 
##      9.463535e-01      5.958491e-01      5.037049e-01

Model 2:

All of our covariates except for lot size, number of parking spots, and house age are less than 5%. Those lower than 5% we can say we are unlikely to incur a type 1 error.

# Hypothesis testing
summary(housing_model2)$coefficients[,4] 
##       (Intercept)   num_of_bedrooms  num_of_bathrooms       square_feet 
##      1.797664e-06      3.791235e-03      9.392577e-34      1.392432e-69 
##          lot_size num_parking_spots         house_age 
##      3.039470e-01      1.193601e-01      1.853734e-01

Model 3:

All of our covariates are less than 5% so this model is unlikely to incur a type 1 error.

# Hypothesis testing
summary(housing_model3)$coefficients[,4] 
##      (Intercept)      square_feet num_of_bathrooms  num_of_bedrooms 
##     3.480713e-06     1.843271e-75     4.446722e-35     5.383603e-03

Confidence Interval: Confidence intervals tell us the range of of values in which we can be 95% confident that our true slope falls within the range.

Model 1:

All of our covariates have a small, all positive or all negative range indicating that we have a strong prediction of the range of our true slope. However, lot size, number of parking spots, and house age all contain zero - a big red flag. This is not unexpected as these 3 covariates also had a high probability of incurring a type 1 error during hypothesis testing.

# confidence interval 
confint(housing_model1, level = 0.95)
##                           2.5 %        97.5 %
## (Intercept)       -2.114540e+05 -6.566134e+04
## num_of_bedrooms   -6.781346e+04 -2.420200e+04
## num_of_bathrooms   8.920665e+04  1.337514e+05
## square_feet        1.599833e+02  1.985920e+02
## lot_size          -6.041123e-04  6.470350e-04
## num_parking_spots -2.213698e+04  1.271255e+04
## house_age         -2.965471e+02  6.033836e+02

Model 2:

All of our covariates have a small, all positive or all negative range indicating that we have a strong prediction of the range of our true slope. However, lot size, number of parking spots, and house age again all contain zero like we saw in model 1.

# confidence interval
confint(housing_model2, level = 0.95)
##                           2.5 %        97.5 %
## (Intercept)       -1.540905e+05 -6.462690e+04
## num_of_bedrooms   -3.299851e+04 -6.368748e+03
## num_of_bathrooms   7.581592e+04  1.041873e+05
## square_feet        1.169733e+02  1.444011e+02
## lot_size          -5.961750e-03  1.909992e-02
## num_parking_spots -2.210408e+03  1.929503e+04
## house_age         -8.876388e+01  4.582535e+02

Model 3:

All of our covariates have a medium, all positive or all negative range indicating that we have a good prediction of the range of our true slope.

# confidence interval
confint(housing_model3, level = 0.95)
##                         2.5 %      97.5 %
## (Intercept)      -121068.2051 -49328.4829
## square_feet          120.4216    147.2279
## num_of_bathrooms   74533.3604 101728.9719
## num_of_bedrooms   -32045.7990  -5572.7506

Standard Error: Standard error gives us insight into the variability we would expect as we add more data.

Model 1:

In model 1, we should expect to see high variability for all of our covariates except for square feet (5.47%) and number of bathrooms (10.18%) as we add more data. All other covariates have 24% or higher variability which is not terrible, but not ideal.

# Standard error 
summary(housing_model1)$coefficients[,1:2]
##                        Estimate   Std. Error
## (Intercept)       -1.385577e+05 3.716009e+04
## num_of_bedrooms   -4.600773e+04 1.111583e+04
## num_of_bathrooms   1.114790e+05 1.135370e+04
## square_feet        1.792876e+02 9.840704e+00
## lot_size           2.146135e-05 3.188963e-04
## num_parking_spots -4.712217e+03 8.882558e+03
## house_age          1.534182e+02 2.293772e+02
# Intercept 
3.719776e+04 / 1.373595e+05 
## [1] 0.2708059
# Num of bedrooms 
1.111569e+04 / 4.596541e+04
## [1] 0.2418273
# Num of bathrooms 
1.135088e+04 / 1.115209e+05 
## [1] 0.1017825
# Square feet 
9.825128e+00 / 1.794136e+02
## [1] 0.05476245
# Lot size
3.189049e-04 / 2.271410e-05
## [1] 14.03995
# Number of parking spots
8.760708e+03 / 5.483070e+03
## [1] 1.597774
# House age
2.286712e+02 / 1.515446e+02
## [1] 1.508937

Model 2:

In model 2, we should expect to see high variability for all of our covariates except for square feet (5.3%), number of bathrooms (8.05%), and lot size (10.39%) as we add more data. All other covariates have 21% or higher variability which is not terrible, but not ideal.

# Standard error 
summary(housing_model2)$coefficients[,1:2]
##                        Estimate   Std. Error
## (Intercept)       -1.093587e+05 2.280245e+04
## num_of_bedrooms   -1.968363e+04 6.787380e+03
## num_of_bathrooms   9.000160e+04 7.231279e+03
## square_feet        1.306872e+02 6.990775e+00
## lot_size           6.569087e-03 6.387708e-03
## num_parking_spots  8.542312e+03 5.481296e+03
## house_age          1.847448e+02 1.394235e+02
# Intercept 
2.282842e+04 / 1.078097e+05
## [1] 0.2117474
# Num of bedrooms 
6.789224e+03 / 1.966124e+04
## [1] 0.3453101
# Num of bathrooms 
7.232142e+03 / 9.009630e+04
## [1] 0.08027124
# Square feet 
6.981615e+00 / 1.310689e+02
## [1] 0.05326676
# Lot size
1.907181e-04 / 1.835479e-05
## [1] 10.39064
# Number of parking spots
5.400466e+03 / 7.196672e+03
## [1] 0.7504116
# House age
1.758936e+02 / 1.390504e+02
## [1] 1.264963

Model 3:

In model 3, we should expect to see low variability for all of our covariates except for number of bedrooms which is high at 53.87%.

# Standard error 
summary(housing_model3)$coefficients[,1:2]
##                     Estimate   Std. Error
## (Intercept)      -85198.3440 18285.022322
## square_feet         133.8248     6.832392
## num_of_bathrooms  88131.1662  6931.618169
## num_of_bedrooms  -18809.2748  6747.451279
# Intercept 
18285.022322 / 85198.3440
## [1] 0.2146171
# Square feet
6.832392 / 133.8248
## [1] 0.05105475
# Num of bathrooms 
6931.618169 / 88131.1662
## [1] 0.07865116
# Num of bedrooms 
6747.451279 / 18809.2748
## [1] 0.35873

multicollinearity

Multicollinearity checks for non-linear dependencies among our regression variables and implies near-linear dependencies among the regressors.

Although we do see some trends that could indicate multicollinearity, once we look closed and look at the variance of inflation factor we see that our numbers are still under 5, indicating there is not multicollinear relationship.

# Visualize data sets - housing data  
pairs(housing[c(3,5:6,8:10,12)], pch = 20)

# Model summary 
summary(housing_model1)
## 
## Call:
## lm(formula = price_sold ~ num_of_bedrooms + num_of_bathrooms + 
##     square_feet + lot_size + num_parking_spots + house_age, data = housing)
## 
## Residuals:
##      Min       1Q   Median       3Q      Max 
## -1910181  -116738   -12530    89325  5835847 
## 
## Coefficients:
##                     Estimate Std. Error t value Pr(>|t|)    
## (Intercept)       -1.386e+05  3.716e+04  -3.729   0.0002 ***
## num_of_bedrooms   -4.601e+04  1.112e+04  -4.139  3.7e-05 ***
## num_of_bathrooms   1.115e+05  1.135e+04   9.819  < 2e-16 ***
## square_feet        1.793e+02  9.841e+00  18.219  < 2e-16 ***
## lot_size           2.146e-05  3.189e-04   0.067   0.9464    
## num_parking_spots -4.712e+03  8.883e+03  -0.531   0.5958    
## house_age          1.534e+02  2.294e+02   0.669   0.5037    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 300600 on 1381 degrees of freedom
## Multiple R-squared:  0.5364, Adjusted R-squared:  0.5343 
## F-statistic: 266.3 on 6 and 1381 DF,  p-value: < 2.2e-16
# Visualize data sets - cleaned housing data  
pairs(clean_housing[c(3,5:6,8:10,12)], pch = 20)

# Model summary 
summary(housing_model2)
## 
## Call:
## lm(formula = price_sold ~ num_of_bedrooms + num_of_bathrooms + 
##     square_feet + lot_size + num_parking_spots + house_age, data = clean_housing)
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -643581  -95423  -13986   74081  988217 
## 
## Coefficients:
##                     Estimate Std. Error t value Pr(>|t|)    
## (Intercept)       -1.094e+05  2.280e+04  -4.796  1.8e-06 ***
## num_of_bedrooms   -1.968e+04  6.787e+03  -2.900  0.00379 ** 
## num_of_bathrooms   9.000e+04  7.231e+03  12.446  < 2e-16 ***
## square_feet        1.307e+02  6.991e+00  18.694  < 2e-16 ***
## lot_size           6.569e-03  6.388e-03   1.028  0.30395    
## num_parking_spots  8.542e+03  5.481e+03   1.558  0.11936    
## house_age          1.847e+02  1.394e+02   1.325  0.18537    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 179700 on 1359 degrees of freedom
## Multiple R-squared:  0.625,  Adjusted R-squared:  0.6234 
## F-statistic: 377.5 on 6 and 1359 DF,  p-value: < 2.2e-16
summary(housing_model3)
## 
## Call:
## lm(formula = price_sold ~ square_feet + num_of_bathrooms + num_of_bedrooms, 
##     data = clean_housing)
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -639756  -95345  -14342   73654  990772 
## 
## Coefficients:
##                    Estimate Std. Error t value Pr(>|t|)    
## (Intercept)      -85198.344  18285.022  -4.659 3.48e-06 ***
## square_feet         133.825      6.832  19.587  < 2e-16 ***
## num_of_bathrooms  88131.166   6931.618  12.714  < 2e-16 ***
## num_of_bedrooms  -18809.275   6747.451  -2.788  0.00538 ** 
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 179800 on 1362 degrees of freedom
## Multiple R-squared:  0.6237, Adjusted R-squared:  0.6228 
## F-statistic: 752.4 on 3 and 1362 DF,  p-value: < 2.2e-16
# Correlation of variables 
cor(housing[c(3,5:6,8:10,12)])
##                    price_sold num_of_bedrooms num_of_bathrooms square_feet
## price_sold         1.00000000     0.408165815       0.64818202   0.7267966
## num_of_bedrooms    0.40816581     1.000000000       0.60524973   0.6177780
## num_of_bathrooms   0.64818202     0.605249732       1.00000000   0.7836840
## square_feet        0.72679661     0.617777980       0.78368405   1.0000000
## lot_size          -0.01312973    -0.008931345      -0.01292244  -0.0209228
## num_parking_spots  0.28999525     0.274513383       0.37901112   0.4050623
## house_age         -0.14466964    -0.061212050      -0.28241176  -0.1546785
##                        lot_size num_parking_spots     house_age
## price_sold        -0.0131297286       0.289995253 -0.1446696355
## num_of_bedrooms   -0.0089313445       0.274513383 -0.0612120503
## num_of_bathrooms  -0.0129224440       0.379011117 -0.2824117625
## square_feet       -0.0209227956       0.405062296 -0.1546784652
## lot_size           1.0000000000       0.005288107 -0.0005541334
## num_parking_spots  0.0052881068       1.000000000 -0.2553295961
## house_age         -0.0005541334      -0.255329596  1.0000000000
cor(clean_housing[c(3,5:6,8:10,12)])
##                    price_sold num_of_bedrooms num_of_bathrooms square_feet
## price_sold         1.00000000      0.47045558       0.71733292  0.76090553
## num_of_bedrooms    0.47045558      1.00000000       0.59342185  0.61349195
## num_of_bathrooms   0.71733292      0.59342185       1.00000000  0.76967951
## square_feet        0.76090553      0.61349195       0.76967951  1.00000000
## lot_size           0.07362809      0.02705712       0.04423361  0.07590112
## num_parking_spots  0.33820334      0.25530854       0.35539065  0.39114299
## house_age         -0.17146630     -0.07081886      -0.29516802 -0.16803897
##                      lot_size num_parking_spots   house_age
## price_sold         0.07362809         0.3382033 -0.17146630
## num_of_bedrooms    0.02705712         0.2553085 -0.07081886
## num_of_bathrooms   0.04423361         0.3553907 -0.29516802
## square_feet        0.07590112         0.3911430 -0.16803897
## lot_size           1.00000000         0.1733433 -0.09229007
## num_parking_spots  0.17334326         1.0000000 -0.25595055
## house_age         -0.09229007        -0.2559506  1.00000000
# Variance inflation factor
vif <- function(mod, ...) {
  if (any(is.na(coef(mod)))) 
    stop("there are aliased coefficients in the model")
  v <- vcov(mod)
  assign <- attr(model.matrix(mod), "assign")
  if (names(coefficients(mod)[1]) == "(Intercept)") {
    v <- v[-1, -1]
    assign <- assign[-1]
  }
  else warning("No intercept: vifs may not be sensible.")
  terms <- labels(terms(mod))
  n.terms <- length(terms)
  if (n.terms < 2) stop("model contains fewer than 2 terms")
  R <- cov2cor(v)
  detR <- det(R)
  result <- matrix(0, n.terms, 3)
  rownames(result) <- terms
  colnames(result) <- c("GVIF", "Df", "GVIF^(1/(2*Df))")
  for (term in 1:n.terms) {
    subs <- which(assign == term)
    result[term, 1] <- det(as.matrix(R[subs, subs])) *
      det(as.matrix(R[-subs, -subs])) / detR
    result[term, 2] <- length(subs)
  }
  if (all(result[, 2] == 1)) result <- result[, 1]
  else result[, 3] <- result[, 1]^(1/(2 * result[, 2]))
  result
}
vif(housing_model1)
##   num_of_bedrooms  num_of_bathrooms       square_feet          lot_size 
##          1.736424          2.812369          2.673052          1.000662 
## num_parking_spots         house_age 
##          1.255516          1.157981
vif(housing_model2)
##   num_of_bedrooms  num_of_bathrooms       square_feet          lot_size 
##          1.724578          2.838031          2.836030          1.036563 
## num_parking_spots         house_age 
##          1.264158          1.167772
vif(housing_model3)
##      square_feet num_of_bathrooms  num_of_bedrooms 
##         2.705127         2.603983         1.701923

Predictions

For all of our predictions we will be using a k-fold to pull out a portion of our data to use as testing data to see how well our models can make predictions.

Model 1:

# K-fold
KCV1 = cv.lm(data = housing, housing_model1, m = 10, seed = 0)

## 
## fold 1 
## Observations in test set: 138 
##                     4         7        12        34        42        55
## Predicted   200161.89  608111.5 412054.45  66316.93 249824.94  438723.4
## cvpred      198438.47  607800.2 410952.12  68637.77 251980.98  429356.0
## price_sold  178000.00  275000.0 399000.00 230000.00 292000.00 1075000.0
## CV residual -20438.47 -332800.2 -11952.12 161362.23  40019.02  645644.0
##                    62        74       80       123       138      153       179
## Predicted    261588.2 253920.89 355453.5  430546.3  510783.3 117584.5 420940.19
## cvpred       265656.7 262248.92 354731.5  430612.1  515436.1 120919.6 432799.12
## price_sold   110000.0 355000.00 550000.0   63497.0   24000.0 225000.0 410000.00
## CV residual -155656.7  92751.08 195268.5 -367115.1 -491436.1 104080.4 -22799.12
##                   184       189       197       217      219     264       283
## Predicted   586373.56 567111.68 519223.26  470539.6 444324.2 1173680 358582.06
## cvpred      594682.08 554312.89 530345.01  464887.5 447816.6 1183320 353001.43
## price_sold  525000.00 566000.00 435000.00  297000.0 834900.0 2200000 276000.00
## CV residual -69682.08  11687.11 -95345.01 -167887.5 387083.4 1016680 -77001.43
##                  285      289       294       300       305       307       317
## Predicted   223469.9 407050.6  32622.17 1066915.2  991547.0  286156.7  385700.6
## cvpred      220784.2 418880.1  30132.68 1082320.8 1010589.6  290737.8  383960.0
## price_sold  244800.0 630000.0 155000.00  565000.0  600000.0  178000.0  224000.0
## CV residual  24015.8 211119.9 124867.32 -517320.8 -410589.6 -112737.8 -159960.0
##                  328      342       348       371       380       381     386
## Predicted    1520476 337619.0  445051.7  367691.4  481955.4  804914.0 1080062
## cvpred       1578159 341566.4  444245.9  373997.0  485846.0  818467.1 1107413
## price_sold    350000 387500.0  331500.0  192500.0  300000.0  700000.0 1425000
## CV residual -1228159  45933.6 -112745.9 -181497.0 -185846.0 -118467.1  317587
##                   391       406      410       431      432       452       458
## Predicted    884956.5 290921.88 774855.1  587399.7 192440.7 470666.00  225671.4
## cvpred       899826.5 296601.19 784591.9  608389.2 199995.1 463533.64  238476.4
## price_sold   525000.0 255000.00 999000.0  449500.0 183000.0 414000.00   50000.0
## CV residual -374826.5 -41601.19 214408.1 -158889.2 -16995.1 -49533.64 -188476.4
##                   461       478       491       493      503       505
## Predicted   283448.81  302602.1 165346.48  541794.6 333275.6 345141.37
## cvpred      277227.39  298841.6 160522.68  539637.4 329866.3 339057.66
## price_sold  288900.00  135000.0 215000.00  375000.0 500000.0 265000.00
## CV residual  11672.61 -163841.6  54477.32 -164637.4 170133.7 -74057.66
##                   520      525       529      558       576       598       601
## Predicted   421654.33 404436.1 334005.35 455473.7 367984.35  620460.6  365411.7
## cvpred      424087.95 405632.1 330604.22 448092.5 366119.17  630853.9  364207.0
## price_sold  410000.00 559000.0 320000.00 595000.0 305000.00  487000.0  200000.0
## CV residual -14087.95 153367.9 -10604.22 146907.5 -61119.17 -143853.9 -164207.0
##                   608       614       617        627       632       635
## Predicted   335996.31  471327.9  701019.1 331449.654 396967.19 188683.82
## cvpred      333370.66  477493.5  706452.2 326747.904 396490.53 200602.44
## price_sold  282000.00  289000.0  550000.0 325000.000 300000.00 188000.00
## CV residual -51370.66 -188493.5 -156452.2  -1747.904 -96490.53 -12602.44
##                   647      663       671      675      677       684       711
## Predicted    697549.8 339928.1  985485.8 287003.0 214694.8  714546.4 216948.20
## cvpred       707538.2 335898.0 1006482.6 293371.7 213941.2  739082.6 215478.66
## price_sold   246000.0 325000.0  749900.0 262500.0 380000.0  300000.0 184900.00
## CV residual -461538.2 -10898.0 -256582.6 -30871.7 166058.8 -439082.6 -30578.66
##                   717       722       733       736       741        756
## Predicted    561894.6 308997.23  713851.9  427777.3  559107.9 129726.606
## cvpred       568704.4 304996.99  728440.7  441591.8  574035.4 133614.975
## price_sold   440000.0 395000.00  155000.0  150000.0   38500.0 126000.000
## CV residual -128704.4  90003.01 -573440.7 -291591.8 -535535.4  -7614.975
##                   770       774       805      832       862       866      873
## Predicted   156877.53  366778.8  55729.86 102593.1 155632.72 165452.51 248937.6
## cvpred      155980.77  365557.0  57804.59 105118.0 162223.83 163911.93 252432.1
## price_sold  230000.00  260000.0 282525.00 265000.0 125000.00 140000.00 660000.0
## CV residual  74019.23 -105557.0 224720.41 159882.0 -37223.83 -23911.93 407567.9
##                   906       912       913       915       916       948
## Predicted   610273.17 209224.83 324588.35  49548.23 129160.13 190468.47
## cvpred      612329.14 210198.37 321206.19  49722.02 124669.29 190527.11
## price_sold  575000.00 270000.00 283900.00 143000.00 176500.00 230000.00
## CV residual -37329.14  59801.63 -37306.19  93277.98  51830.71  39472.89
##                   949       961      972       980       981       986
## Predicted   178218.81 337232.17 38754.23 203155.09 143128.47 135464.76
## cvpred      175603.59 345638.93 45105.81 201049.62 139082.25 130129.29
## price_sold  197000.00 253000.00 85000.00 121500.00  93000.00 199000.00
## CV residual  21396.41 -92638.93 39894.19 -79549.62 -46082.25  68870.71
##                   992       994      1010      1017      1028     1042
## Predicted   100774.71 148778.16 231520.67 371821.40 109756.09 125570.4
## cvpred      107611.85 147600.47 235650.67 372070.74 117250.84 130507.9
## price_sold  200000.00 194000.00 276670.00 410000.00 159000.00 457500.0
## CV residual  92388.15  46399.53  41019.33  37929.26  41749.16 326992.1
##                   1054       1057      1064      1068      1069      1070
## Predicted   203028.942 463052.568  469208.9  92058.88 371013.37 364709.64
## cvpred      201832.013 465163.436  467236.3  96959.86 365525.75 361324.48
## price_sold  193000.000 460000.000  333500.0 325000.00 319000.00 319900.00
## CV residual  -8832.013  -5163.436 -133736.3 228040.14 -46525.75 -41424.48
##                 1072      1078     1081      1083       1099     1100      1114
## Predicted   182194.6 356267.41 221513.2  367222.3 169408.307 320276.6 228589.64
## cvpred      186299.3 365390.29 224362.2  371330.8 167122.287 327144.2 228762.94
## price_sold  329000.0 350000.00 506000.0  130500.0 175000.000 461814.0 250000.00
## CV residual 142700.7 -15390.29 281637.8 -240830.8   7877.713 134669.8  21237.06
##                  1122     1124     1136      1142      1144      1145      1158
## Predicted   513147.34 387832.5 517312.0  45622.37 513482.45 195776.80 126609.43
## cvpred      517307.36 386364.3 514084.4  49894.31 520546.72 191584.39 131284.63
## price_sold  445500.00 465000.0 485000.0 200000.00 465000.00 255000.00  50000.00
## CV residual -71807.36  78635.7 -29084.4 150105.69 -55546.72  63415.61 -81284.63
##                  1159      1188      1195      1206      1209      1233
## Predicted   235836.89 191683.06 139081.28 165870.00 329803.43  228096.4
## cvpred      237740.36 202762.29 147460.01 164024.42 328639.17  232609.2
## price_sold  187000.00 191000.00 110650.00 190000.00 420000.00   86000.0
## CV residual -50740.36 -11762.29 -36810.01  25975.58  91360.83 -146609.2
##                  1243      1252    1255      1275      1278      1296
## Predicted    673233.2 472882.92  333041  206921.4 333356.92  59318.89
## cvpred       690362.2 466480.22  326034  206806.4 335974.49  61098.69
## price_sold   110000.0 535000.00  145000   85000.0 350000.00 162000.00
## CV residual -580362.2  68519.78 -181034 -121806.4  14025.51 100901.31
##                   1313      1315      1319      1325      1334      1354
## Predicted   227209.825 385888.04  479991.1 298501.26 266846.61  81871.92
## cvpred      226558.956 388016.46  483743.7 301558.75 266654.42  88051.23
## price_sold  220000.000 382500.00  221000.0 225000.00 214000.00 125000.00
## CV residual  -6558.956  -5516.46 -262743.7 -76558.75 -52654.42  36948.77
##                  1382      1385
## Predicted    443857.0 251977.41
## cvpred       459800.8 244231.71
## price_sold    70000.0 170000.00
## CV residual -389800.8 -74231.71
## 
## Sum of squares = 7.621504e+12    Mean square = 55228290830    n = 138 
## 
## fold 2 
## Observations in test set: 139 
##                     5         8         9         11       21        23
## Predicted    374942.0 628772.07 207039.52 382161.310 287158.1  47871.80
## cvpred       383440.7 616454.18 212191.15 343769.035 279036.9  49970.45
## price_sold   269900.0 680000.00 233000.00 341000.000 403000.0 110000.00
## CV residual -113540.7  63545.82  20808.85  -2769.035 123963.1  60029.55
##                    27       70       82        88        89       102     108
## Predicted    99367.54 203741.6 330946.1  519727.9  551079.5 435016.87 2419538
## cvpred       90858.19 214501.4 330629.9  526199.4  568064.1 449903.25 2333556
## price_sold  317500.00 535000.0 425000.0  259900.0  218900.0 525000.00 3500000
## CV residual 226641.81 320498.6  94370.1 -266299.4 -349164.1  75096.75 1166444
##                   113       117       120       128      147       151
## Predicted    752330.2 500878.54  304977.4  659373.1 464271.5  808863.9
## cvpred       743416.3 496704.21  317497.6  655874.8 452829.0  797845.7
## price_sold   615000.0 525000.00  205000.0  437000.0 615000.0  555000.0
## CV residual -128416.3  28295.79 -112497.6 -218874.8 162171.0 -242845.7
##                   156       157       169       173     175      177      199
## Predicted   337382.36  364997.2  644765.5  904472.0 1880205 215897.8 121119.3
## cvpred      336323.91  351092.2  643986.3  878830.2 1806481 217555.9 132636.7
## price_sold  415000.00  193000.0  415500.0  385000.0 3650000 485000.0 279000.0
## CV residual  78676.09 -158092.2 -228486.3 -493830.2 1843519 267444.1 146363.3
##                   203     210       212       235       249       259       263
## Predicted   549922.50 1610350  61486.18 1009391.1 387833.77 1365482.9  881552.8
## cvpred      545319.74 1554525  57414.61  976318.8 395327.71 1315611.2  876738.5
## price_sold  611000.00 2800000 290000.00 1300000.0 465000.00 1937500.0  585000.0
## CV residual  65680.26 1245475 232585.39  323681.2  69672.29  621888.8 -291738.5
##                   275      279       288       292       295       302
## Predicted    515661.2 221535.0 587288.89 331408.88 209310.76  910973.9
## cvpred       523182.3 219721.2 592260.01 344534.86 217841.16  906684.4
## price_sold   421500.0 275000.0 515000.00 355000.00 250000.00  490000.0
## CV residual -101682.3  55278.8 -77260.01  10465.14  32158.84 -416684.4
##                   311       322       334      387       422       427
## Predicted    862127.3 1399920.3 337619.04 862542.2  926259.8  739147.9
## cvpred       851008.7 1346509.2 343193.05 851624.6  911439.1  733824.4
## price_sold  1125000.0  518535.0 387500.00 940000.0 1305000.0  475000.0
## CV residual  273991.3 -827974.2  44306.95  88375.4  393560.9 -258824.4
##                   443       444       457       459       464       479
## Predicted   155605.07  738928.7 304175.64 257264.59  417423.8 1328437.8
## cvpred      163755.52  734695.8 302275.06 257438.02  408206.5 1293645.9
## price_sold  210000.00  499000.0 400000.00 207000.00  297000.0  799900.0
## CV residual  46244.48 -235695.8  97724.94 -50438.02 -111206.5 -493745.9
##                   492      500       516       526       545       556
## Predicted    730237.0 505835.3  716602.9 561198.02  75859.65 487821.82
## cvpred       730862.4 509084.7  703807.6 559685.75  76739.80 478465.61
## price_sold   530230.0 427000.0 1500100.0 608000.00 180000.00 555000.00
## CV residual -200632.4 -82084.7  796292.4  48314.25 103260.20  76534.39
##                   562       583       611       612       630       633
## Predicted    934947.7  479003.9 236811.00 421697.87  582139.9 133878.36
## cvpred       929085.6  474083.3 240540.83 418213.48  578554.0 128684.37
## price_sold  1058756.0  249900.0 226000.00 467000.00  260000.0 175000.00
## CV residual  129670.4 -224183.3 -14540.83  48786.52 -318554.0  46315.63
##                   636       638       643       652       693       695
## Predicted   355447.08 196582.46  81384.00 251982.72  434249.2 502133.51
## cvpred      365195.82 175521.69  72527.66 247845.28  430051.4 492510.28
## price_sold  331000.00 188000.00 146500.00 270000.00  269900.0 577000.00
## CV residual -34195.82  12478.31  73972.34  22154.72 -160151.4  84489.72
##                   699      700       707       709       715       716      726
## Predicted   283562.07 67322.25  608928.0 367433.26  444656.2  561894.6 461083.6
## cvpred      302178.46 64249.84  604452.3 380066.91  452787.5  549387.0 451569.1
## price_sold  360000.00 95000.00  415000.0 358000.00  324900.0  440000.0 815000.0
## CV residual  57821.54 30750.16 -189452.3 -22066.91 -127887.5 -109387.0 363430.9
##                    728       732       738      746      747       753
## Predicted   227545.650 213658.07 165513.48 271648.4 208947.6 299509.60
## cvpred      231313.753 204703.07 172790.59 265541.2 214596.9 288910.81
## price_sold  235000.000 218000.00 116500.00 286000.0 228000.0 229900.00
## CV residual   3686.247  13296.93 -56290.59  20458.8  13403.1 -59010.81
##                   754      758      768       792       801       803       808
## Predicted    432100.0 280806.0 213328.1 327598.62 173326.45  84430.70  20112.19
## cvpred       429586.3 274165.4 212511.1 336421.92 178073.73  83805.11  24542.50
## price_sold   190000.0 655000.0 159900.0 263000.00 223000.00 210000.00 155900.00
## CV residual -239586.3 380834.6 -52611.1 -73421.92  44926.27 126194.89 131357.50
##                   812       831       839       848        849      869
## Predicted   619728.34  404177.1 350083.53  442296.9   9783.395 200259.8
## cvpred      611695.19  404569.1 362841.79  424944.1  15704.594 201473.7
## price_sold  710000.00  263500.0 337000.00  276000.0 165000.000 379000.0
## CV residual  98304.81 -141069.1 -25841.79 -148944.1 149295.406 177526.3
##                  890       892       926       934      940       941       942
## Predicted   247102.8 316330.77 219240.41 142350.37 333304.1 106434.72 322596.19
## cvpred      248276.0 331009.47 222462.97 133718.78 327792.3 102872.72 313729.84
## price_sold  196000.0 280000.00 169000.00 146000.00 584900.0 185000.00 295000.00
## CV residual -52276.0 -51009.47 -53462.97  12281.22 257107.7  82127.28 -18729.84
##                  954       958       987      988     1003      1004      1016
## Predicted   147144.6  365022.6  510178.9 238077.2 353778.8 412052.40  78055.24
## cvpred      150543.5  371048.3  505566.4 237307.1 356836.6 406568.95  77800.37
## price_sold   79000.0  230000.0  232000.0 500000.0 575000.0 315000.00 135000.00
## CV residual -71543.5 -141048.3 -273566.4 262692.9 218163.4 -91568.95  57199.63
##                  1018       1020     1032     1035     1055      1060      1061
## Predicted    321560.3 140161.824 116896.9 109234.7 165299.8 263279.52 267210.75
## cvpred       317309.0 131387.054 107597.8 118591.6 172277.9 262383.44 265495.61
## price_sold   164000.0 135800.000 175000.0 320150.0 335000.0 346000.00 351000.00
## CV residual -153309.0   4412.946  67402.2 201558.4 162722.1  83616.56  85504.39
##                   1073      1088      1097      1098      1101      1140
## Predicted   315680.892 259062.41 219287.48 419984.74 263895.86 216191.70
## cvpred      304550.931 281226.27 210273.39 413342.33 278779.14 216956.64
## price_sold  310000.000 210000.00 187000.00 475000.00 230000.00 235000.00
## CV residual   5449.069 -71226.27 -23273.39  61657.67 -48779.14  18043.36
##                 1184     1192     1199      1226      1236      1242      1283
## Predicted   221382.5 168567.1 253404.9  553965.2 346965.68 201018.43 221150.31
## cvpred      221167.2 171060.8 263029.2  563066.3 345971.16 197683.46 217528.05
## price_sold  339000.0 325000.0 520000.0  197750.0 435000.00 165000.00 275000.00
## CV residual 117832.8 153939.2 256970.8 -365316.3  89028.84 -32683.46  57471.95
##                  1306      1317      1329      1343      1345      1347
## Predicted   327883.41  548095.0  348197.9  336116.1 215315.11 119826.48
## cvpred      312724.89  559255.4  334087.7  321962.3 207392.39 109714.72
## price_sold  235000.00  370000.0  229900.0  200000.0 300749.00 131000.00
## CV residual -77724.89 -189255.4 -104187.7 -121962.3  93356.61  21285.28
##                  1353       1374      1376      1379
## Predicted    45999.15 478833.652 211674.55 325296.38
## cvpred       44012.81 471372.218 221481.17 308819.84
## price_sold  100000.00 467000.000 190000.00 280000.00
## CV residual  55987.19  -4372.218 -31481.17 -28819.84
## 
## Sum of squares = 1.167992e+13    Mean square = 84028190545    n = 139 
## 
## fold 3 
## Observations in test set: 139 
##                    19        22        28       32        38         45
## Predicted   300491.58 231349.73  362214.2 241402.5  525334.1 173993.190
## cvpred      309569.14 225021.94  366803.6 231849.9  516240.9 171779.108
## price_sold  219000.00 173000.00  120000.0 363000.0 1175000.0 165000.000
## CV residual -90569.14 -52021.94 -246803.6 131150.1  658759.1  -6779.108
##                    47        60       84       87       106       116       121
## Predicted   169849.50 211674.81 579043.3 214246.0 536312.40  456528.0 213469.28
## cvpred      162338.23 204304.17 582270.1 214132.2 532022.71  458003.9 208731.92
## price_sold  134000.00 190000.00 700000.0 450000.0 625000.00   67019.0 147000.00
## CV residual -28338.23 -14304.17 117729.9 235867.8  92977.29 -390984.9 -61731.92
##                   129      144       148        174      180       190      196
## Predicted    225034.7 755066.3  587567.7    202.060 418695.4 1320940.3 300782.8
## cvpred       216877.7 753975.8  581257.8  -1187.552 415766.3 1323534.7 298120.5
## price_sold    92500.0 915000.0  375000.0 205000.000 565000.0 1609000.0 440000.0
## CV residual -124377.7 161024.2 -206257.8 206187.552 149233.7  285465.3 141879.5
##                   206       208      221      224       227       240       241
## Predicted   1184453.5 1779743.9 176792.3 561575.0  639399.1 1052053.6 1418845.4
## cvpred      1184151.7 1799996.9 196386.1 553904.8  642529.7 1053306.9 1432673.9
## price_sold   932000.0 1501960.0 562200.0 750000.0  528000.0 1350000.0 1300000.0
## CV residual -252151.7 -298036.9 365813.9 196095.2 -114529.7  296693.1 -132673.9
##                   272      318       327       333    336      337      354
## Predicted    622603.7 197350.4 1336886.3  537560.0 195257  1766499 501820.7
## cvpred       620941.8 189649.6 1354499.8  538853.4 191830  1790465 511579.7
## price_sold   170000.0 260000.0 1842700.0  365000.0 290000   609000 712000.0
## CV residual -450941.8  70350.4  488200.2 -173853.4  98170 -1181465 200420.3
##                    367       369       372        378       383       392
## Predicted   856428.943  655671.6 220253.64 486283.359  389901.0  769988.6
## cvpred      861502.357  655404.2 215299.28 486778.501  382893.5  771157.9
## price_sold  858700.000  444500.0 266000.00 485000.000  280000.0  475000.0
## CV residual  -2802.357 -210904.2  50700.72  -1778.501 -102893.5 -296157.9
##                   393       394       400       408       409       411
## Predicted   199645.26  654769.9 335402.41  768133.3  393393.4 415292.82
## cvpred      196492.24  651114.7 332831.63  775690.7  397076.7 418312.57
## price_sold  255500.00  500000.0 308000.00 1075000.0  245000.0 325000.00
## CV residual  59007.76 -151114.7 -24831.63  299309.3 -152076.7 -93312.57
##                   423       433      438      441      446       450       455
## Predicted    926259.8 192440.65 382771.6 364546.4 555167.2 1043565.7 267346.37
## cvpred       945001.6 187159.05 388668.9 366350.9 552628.3 1050408.3 264928.61
## price_sold  1306000.0 183000.00 330000.0 549980.0 900000.0  800000.0 292900.00
## CV residual  360998.4  -4159.05 -58668.9 183629.1 347371.7 -250408.3  27971.39
##                   456       473       477       483       494      498
## Predicted    534256.4 468267.62  565120.4 601667.76 115189.80 142141.1
## cvpred       537391.8 467140.84  578631.6 605287.17  98951.69 143181.7
## price_sold   405000.0 499900.00  215000.0 520000.00 290000.00 174528.0
## CV residual -132391.8  32759.16 -363631.6 -85287.17 191048.31  31346.3
##                    502       510       521       532      548       551
## Predicted   279721.171  256756.1  584898.6  609776.5 181866.3  606303.8
## cvpred      276753.283  256527.0  585221.8  616646.3 185763.4  605188.5
## price_sold  280000.000  129900.0  177000.0  489900.0 255000.0  405000.0
## CV residual   3246.717 -126627.0 -408221.8 -126746.3  69236.6 -200188.5
##                   555       559       575       589      591       600     613
## Predicted   139560.59  662016.8 270239.52 199052.17 712615.4  696888.0 1414508
## cvpred      131204.81  656695.8 260950.21 197861.59 728002.6  693017.9 1404393
## price_sold  159000.00  399000.0 180000.00 219900.00 900000.0  545000.0 3025000
## CV residual  27795.19 -257695.8 -80950.21  22038.41 171997.4 -148017.9 1620607
##                   616       645       651       653       655        670
## Predicted    702614.0 373691.92  445646.7 251982.72  616876.5 269678.065
## cvpred       703627.7 370401.38  443794.0 254847.66  615745.5 267284.937
## price_sold   550000.0 320305.00  270000.0 270000.00  320000.0 270000.000
## CV residual -153627.7 -50096.38 -173794.0  15152.34 -295745.5   2715.063
##                   673       697       713       718       723       743
## Predicted    570176.2 182594.41  457564.2  263642.6 220504.84  226854.6
## cvpred       584485.4 177200.35  463172.0  265508.6 218808.48  227429.3
## price_sold   310000.0 130000.00  161975.0   98775.0 140000.00   80000.0
## CV residual -274485.4 -47200.35 -301197.0 -166733.6 -78808.48 -147429.3
##                   752      779       787       796       800       823
## Predicted   390037.50 351576.5 314990.28 161355.45  29135.11 173517.59
## cvpred      396179.56 350355.5 319948.55 160789.74  30606.36 176044.64
## price_sold  460000.00 385000.0 335000.00 199900.00 104900.00 220000.00
## CV residual  63820.44  34644.5  15051.45  39110.26  74293.64  43955.36
##                   824       829       830       883       891        899
## Predicted   228086.21  525527.4 167054.66  194401.4 115821.52 614447.916
## cvpred      230392.56  539576.5 167418.01  197565.9 117690.12 627108.896
## price_sold  300000.00  136429.0 241000.00   89000.0 215000.00 625000.000
## CV residual  69607.44 -403147.5  73581.99 -108565.9  97309.88  -2108.896
##                   914       977     1001      1013      1014      1023
## Predicted    49548.23 281032.28 274492.7  72559.31 116401.33 307242.51
## cvpred       44972.73 280344.63 274053.5  68918.13 102377.61 308307.19
## price_sold  143000.00 295000.00 384000.0 105000.00 170000.00 280000.00
## CV residual  98027.27  14655.37 109946.5  36081.87  67622.39 -28307.19
##                  1040     1043      1062      1063      1065      1074     1082
## Predicted    342858.1 242639.2  487114.0  339548.2 188606.29 204184.64 269294.8
## cvpred       351146.9 245601.5  481836.9  334914.6 194603.83 198604.52 268938.5
## price_sold   237160.0 467000.0  305000.0  173000.0 276000.00 275000.00 499000.0
## CV residual -113986.9 221398.5 -176836.9 -161914.6  81396.17  76395.48 230061.5
##                  1095        1106     1118      1141      1146      1150
## Predicted   228317.00   -714.4482 366557.6  42845.07 161515.47  59601.97
## cvpred      231284.34  -6300.4015 376092.1  36531.70 164406.81  51037.42
## price_sold  190000.00 155000.0000 555000.0 105111.00 256000.00 165000.00
## CV residual -41284.34 161300.4015 178907.9  68579.30  91593.19 113962.58
##                 1157      1169      1173      1176      1186      1205
## Predicted   440299.8  431101.2  346238.5 108094.00 162997.22  276870.4
## cvpred      433905.1  432049.9  359802.0 103954.82 166552.33  288862.4
## price_sold  592000.0  290000.0  246000.0  40000.00 187500.00   50013.0
## CV residual 158094.9 -142049.9 -113802.0 -63954.82  20947.67 -238849.4
##                  1208      1214      1215     1221      1249      1254
## Predicted    41227.63 136251.78  277137.8 203738.4 157921.80  318838.6
## cvpred       36280.42 135694.32  275322.0 207776.6 156900.79  326137.8
## price_sold  237500.00 111500.00   67000.0 347500.0 197400.00  145000.0
## CV residual 201219.58 -24194.32 -208322.0 139723.4  40499.21 -181137.8
##                   1261      1262     1268      1270      1287       1300
## Predicted   437027.115  432999.4 212306.5 103311.70  38375.75 235253.123
## cvpred      431206.814  444390.6 223008.5 102936.44  26875.86 239742.437
## price_sold  435000.000  322000.0 372000.0  27886.00 142000.00 242394.000
## CV residual   3793.186 -122390.6 148991.5 -75050.44 115124.14   2651.563
##                  1303      1327      1330      1339      1357       1383
## Predicted   196970.94 196626.44  362400.2 262493.46 338644.34 222195.409
## cvpred      209102.28 204182.43  368682.3 251453.03 336385.54 217327.499
## price_sold  168000.00 150000.00  229000.0 240316.00 425000.00 214000.000
## CV residual -41102.28 -54182.43 -139682.3 -11137.03  88614.46  -3327.499
## 
## Sum of squares = 8.434033e+12    Mean square = 60676496241    n = 139 
## 
## fold 4 
## Observations in test set: 139 
##                    31        48        51        52        58        61
## Predicted    568711.8  314238.9  351916.2  358219.9  546869.4 204209.43
## cvpred       549896.8  333285.9  357147.2  368982.8  563011.1 211112.97
## price_sold  2050000.0  230000.0  200000.0  200000.0  170000.0 150000.00
## CV residual 1500103.2 -103285.9 -157147.2 -168982.8 -393011.1 -61112.97
##                    75       91        99      100      107       132       137
## Predicted    350718.0 281188.7 2611430.1 687340.4 322196.4  357926.4  375778.5
## cvpred       349866.8 264348.7 2589834.1 683015.7 320746.6  362429.0  366659.5
## price_sold   185000.0 365000.0 2900000.0 875000.0 450000.0  249900.0   69668.0
## CV residual -164866.8 100651.3  310165.9 191984.3 129253.4 -112529.0 -296991.5
##                   150       168     194       205       207       215       218
## Predicted   391096.64 350265.02 1458925 348860.05  510024.1  977095.2  32726.80
## cvpred      389049.72 354458.37 1454605 347267.88  506046.0  975959.3  32752.33
## price_sold  355000.00 420000.00 2495000 349900.00  398000.0  470000.0 179725.00
## CV residual -34049.72  65541.63 1040395   2632.12 -108046.0 -505959.3 146972.67
##                   238       242       244      245       254       260      291
## Predicted    54108.43 813785.46  365832.3 460476.8  937320.8 208345.63 564755.5
## cvpred       47781.59 809112.43  361501.4 456167.5  937527.4 220777.31 561124.0
## price_sold  108000.00 792000.00  250000.0 525000.0  792500.0 122000.00 983750.0
## CV residual  60218.41 -17112.43 -111501.4  68832.5 -145027.4 -98777.31 422626.0
##                   298       310      321       323       335      340       351
## Predicted   1221660.6  674409.3 262883.7 790538.29 198147.75 271867.1  558824.2
## cvpred      1211130.7  675575.4 177034.9 799506.24 197433.04 271031.5  555072.4
## price_sold   975000.0  325500.0 605000.0 728000.00 289900.00 310000.0  349900.0
## CV residual -236130.7 -350075.4 427965.1 -71506.24  92466.96  38968.5 -205172.4
##                   361       363       377       404       416       419
## Predicted   561418.57  768133.4 221848.56 349341.13  684313.9 262109.35
## cvpred      564919.69  768579.3 221818.65 347666.59  671763.1 259686.44
## price_sold  512500.00 1075000.0 269300.00 300000.00  300000.0 200000.00
## CV residual -52419.69  306420.7  47481.35 -47666.59 -371763.1 -59686.44
##                   426       434       440       453       460       470
## Predicted   401625.89  716809.1 556598.83  288159.4 257264.59 74365.827
## cvpred      399858.58  724220.7 567177.34  298902.7 256513.58 80028.392
## price_sold  330000.00  550000.0 624900.00  163500.0 207000.00 81500.000
## CV residual -69858.58 -174220.7  57722.66 -135402.7 -49513.58  1471.608
##                   490       499       507       512       523       527
## Predicted   395549.61  671359.2  668355.9  378904.8  427913.9 406066.82
## cvpred      393715.04  673407.6  664351.9  377562.6  432478.9 404563.94
## price_sold  312500.00  394500.0  396000.0  257000.0  325000.0 381300.00
## CV residual -81215.04 -278907.6 -268351.9 -120562.6 -107478.9 -23263.94
##                   528       549       550       557       560      567
## Predicted   404166.44  328799.6  550486.1 491285.80 399368.26 274818.9
## cvpred      395644.89  332324.2  553444.3 494845.55 403010.79 265642.1
## price_sold  440000.00  218000.0  335000.0 420000.00 390000.00 454500.0
## CV residual  44355.11 -114324.2 -218444.3 -74845.55 -13010.79 188857.9
##                   609       620       637       640       644       649
## Predicted   161143.67  520846.2  93259.32  445958.5 251982.72 379757.20
## cvpred      159773.07  524518.3  91124.78  442037.9 244273.19 379037.65
## price_sold  175000.00  300000.0 109500.00  225000.0 270000.00 349900.00
## CV residual  15226.93 -224518.3  18375.22 -217037.9  25726.81 -29137.65
##                   658        660       679       683      686       690
## Predicted   425321.61 454467.447  923240.8  463952.5 239023.9 465885.42
## cvpred      421920.37 450150.863  925266.8  462170.9 243847.8 464290.59
## price_sold  383000.00 449000.000 1432500.0  355000.0 378000.0 558650.00
## CV residual -38920.37  -1150.863  507233.2 -107170.9 134152.2  94359.41
##                   704       706      712       744       749       762      764
## Predicted    522437.9 237060.79 61151.88  355248.6  33445.44 239869.14 136617.3
## cvpred       525706.9 241878.82 60658.88  360294.0  33721.55 245932.31 141311.8
## price_sold   280000.0 259900.00 84500.00  163600.0 200100.00 275000.00 295000.0
## CV residual -245706.9  18021.18 23841.12 -196694.0 166378.45  29067.69 153688.2
##                   785      786       790       809       810       822
## Predicted   132175.32 388282.7 267556.56 133800.54  392147.5  88840.64
## cvpred      135186.99 391444.1 272503.24 128091.78  389908.9  87008.98
## price_sold  205000.00 740000.0 174900.00 219900.00  270000.0  68000.00
## CV residual  69813.01 348555.9 -97603.24  91808.22 -119908.9 -19008.98
##                   842      856      864        871       872        875
## Predicted    218113.5 301339.6 177280.0 198853.744 272069.99 216030.016
## cvpred       228923.7 283437.2 181260.8 198492.552 249928.62 220391.017
## price_sold    80000.0 589000.0 360000.0 195000.000 172000.00 230000.000
## CV residual -148923.7 305562.8 178739.2  -3492.552 -77928.62   9608.983
##                  904       905       924       925      938      963       965
## Predicted   339163.6 318524.15  607981.4 345054.75 113686.2 195337.3  41496.39
## cvpred      315070.6 316953.32  610716.4 356183.57 108001.2 195124.6  35375.05
## price_sold  430000.0 257500.00  400000.0 380000.00 396300.0 320500.0 140000.00
## CV residual 114929.4 -59453.32 -210716.4  23816.43 288298.8 125375.4 104624.95
##                   967      985      996      1000      1005      1012      1024
## Predicted    220339.3 313462.4 185517.2 184853.38 551550.77 311175.35  359315.0
## cvpred       211561.8 311830.7 189147.3 184066.91 562319.13 308779.33  369859.8
## price_sold    79900.0 420000.0 322400.0  90000.00 487600.00 210000.00  262500.0
## CV residual -131661.8 108169.3 133252.7 -94066.91 -74719.13 -98779.33 -107359.8
##                   1033      1050      1056      1059     1092     1116
## Predicted   129658.202 234860.00  557688.2 193058.57 59733.78 274818.7
## cvpred      135825.684 239339.22  551977.7 197524.03 63661.77 265641.8
## price_sold  129000.000 190000.00  185000.0 227000.00 88000.00 454500.0
## CV residual  -6825.684 -49339.22 -366977.7  29475.97 24338.23 188858.2
##                  1123      1125     1127      1149      1154      1166     1174
## Predicted    258669.9  362008.3 262812.5  73828.24  313532.6  683603.0 233335.5
## cvpred       270805.6  372904.1 261489.2  78670.71  322796.0  688167.6 238010.4
## price_sold   105000.0  260000.0 478000.0 158000.00  150000.0 1240000.0 375000.0
## CV residual -165805.6 -112904.1 216510.8  79329.29 -172796.0  551832.4 136989.6
##                  1175      1178      1185     1189      1201      1203
## Predicted   370137.73 488381.70 193528.67 234580.5  376002.4  75267.11
## cvpred      380650.02 498630.18 192625.62 225683.6  392615.9  80094.96
## price_sold  325000.00 402000.00 288500.00 385000.0  235000.0 277000.00
## CV residual -55650.02 -96630.18  95874.38 159316.4 -157615.9 196905.04
##                  1212      1220      1225      1248      1266      1267
## Predicted   194498.89  399323.4 440572.32 276103.38  427370.0  187975.1
## cvpred      193201.17  389497.4 436603.32 279724.89  433149.9  186096.6
## price_sold  145000.00   74000.0 389000.00 181900.00  295000.0   70000.0
## CV residual -48201.17 -315497.4 -47603.32 -97824.89 -138149.9 -116096.6
##                  1273      1280      1285      1288       1298       1302
## Predicted   563821.86 563821.86 399247.05 138853.69 182768.570 182768.570
## cvpred      574310.72 574310.72 403613.14 144024.79 174885.282 174885.282
## price_sold  590000.00 590000.00 374900.00 182500.00 168000.000 168000.000
## CV residual  15689.28  15689.28 -28713.14  38475.21  -6885.282  -6885.282
##                  1336      1340      1365      1384      1387
## Predicted   262955.53  88350.44  314693.7 144937.90  829810.2
## cvpred      267872.02  77861.39  331543.3 162781.18  843017.8
## price_sold  239900.00 140000.00  219000.0  92500.00  625000.0
## CV residual -27972.02  62138.61 -112543.3 -70281.18 -218017.8
## 
## Sum of squares = 7.442271e+12    Mean square = 53541520832    n = 139 
## 
## fold 5 
## Observations in test set: 139 
##                    18       26        43        56       57        65       139
## Predicted    626907.2 363258.8 202811.99  352611.8 389080.2 360340.40  675527.0
## cvpred       642630.4 361043.0 212207.49  368928.4 402833.8 379219.73  695187.4
## price_sold  1050000.0 480000.0 185000.00  264900.0 440000.0 439000.00  390000.0
## CV residual  407369.6 118957.0 -27207.49 -104028.4  37166.2  59780.27 -305187.4
##                   141       142       143     158       160       183       185
## Predicted    430361.1  481519.9 377161.11 1108937 1743335.2  944923.8 1509177.1
## cvpred       436695.6  493059.1 384334.09 1113660 1785762.6  963853.3 1554815.9
## price_sold   294900.0  212000.0 291500.00 2525000 1600000.0  528400.0  980000.0
## CV residual -141795.6 -281059.1 -92834.09 1411340 -185762.6 -435453.3 -574815.9
##                    213       216       233      248        253       257
## Predicted   238198.972 1006449.3 423970.52 453670.6 1640422.12 1495951.6
## cvpred      240998.408 1024106.2 429526.14 456899.0 1686027.07 1538106.5
## price_sold  242000.000  640000.0 465000.00 950000.0 1650000.00  935000.0
## CV residual   1001.592 -384106.2  35473.86 493101.0  -36027.07 -603106.5
##                   262       266     270       273       276       280       301
## Predicted   434936.46  450961.8 1042643  225864.8 213964.90 1474044.3 1754816.8
## cvpred      440596.92  454505.1 1054714  228143.5 218367.38 1514248.2 1795090.4
## price_sold  515000.00  275000.0  950000   19330.0 310000.00 1010000.0 2350000.0
## CV residual  74403.08 -179505.1 -104714 -208813.5  91632.62 -504248.2  554909.6
##                   312       320       325      330       338       339
## Predicted   1693291.1 1046943.2 387092.04 104412.2 155970.00 1005417.3
## cvpred      1741605.5 1067612.3 390135.78 105607.3 154391.17 1030194.9
## price_sold  1000000.0  650000.0 325000.00 215000.0 202000.00  483100.0
## CV residual -741605.5 -417612.3 -65135.78 109392.7  47608.83 -547094.9
##                   341       343       346       376       418       425
## Predicted    739211.1 152325.86  552738.7 602541.11  364230.0 540058.47
## cvpred       755627.3 150903.08  561223.8 611445.15  367621.6 549618.81
## price_sold   585000.0 235000.00  380000.0 581000.00  180000.0 460000.00
## CV residual -170627.3  84096.92 -181223.8 -30445.15 -187621.6 -89618.81
##                   447       467       480       485      488       509
## Predicted    576231.7 115932.27 1328437.8  55643.50 324611.8  690805.9
## cvpred       581459.5 110855.92 1362852.6  54377.64 328324.4  702003.8
## price_sold   357500.0  63000.00  799900.0 150000.00 466400.0  350000.0
## CV residual -223959.5 -47855.92 -562952.6  95622.36 138075.6 -352003.8
##                   535      547       570       578       587      590       622
## Predicted    77414.89 318267.5 201510.81 337304.02 174041.62 299481.3 223533.08
## cvpred       75348.78 322166.8 201973.97 341064.44 166243.51 295961.4 231346.74
## price_sold  110111.00 272000.0 225000.00 360000.00 115000.00 405000.0 195000.00
## CV residual  34762.22 -50166.8  23026.03  18935.56 -51243.51 109038.6 -36346.74
##                    624      626       634       642      648       654
## Predicted   329077.133 192077.6 234070.55 395561.16 177789.5  609870.9
## cvpred      335043.293 194768.7 243619.19 405123.43 185439.5  621829.9
## price_sold  329000.000 237500.0 340000.00 435000.00 287990.0  379000.0
## CV residual  -6043.293  42731.3  96380.81  29876.57 102550.5 -242829.9
##                   659       662       694       698      725       727      729
## Predicted   545245.67  518501.8  836387.3 227435.26 461083.6  286888.4 149432.4
## cvpred      542897.41  527797.1  848359.7 229053.54 452208.5  290597.9 143561.0
## price_sold  449000.00  350000.0  319000.0 194900.00 815000.0  120000.0 273000.0
## CV residual -93897.41 -177797.1 -529359.7 -34153.54 362791.5 -170597.9 129439.0
##                   755       757        759       766       775       780
## Predicted   345095.17  435298.8 245500.938  819183.7 127977.28  236639.8
## cvpred      353708.14  438201.8 238269.695  825975.3 125645.94  232091.8
## price_sold  275000.00  238775.0 235000.000 1025000.0 170000.00  115000.0
## CV residual -78708.14 -199426.8  -3269.695  199024.7  44354.06 -117091.8
##                   784        794       807       814       817       825
## Predicted   340502.31 416533.105  165157.4  647904.9 403410.73  39475.97
## cvpred      342523.58 434142.992  163250.2  666256.9 408085.93  37169.46
## price_sold  260000.00 430000.000   55000.0  451000.0 369415.00 162000.00
## CV residual -82523.58  -4142.992 -108250.2 -215256.9 -38670.93 124830.54
##                  827       844       847       850       874       878      889
## Predicted    34846.9  435993.2 292704.40 190534.99 227565.93  54373.38 147890.6
## cvpred       32631.9  443354.8 294988.24 191967.22 230724.87  53483.19 145254.4
## price_sold  173900.0  276000.0 255000.00 220000.00 195000.00 193500.00 267500.0
## CV residual 141268.1 -167354.8 -39988.24  28032.78 -35724.87 140016.81 122245.6
##                   897       900       902      903       910      922       923
## Predicted     5227.77 373089.89 148470.13 271662.6 651836.31 344383.6  549275.1
## cvpred        3607.38 371831.48 156838.23 263956.9 667118.81 341555.2  567224.3
## price_sold  155100.00 445000.00 100000.00 381000.0 605000.00 299900.0  375000.0
## CV residual 151492.62  73168.52 -56838.23 117043.1 -62118.81 -41655.2 -192224.3
##                    928      929       933       944       955      956
## Predicted   144324.443 394068.3  591114.2 163291.20 305096.83 169737.6
## cvpred      141895.851 398468.4  602878.2 158781.78 307305.07 170107.6
## price_sold  135000.000 545000.0  382000.0 180000.00 270000.00 155000.0
## CV residual  -6895.851 146531.6 -220878.2  21218.22 -37305.07 -15107.6
##                   960       973       991   1009      1011     1027      1037
## Predicted    266855.8 164629.93  510178.9 340785 242430.99 53546.19  91108.02
## cvpred       259393.0 163758.15  519244.2 338104 240073.18 51714.31  94742.41
## price_sold   110000.0 240300.00  232000.0 250000 209500.00 90000.00 119000.00
## CV residual -149393.0  76541.85 -287244.2 -88104 -30573.18 38285.69  24257.59
##                  1038      1039      1079      1111      1112      1113
## Predicted    265950.6  46672.15  56923.42  261356.2 287369.35 185516.40
## cvpred       257494.7  47056.84  58398.39  251761.8 288353.62 184583.87
## price_sold   135000.0 149900.00 180000.00   39000.0 221500.00 272000.00
## CV residual -122494.7 102843.16 121601.61 -212761.8 -66853.62  87416.13
##                  1119      1120      1128      1129      1164     1168
## Predicted   164675.08  73606.05  326454.1 165420.96 250068.92 187055.4
## cvpred      155047.18  69278.68  324372.4 167524.77 245907.86 182910.3
## price_sold  145000.00 140000.00  190600.0  83000.00 195000.00 315000.0
## CV residual -10047.18  70721.32 -133772.4 -84524.77 -50907.86 132089.7
##                  1171     1172      1197      1237      1246      1247
## Predicted   209846.57 204966.4  361800.0 435212.60  363950.8 290430.36
## cvpred      202722.55 200729.5  359093.3 429276.68  366329.4 284233.15
## price_sold  282000.00 388400.0  235000.0 351000.00  151750.0 235000.00
## CV residual  79277.45 187670.5 -124093.3 -78276.68 -214579.4 -49233.15
##                  1250     1253      1256      1258      1259      1264
## Predicted   276511.90 527432.5  90748.88 194468.90 173383.15 421787.87
## cvpred      268550.05 540091.1  86711.73 192844.21 171645.14 432327.47
## price_sold  280000.00 750000.0  58500.00 238000.00 235000.00 385000.00
## CV residual  11449.95 209908.9 -28211.73  45155.79  63354.86 -47327.47
##                  1274      1286      1311      1314      1318      1321
## Predicted    253323.1 201510.51  277512.1  230558.7 243901.40  60505.28
## cvpred       250227.2 201973.66  267644.9  222340.4 239394.05  60801.73
## price_sold    50000.0 225000.00  165000.0    2900.0 195000.00 131000.00
## CV residual -200227.2  23026.34 -102644.9 -219440.4 -44394.05  70198.27
##                  1337      1363      1366      1371      1386
## Predicted   262770.70  261786.5 262678.26 203048.29 208607.02
## cvpred      274785.34  260421.7 274808.37 198606.78 216337.23
## price_sold  230000.00   60000.0 223000.00 135000.00 155000.00
## CV residual -44785.34 -200421.7 -51808.37 -63606.78 -61337.23
## 
## Sum of squares = 7.664471e+12    Mean square = 55140077209    n = 139 
## 
## fold 6 
## Observations in test set: 139 
##                    17        20        33        36       41        53       59
## Predicted    536129.0  300491.6 262770.93  407050.8 269212.3 280014.90 290387.2
## cvpred       495056.5  322343.7 244181.48  364597.7 254766.4 276520.98 268943.6
## price_sold  1050000.0  219000.0 230000.00 1050000.0 551900.0 285000.00 417000.0
## CV residual  554943.5 -103343.7 -14181.48  685402.3 297133.6   8479.02 148056.4
##                   69        78         83       86       96     105       115
## Predicted   474540.0 409971.13 280813.629 261835.2 357831.1 1980409  258203.3
## cvpred      451576.2 401913.33 300896.244 243894.4 364177.6 1825549  260464.2
## price_sold  870000.0 310000.00 307000.000 419900.0 600000.0 3500000  133000.0
## CV residual 418423.8 -91913.33   6103.756 176005.6 235822.4 1674451 -127464.2
##                   126       162     164       165     167     191       195
## Predicted    382755.4  594732.4 1613427  767566.3 1733647 2405719 136025.97
## cvpred       363278.1  641288.4 1490812  731187.1 1538977 2184920 159909.09
## price_sold    55605.0  425000.0 3850000  580000.0 7500000 3500000 255000.00
## CV residual -307673.1 -216288.4 2359188 -151187.1 5961023 1315080  95090.91
##                   201       202      225       232       243       250
## Predicted   540060.50  363330.7 295094.3 592342.19 434566.89  811372.6
## cvpred      528057.79  394229.2 313971.3 561404.17 425407.76  761123.4
## price_sold  570000.00  280000.0 450000.0 572500.00 515000.00  647800.0
## CV residual  41942.21 -114229.2 136028.7  11095.83  89592.24 -113323.4
##                   251       252       255       271       314       315
## Predicted   415204.78 1608771.5 713782.61 275804.91 1879501.9 534245.54
## cvpred      403854.32 1466247.6 728556.12 258995.31 1721738.8 514190.47
## price_sold  450500.00 1900000.0 695000.00 195000.00 1025000.0 550000.00
## CV residual  46645.68  433752.4 -33556.12 -63995.31 -696738.8  35809.53
##                   326        345       350       358       366       368
## Predicted   1611451.1 1470131.94 323168.22 232884.18 782630.02  754528.7
## cvpred      1522432.7 1366864.01 332535.32 281045.93 742393.18  709616.6
## price_sold  1150000.0 1320000.00 340000.00 335000.00 800000.00  590000.0
## CV residual -372432.7  -46864.01   7464.68  53954.07  57606.82 -119616.6
##                    384       397        401       413      414      428
## Predicted   810721.245 233429.97 234456.006 221983.18 140706.8 102593.4
## cvpred      790687.308 237828.55 244748.704 197988.68 149725.3 109061.0
## price_sold  800000.000 268000.00 250000.000 135000.00 292000.0 193900.0
## CV residual   9312.692  30171.45   5251.296 -62988.68 142274.7  84839.0
##                   430       439      445      489      504       514       537
## Predicted    496465.3 588066.77 555167.2 405072.1 170022.9  786432.9  503227.1
## cvpred       552424.1 547121.69 525368.5 392290.3 172711.4  729937.5  475985.6
## price_sold   208980.0 587500.00 900000.0 375000.0 215000.0  460000.0  254000.0
## CV residual -343444.1  40378.31 374631.5 -17290.3  42288.6 -269937.5 -221985.6
##                  538       539      566       574       579       580       582
## Predicted   389765.6 265972.71 274818.9 783752.74 1479491.5  431101.5  982940.7
## cvpred      383387.3 259509.91 298008.3 733141.07 1351377.8  424526.7  864713.9
## price_sold  545000.0 183000.00 454500.0 799000.00  545000.0  290000.0  600000.0
## CV residual 161612.7 -76509.91 156491.7  65858.93 -806377.8 -134526.7 -264713.9
##                   586      588       593      594       605      618       639
## Predicted    384221.0 308332.3 293078.18 220504.9  33776.37 344439.9 186994.26
## cvpred       369860.6 298344.7 287504.29 215404.4  67809.34 325141.1 202014.04
## price_sold   235000.0 375000.0 276000.00 260000.0 119000.00 229000.0 266000.00
## CV residual -134860.6  76655.3 -11504.29  44595.6  51190.66 -96141.1  63985.96
##                   650       661      666       667       672       680
## Predicted   550853.20 210146.15 203923.0  81640.81  985485.8  923240.8
## cvpred      556744.99 257826.98 214052.3 107046.47  929650.0  858626.6
## price_sold  640000.00 160100.00 329000.0 208000.00  749900.0 1430000.0
## CV residual  83255.01 -97726.98 114947.7 100953.53 -179750.0  571373.4
##                   708       714      719       748       763        765
## Predicted   237060.78 471542.84 198164.5  33445.44  81486.65 238640.196
## cvpred      235438.76 459527.27 213699.3  52527.51  86314.41 243234.873
## price_sold  259900.00 415000.00 318900.0 200100.00 171000.00 250000.000
## CV residual  24461.24 -44527.27 105200.7 147572.49  84685.59   6765.127
##                   769       783       793       811       845       852
## Predicted    479065.7  309730.8  285347.8  380125.0 388904.94 298265.35
## cvpred       504372.7  308570.3  289349.9  368553.4 376686.39 297609.17
## price_sold   395000.0  157000.0  172950.0  210000.0 360000.00 265000.00
## CV residual -109372.7 -151570.3 -116399.9 -158553.4 -16686.39 -32609.17
##                  858       861       868      885       888       893       908
## Predicted   278837.9  74735.22  233803.8 302421.4 614447.92 329225.81  397718.8
## cvpred      279071.3  76560.07  228703.2 308591.4 605273.75 316619.61  421621.5
## price_sold  187500.0  60000.00  128000.0 330000.0 625000.00 275000.00  125000.0
## CV residual -91571.3 -16560.07 -100703.2  21408.6  19726.25 -41619.61 -296621.5
##                   921       927      930       935        946       953
## Predicted   50127.112  293641.5 219937.3 379048.20 169594.924  327854.1
## cvpred      65559.177  279792.2 222456.4 375347.82 184397.241  331888.1
## price_sold  61000.000  130000.0 382000.0 284900.00 180000.000  176000.0
## CV residual -4559.177 -149792.2 159543.6 -90447.82  -4397.241 -155888.1
##                  1006     1025     1036      1047     1048      1052     1053
## Predicted   149895.18 138566.9 215888.3 207535.39 144324.4  512918.8 204011.2
## cvpred      157423.37 165576.0 217148.5 230241.95 153214.3  509989.7 202978.3
## price_sold  145000.00 135000.0 355000.0 144900.00  81000.0  333850.0 175000.0
## CV residual -12423.37 -30576.0 137851.5 -85341.95 -72214.3 -176139.7 -27978.3
##                  1058       1071      1085     1089      1117      1132
## Predicted    266288.5 227961.252 222028.48 376459.1  333533.5 235370.17
## cvpred       273467.3 260244.467 217637.94 370191.4  335243.0 245840.46
## price_sold   147500.0 253000.000 253000.00 449900.0  158200.0 178800.00
## CV residual -125967.3  -7244.467  35362.06  79708.6 -177043.0 -67040.46
##                  1134      1179      1193     1200      1204     1213      1228
## Predicted    7519.369  227747.2 247437.72 577293.3 146072.96 258245.6  473577.9
## cvpred      34567.565  242058.8 261406.24 569782.0 158529.83 275859.5  420723.1
## price_sold  32000.000   60000.0 163500.00 655500.0 245000.00 429000.0  284700.0
## CV residual -2567.565 -182058.8 -97906.24  85718.0  86470.17 153140.5 -136023.1
##                 1229     1240      1241      1271      1279      1281      1291
## Predicted   254080.6 221466.8 201018.43  443009.8 563821.86 168656.27 225444.34
## cvpred      268976.1 230113.2 206728.46  434914.9 522858.86 193413.02 231911.73
## price_sold  445000.0 435000.0 165000.00  282200.0 590000.00 140000.00 158000.00
## CV residual 176023.9 204886.8 -41728.46 -152714.9  67141.14 -53413.02 -73911.73
##                  1292    1293      1308      1310      1320      1323      1324
## Predicted    506323.5  313842  380670.0  261974.6  343404.7 635761.57 209875.53
## cvpred       478166.7  340545  348554.6  265119.1  328222.2 582936.98 186926.19
## price_sold    42500.0  125000  160000.0  109000.0 1059162.0 549000.00 142500.00
## CV residual -435666.7 -215545 -188554.6 -156119.1  730939.8 -33936.98 -44426.19
##                  1344      1350      1355      1364      1369      1372
## Predicted   222610.50 208344.21 143520.79 490546.13 242125.76 325376.40
## cvpred      255107.27 185301.64 158456.85 457187.22 218880.87 306065.97
## price_sold  212000.00 122000.00  90000.00 425500.00 275000.00 290000.00
## CV residual -43107.27 -63301.64 -68456.85 -31687.22  56119.13 -16065.97
##                  1377      1380
## Predicted   256742.41 339498.74
## cvpred      227413.38 332283.73
## price_sold  245000.00 280000.00
## CV residual  17586.62 -52283.73
## 
## Sum of squares = 5.103922e+13    Mean square = 367188635411    n = 139 
## 
## fold 7 
## Observations in test set: 139 
##                    24       29       44       54        73        77        81
## Predicted   325376.65 38219.96 223234.1 528880.4 1293174.4  915995.4 1404973.5
## cvpred      322189.48 47130.39 230274.8 517625.3 1339176.8  919736.9 1457654.3
## price_sold  290000.00 90000.00 353000.0 769100.0  695000.0  540000.0  900000.0
## CV residual -32189.48 42869.61 122725.2 251474.7 -644176.8 -379736.9 -557654.3
##                   90       103       109       136       154      170      176
## Predicted   227452.6 1681175.5  705287.6  315332.7 237213.12 105083.9 215897.8
## cvpred      227038.3 1725884.1  712271.6  324127.5 241016.52 104846.3 189718.0
## price_sold  365000.0 2400000.0  245000.0  167500.0 325000.00 230000.0 485000.0
## CV residual 137961.7  674115.9 -467271.6 -156627.5  83983.48 125153.7 295282.0
##                  182      188       192       193       214       222      228
## Predicted   63053.31 169847.4  280658.2 621362.20 129841.77  544705.2  1788674
## cvpred      65038.37 170015.2  281105.1 622760.02 132142.09  541646.8  1851257
## price_sold  93765.00 320000.0  108500.0 600000.00 120000.00  426500.0   697600
## CV residual 28726.63 149984.8 -172605.1 -22760.02 -12142.09 -115146.8 -1153657
##                   236       237      256       265       267       268
## Predicted   208345.78 1342867.5 116229.5 200006.73 1282451.9 283916.18
## cvpred      207931.36 1377288.8 103507.6 195850.26 1320843.9 288842.89
## price_sold  122000.00 1800000.0 178500.0 230000.00  651900.0 319000.00
## CV residual -85931.36  422711.2  74992.4  34149.74 -668943.9  30157.11
##                   281       282       290       304       313      352
## Predicted   1445261.0  516082.4  875530.8 288419.89 416756.21 487972.8
## cvpred      1535842.1  521431.0  886830.2 292854.32 418224.99 496928.6
## price_sold   837500.0  407975.0  620000.0 335000.00 385000.00 873500.0
## CV residual -698342.1 -113456.0 -266830.2  42145.68 -33224.99 376571.4
##                   355       357       365       373      382      389
## Predicted    612736.4  404462.3  379751.8 217109.85 414893.0 152426.2
## cvpred       629859.8  403698.6  394748.9 219023.06 413911.8 144477.8
## price_sold   512900.0  256000.0  236000.0 238000.00 545000.0 280000.0
## CV residual -116959.8 -147698.6 -158748.9  18976.94 131088.2 135522.2
##                    396       403       429       454       463       465
## Predicted   200631.575  438173.6  974146.5 1015954.8  321565.5 561469.47
## cvpred      198698.712  440289.4  994238.7 1032672.3  325625.9 576777.02
## price_sold  200000.000  255000.0  690000.0  565000.0  215000.0 522375.00
## CV residual   1301.288 -185289.4 -304238.7 -467672.3 -110625.9 -54402.02
##                   468       474       475       486       511       515
## Predicted    747829.6 1261296.2 299400.57 208127.94  561631.8  716602.9
## cvpred       781101.3 1263378.5 296931.73 204817.14  575179.7  719535.3
## price_sold   669000.0 1550000.0 325000.00 187500.00  431000.0 1500100.0
## CV residual -112101.3  286621.5  28068.27 -17317.14 -144179.7  780564.7
##                   518       519      534       542       543       546
## Predicted    645489.5  638652.8 350259.0  572787.2  669385.4 224787.94
## cvpred       646901.5  661171.9 346786.6  561855.9  681363.8 219399.51
## price_sold   415000.0  482725.0 324900.0  398000.0  420000.0 128000.00
## CV residual -231901.5 -178446.9 -21886.6 -163855.9 -261363.8 -91399.51
##                   554       563       568       573       577       585
## Predicted   448164.44 454805.86 170944.22 411051.26  382544.6  804199.4
## cvpred      452020.27 458457.08 157188.23 408508.63  380966.1  808037.6
## price_sold  440000.00 407500.00 225000.00 465000.00  279900.0  655000.0
## CV residual -12020.27 -50957.08  67811.77  56491.37 -101066.1 -153037.6
##                  606       607        623       625       631       674
## Predicted   259144.7 335996.31 208976.482  339762.6  541847.3 299637.55
## cvpred      261216.1 330515.75 207484.011  341336.3  554074.7 289254.81
## price_sold  425000.0 282000.00 200000.000  185000.0  360000.0 302000.00
## CV residual 163783.9 -48515.75  -7484.011 -156336.3 -194074.7  12745.19
##                  696       702       703       731       735       742
## Predicted   400229.9 -19436.64 103786.47  334844.1 249056.49  211150.8
## cvpred      401173.6 -26886.63 107804.57  342813.4 248031.71  205978.2
## price_sold  365000.0 184000.00 140000.00  220000.0 262000.00   97000.0
## CV residual -36173.6 210886.63  32195.43 -122813.4  13968.29 -108978.2
##                   745       761       767       781      791       821
## Predicted   295190.10  351364.5  819183.7  410519.1 237752.3  451378.0
## cvpred      295076.23  337732.9  837629.9  410000.1 236921.0  452774.2
## price_sold  196250.00  200000.0 1025000.0  266000.0 510000.0  310000.0
## CV residual -98826.23 -137732.9  187370.1 -144000.1 273079.0 -142774.2
##                   828        834      843      854       857       867
## Predicted    826887.7 1032094.12 517300.9 247847.6 246599.26 159392.28
## cvpred       847835.1 1044352.33 508234.3 244604.2 244699.53 150413.05
## price_sold   599950.0  950000.00 617000.0 450000.0 230000.00 220000.00
## CV residual -247885.1  -94352.33 108765.7 205395.8 -14699.53  69586.95
##                   870      879       931      962       964       978       983
## Predicted    648415.7  1498121 258729.94 189854.2 260158.51  84736.38 177963.73
## cvpred       645218.2  1609109 257810.13 202258.5 256340.96  82790.72 170030.25
## price_sold  1200000.0   530000 290000.00 310000.0 192000.00 180000.00 120000.00
## CV residual  554781.8 -1079109  32189.87 107741.5 -64340.96  97209.28 -50030.25
##                   984      1026     1034      1044      1051      1066
## Predicted   129836.38 146465.55 342972.7 314418.26 224876.06 364709.64
## cvpred      112370.34 150235.99 330897.1 328656.46 221365.49 360221.64
## price_sold  202000.00 135000.00 450000.0 385000.00 205000.00 319900.00
## CV residual  89629.66 -15235.99 119102.9  56343.54 -16365.49 -40321.64
##                  1080      1084     1091     1096     1105      1107     1130
## Predicted   225007.34  351425.0 380147.4 373440.5 232485.7  393354.8 123741.1
## cvpred      214192.63  360303.3 365705.3 364383.2 227680.8  385730.5 125496.6
## price_sold  155000.00  130500.0 570000.0 565000.0 415000.0   75000.0 335000.0
## CV residual -59192.63 -229803.3 204294.7 200616.8 187319.2 -310730.5 209503.4
##                  1133      1135      1148     1160      1162      1170
## Predicted    45548.43  57317.01 175994.50 182842.9 115145.12 363680.58
## cvpred       41511.65  49334.76 185874.85 173058.7 118406.23 357165.48
## price_sold  260000.00 180000.00 120000.00 370000.0 189900.00 400000.00
## CV residual 218488.35 130665.24 -65874.85 196941.3  71493.77  42834.52
##                  1177      1180      1181     1187     1190     1191       1196
## Predicted   349070.80 122138.61  152833.7 221382.5 104843.4 157499.0 349708.852
## cvpred      345259.39 121217.18  159092.3 219193.8 110641.4 146584.5 358662.191
## price_sold  253000.00  96000.00   55000.0 339000.0 285000.0 320000.0 366000.000
## CV residual -92259.39 -25217.18 -104092.3 119806.2 174358.6 173415.5   7337.809
##                  1207      1210      1218      1223      1232      1235
## Predicted   134484.26 338298.03 133510.84 514913.56 303945.23  255456.2
## cvpred      134986.02 313488.13 140954.59 517713.41 288605.36  253125.3
## price_sold  152500.00 225000.00 130000.00 560000.00 350000.00   76000.0
## CV residual  17513.98 -88488.13 -10954.59  42286.59  61394.64 -177125.3
##                  1269      1276      1290      1297      1304      1307
## Predicted    97007.98 349167.13  323189.4 216145.82  229628.1  423543.7
## cvpred       99033.07 348759.11  322340.5 202948.45  241997.5  435968.2
## price_sold   27886.00 290000.00  170000.0 182000.00   45000.0  235000.0
## CV residual -71147.07 -58759.11 -152340.5 -20948.45 -196997.5 -200968.2
##                  1335     1348      1351      1367      1370      1375
## Predicted   269388.69 494226.2 252644.24 262585.85 -49159.51 227713.98
## cvpred      252306.98 496053.9 250317.81 271435.99 -61711.75 225628.07
## price_sold  186500.00 899900.0 214000.00 189000.00 150000.00 245900.00
## CV residual -65806.98 403846.1 -36317.81 -82435.99 211711.75  20271.93
##                  1381
## Predicted   150152.61
## cvpred      138184.87
## price_sold  175000.00
## CV residual  36815.13
## 
## Sum of squares = 8.855491e+12    Mean square = 63708566545    n = 139 
## 
## fold 8 
## Observations in test set: 139 
##                     1        10        13       25      35        63        64
## Predicted    343539.1 209988.82  715147.2 155121.4 1040419  698061.8  364229.7
## cvpred       340898.8 213341.71  725390.9 149323.8 1041129  709258.5  344937.9
## price_sold   214300.0 187000.00 1050000.0 309000.0 2275000  535000.0  180000.0
## CV residual -126598.8 -26341.71  324609.1 159676.2 1233871 -174258.5 -164937.9
##                    68       76       85        94        95      104       112
## Predicted    760112.6 360985.3 428286.7 700982.12 676020.35 396968.9  916362.6
## cvpred       767212.3 372527.9 385200.4 685585.75 652459.95 364246.6  923619.2
## price_sold   470000.0 500000.0 625000.0 670000.00 705500.00 505000.0  667000.0
## CV residual -297212.3 127472.1 239799.6 -15585.75  53040.05 140753.4 -256619.2
##                   118       122      135       146       159      163       166
## Predicted    280536.0  584266.3 316800.4  390149.1 2614746.2 668891.1  655826.1
## cvpred       280653.6  587405.7 318404.7  389190.7 2684404.1 672086.7  669497.9
## price_sold   122000.0  254900.0 490000.0   51314.0 2000000.0 853000.0  425000.0
## CV residual -158653.6 -332505.7 171595.3 -337876.7 -684404.1 180913.3 -244497.9
##                  178       200       209      211       220       223       230
## Predicted   225580.9 371483.13  510024.1 248135.9 271055.27  494696.5 1022344.3
## cvpred      221154.1 375821.34  512297.4 242078.4 270990.24  501221.8 1035617.9
## price_sold  353000.0 350000.00  398000.0 515000.0 244900.00  276000.0  740000.0
## CV residual 131845.9 -25821.34 -114297.4 272921.6 -26090.24 -225221.8 -295617.9
##                   246      247       261       274       277       284
## Predicted   612440.47 547332.8 1137255.8 212670.77  487437.6  443361.3
## cvpred      616807.72 552655.2 1156978.8 223520.18  481673.0  434005.6
## price_sold  550000.00 837679.0  759000.0 265000.00  315700.0  285000.0
## CV residual -66807.72 285023.8 -397978.8  41479.82 -165973.0 -149005.6
##                   299       306       319       324       344       347
## Predicted    91702.54 507861.76  453075.8 342542.63  43579.02 218116.63
## cvpred       85817.75 507940.98  453938.4 335956.08  37376.69 213916.57
## price_sold  476000.00 484000.00  255000.0 305500.00 202500.00 225000.00
## CV residual 390182.25 -23940.98 -198938.4 -30456.08 165123.31  11083.43
##                   349      353       362       370        399      405
## Predicted   396473.99 489821.1  699519.4  456785.1 451794.760 341007.5
## cvpred      393749.08 494797.5  711919.6  457218.4 455876.193 336084.8
## price_sold  430000.00 873500.0  380000.0  265000.0 449900.000 364000.0
## CV residual  36250.92 378702.5 -331919.6 -192218.4  -5976.193  27915.2
##                   412       421       424       466       482       497
## Predicted   2159366.5 605600.29  747434.4  894768.0 603262.67 613765.35
## cvpred      2216780.1 617398.65  768038.8  910101.9 607505.94 617676.24
## price_sold  2700000.0 524900.00  500000.0  530000.0 520000.00 633000.00
## CV residual  483219.9 -92498.65 -268038.8 -380101.9 -87505.94  15323.76
##                  508         517        524       530       531       564
## Predicted   546724.5 382765.4849 465873.821  749623.5 248317.74 312304.16
## cvpred      551349.2 379922.3287 462826.773  758231.3 250104.39 296423.89
## price_sold  685000.0 380000.0000 455000.000  450000.0 200000.00 340000.00
## CV residual 133650.8     77.6713  -7826.773 -308231.3 -50104.39  43576.11
##                   572      584       592       599       602       603
## Predicted   201510.81 442697.5  608111.6  511652.3  32170.72  31965.16
## cvpred      202271.72 440496.7  610938.4  522175.3  24746.60  24528.28
## price_sold  225000.00 629900.0 1285000.0  290000.0 110000.00 111000.00
## CV residual  22728.28 189403.3  674061.6 -232175.3  85253.40  86471.72
##                   604       629      646       657      668       676      685
## Predicted   310580.78 162016.92 139482.5 425321.61 234081.7 311310.49 411028.7
## cvpred      315621.57 152794.71 132127.7 421529.06 233420.0 305056.87 404589.5
## price_sold  252000.00 229600.00 245900.0 383000.00 215000.0 280000.00 649900.0
## CV residual -63621.57  76805.29 113772.3 -38529.06 -18420.0 -25056.87 245310.5
##                   691       720       739       750       760       771
## Predicted   137397.25 213839.54  546512.8  452854.9 198797.00 156877.53
## cvpred      149108.62 208535.94  554715.8  472019.6 199096.18 146089.87
## price_sold  248000.00 225000.00  255000.0  255000.0 292000.00 230000.00
## CV residual  98891.38  16464.06 -299715.8 -217019.6  92903.82  83910.13
##                   782       788       798       813       820      835      837
## Predicted    503464.3 568422.96  544255.0 184511.49  562531.5 228584.3  1435363
## cvpred       496495.4 572227.54  542897.3 185121.67  567990.9 228680.7  1519047
## price_sold   282500.0 490000.00  314500.0 249900.00  133000.0 500000.0   215000
## CV residual -213995.4 -82227.54 -228397.3  64778.33 -434990.9 271319.3 -1304047
##                   838       851      860      863       884       887       894
## Predicted   309138.48  378434.1 327506.5 170976.2 186921.07  62842.31 329225.81
## cvpred      309563.55  382531.9 316792.8 159011.6 179286.48  70364.52 325037.34
## price_sold  215000.00  276000.0 459900.0 360000.0 202000.00 207500.00 275000.00
## CV residual -94563.55 -106531.9 143107.2 200988.4  22713.52 137135.48 -50037.34
##                  907      911       919       939       943       947       970
## Predicted   362496.2 129160.1  476293.4 197130.69  74457.96  99709.46  40678.24
## cvpred      366087.4 125208.9  488958.8 193281.75  76384.36 102250.80  32683.12
## price_sold  495000.0 176500.0  350000.0 256000.00 108000.00 160500.00 234900.00
## CV residual 128912.6  51291.1 -138958.8  62718.25  31615.64  58249.20 202216.88
##                    976       982      989       993       997      1007
## Predicted   288930.922 501857.75 176623.6 141913.79  35697.59  389752.4
## cvpred      292627.355 509120.62 172101.1 130360.17  26073.75  385877.1
## price_sold  295000.000 560000.00 333000.0 230000.00 260000.00  260000.0
## CV residual   2372.645  50879.38 160898.9  99639.83 233926.25 -125877.1
##                   1041      1045     1067      1087      1103      1108
## Predicted   394603.948  282112.4 437038.7 394600.38  90373.86 184784.32
## cvpred      394341.484  293388.1 441243.2 387392.47  97333.21 189309.62
## price_sold  385000.000  182850.0 565000.0 317000.00 253000.00 149000.00
## CV residual  -9341.484 -110538.1 123756.8 -70392.47 155666.79 -40309.62
##                  1109      1110      1126      1138      1182      1183
## Predicted    22386.40 231330.91  39626.19 523615.68 324890.79 182174.07
## cvpred       17708.15 225328.94  28487.27 522822.22 334687.93 186205.17
## price_sold  168000.00 147400.00 180000.00 485000.00 270000.00 227000.00
## CV residual 150291.85 -77928.94 151512.73 -37822.22 -64687.93  40794.83
##                 1194     1217      1227     1234     1238      1244     1251
## Predicted   72993.01 314120.7  74365.45 122721.5 219351.5  277923.8 273795.9
## cvpred      70284.02 310603.5  76359.36 129783.4 215624.4  277491.9 268508.2
## price_sold  90000.00 415000.0 180000.00 250000.0 339000.0  165000.0 450000.0
## CV residual 19715.98 104396.5 103640.64 120216.6 123375.6 -112491.9 181491.8
##                  1294      1301     1309     1322      1328     1331      1332
## Predicted   251724.21 249455.49 262309.5 187067.6 1092632.9 360273.0  308074.9
## cvpred      245506.07 255258.69 256015.6 176981.4 1100544.4 359914.7  306143.4
## price_sold  200000.00 242394.00 280000.0 367700.0  665000.0 516116.0  160000.0
## CV residual -45506.07 -12864.69  23984.4 190718.6 -435544.4 156201.3 -146143.4
##                  1333      1338      1341      1346      1349      1358
## Predicted   252644.25 270576.93  171856.5 229517.47 208344.21 338644.34
## cvpred      246189.89 278997.37  164839.2 231957.58 212534.31 337424.47
## price_sold  214000.00 227000.00   10000.0 300749.00 122000.00 425000.00
## CV residual -32189.89 -51997.37 -154839.2  68791.42 -90534.31  87575.53
##                  1359       1361      1368
## Predicted    547723.3 324302.164  270576.9
## cvpred       549436.1 325478.448  278997.3
## price_sold   285000.0 335000.000  100000.0
## CV residual -264436.1   9521.552 -178997.3
## 
## Sum of squares = 8.274839e+12    Mean square = 59531216654    n = 139 
## 
## fold 9 
## Observations in test set: 139 
##                    16      37      39        50        71       79        92
## Predicted   143521.02  666946 1040419 323666.83 348467.58 371593.2 1185797.8
## cvpred      134224.36  663668 1031312 324749.34 342546.96 369487.8 1184294.6
## price_sold   90000.00 1650000 2275000 250000.00 392875.00 685000.0  700000.0
## CV residual -44224.36  986332 1243688 -74749.34  50328.04 315512.2 -484294.6
##                   93       98       110        111       119       127
## Predicted   313331.0 159457.5  382764.6 238846.087 214752.28  502639.4
## cvpred      307857.9 147209.0  376980.0 234015.343 209178.19  503511.2
## price_sold  530000.0 445000.0  221500.0 225000.000 188500.00  362500.0
## CV residual 222142.1 297791.0 -155480.0  -9015.343 -20678.19 -141011.2
##                   130       133       140      155       161       171
## Predicted    343487.9  565245.8 253087.63 332990.7 1143680.2  667618.8
## cvpred       341599.1  565984.7 239844.29 323525.8 1146083.5  663701.7
## price_sold   223000.0   84123.0 290000.00 500000.0  975000.0  430000.0
## CV residual -118599.1 -481861.7  50155.71 176474.2 -171083.5 -233701.7
##                   186       187       226       231       234       286
## Predicted    829770.6 277290.42 259546.34  62579.27  396351.9 223469.92
## cvpred       829600.1 272097.91 253965.82  58200.16  393476.9 221501.11
## price_sold  1100000.0 241000.00 350000.00  40000.00  287400.0 244800.00
## CV residual  270399.9 -31097.91  96034.18 -18200.16 -106076.9  23298.89
##                   287       293       297      308       316       329
## Predicted   233437.08  943473.6  883310.0 573973.4  360895.4 333528.31
## cvpred      228244.35  943240.1  883182.8 571004.5  358968.2 330995.35
## price_sold  140000.00 1900000.0 1400000.0 710000.0  255500.0 307200.00
## CV residual -88244.35  956759.9  516817.2 138995.5 -103468.2 -23795.35
##                   331       364      374      379      385       388       398
## Predicted   608471.78 190163.44 104544.2 118779.8 169191.3 564523.51 1452637.9
## cvpred      616082.44 188382.32 103944.0 114186.3 156168.6 568273.43 1454416.8
## price_sold  630000.00 159000.00 275000.0 266900.0 320000.0 550000.00 1324000.0
## CV residual  13917.56 -29382.32 171056.0 152713.7 163831.4 -18273.43 -130416.8
##                  407       417       420       436       437       448
## Predicted   288594.0 1466505.4  693066.0 600166.73  809300.8  945354.0
## cvpred      279232.4 1467507.9  693243.6 600160.84  808974.6  945970.2
## price_sold  225000.0  999000.0 1200000.0 675000.00  560000.0  700000.0
## CV residual -54232.4 -468507.9  506756.4  74839.16 -248974.6 -245970.2
##                   451       471        472        481       484      495
## Predicted    82948.79 412425.56 315200.989 214805.695  736207.5 528880.5
## cvpred       75504.87 409508.97 313575.141 201632.558  732891.2 529104.9
## price_sold   55000.00 320000.00 311500.000 199000.000  520000.0 769100.0
## CV residual -20504.87 -89508.97  -2075.141  -2632.558 -212891.2 239995.1
##                    501       522       533       544       552      561
## Predicted   279721.171 122637.04  404305.7  458374.3 402840.07 274818.9
## cvpred      274943.488 115195.91  401604.1  455589.4 399907.33 269342.4
## price_sold  280000.000 175000.00  168000.0  211973.0 347000.00 454500.0
## CV residual   5056.512  59804.09 -233604.1 -243616.4 -52907.33 185157.6
##                   565       571       581       595      596       610
## Predicted   422095.56 195207.09  723045.9 568787.21 464259.9  427695.3
## cvpred      419618.77 190508.09  724198.2 566142.56 464600.0  422872.0
## price_sold  482500.00 225000.00 1050000.0 532000.00 717000.0  270000.0
## CV residual  62881.23  34491.91  325801.8 -34142.56 252400.0 -152872.0
##                   619       628        641        665       669        701
## Predicted   253661.71 162016.92 106689.592 406598.707  507298.1  -5581.092
## cvpred      251860.55 157324.29 102290.759 403829.523  500834.6 -14006.842
## price_sold  229000.00 229600.00  95500.000 405000.000  390000.0 175000.000
## CV residual -22860.55  72275.71  -6790.759   1170.477 -110834.6 189006.842
##                   705       710       734       737        751       772
## Predicted   195233.55 287992.98 215350.12 240903.08 199321.257 156877.53
## cvpred      190381.53 289282.81 209828.68 235218.41 197677.311 152423.35
## price_sold  219900.00 255000.00 144500.00 223500.00 199000.000 230000.00
## CV residual  29518.47 -34282.81 -65328.68 -11718.41   1322.689  77576.65
##                   777       778       789      795       797       799
## Predicted   205673.26 191470.90  299550.1 310987.7  397609.7  454061.8
## cvpred      207930.57 186885.24  304660.6 309317.9  398733.3  452287.9
## price_sold  230700.00 227500.00  172950.0 565100.0  267000.0  300000.0
## CV residual  22769.43  40614.76 -131710.6 255782.1 -131733.3 -152287.9
##                   804       815      818       836       846      855       865
## Predicted   155465.99  338588.4 221665.4  759081.3 388904.94 301339.6  42615.19
## cvpred      153866.01  339944.2 215867.7  753052.7 386766.44 288347.8  34317.41
## price_sold  127000.00  190000.0 404325.0  300000.0 360000.00 589000.0 205000.00
## CV residual -26866.01 -149944.2 188457.3 -453052.7 -26766.44 300652.2 170682.59
##                   876       880      882       886       896       917
## Predicted    46683.61 412897.95 343225.0  48639.94 112858.48 206823.16
## cvpred       42399.25 414104.47 340570.6  41099.72 107534.07 205218.73
## price_sold  120000.00 430000.00 445000.0 207500.00 175000.00 189000.00
## CV residual  77600.75  15895.53 104429.4 166400.28  67465.93 -16218.73
##                   920      932       936       945       951       957      966
## Predicted   242184.19 219937.3  36755.10 163291.20  37186.94 120950.89 257192.3
## cvpred      229053.62 218335.1  32282.24 158808.58  32703.58 120304.59 255664.1
## price_sold  207000.00 382000.0 175000.00 180000.00 191600.00 179900.00 512500.0
## CV residual -22053.62 163664.9 142717.76  21191.42 158896.42  59595.41 256835.9
##                  968        971       975      979      990       995      1008
## Predicted    85595.5 232155.825 388904.91 362823.9 238077.2 281378.33  389752.4
## cvpred       77329.3 230641.376 386766.41 360003.6 236475.5 276754.23  387050.5
## price_sold  200000.0 227000.000 360000.00 510000.0 500000.0 250000.00  260000.0
## CV residual 122670.7  -3641.376 -26766.41 149996.4 263524.5 -26754.23 -127050.5
##                  1019       1021      1022     1031      1046      1086
## Predicted    307357.9 110345.687 145572.13 432937.1 267910.02 273264.78
## cvpred       302548.1 105906.461 144956.49 434265.5 263242.37 278103.05
## price_sold   164000.0 115700.000  91000.00 560000.0 182850.00 215000.00
## CV residual -138548.1   9793.539 -53956.49 125734.5 -80392.37 -63103.05
##                 1093      1121      1137      1139      1151     1165      1198
## Predicted   59733.78  415159.7  17521.97  458853.3 198324.10 689562.2 243032.41
## cvpred      55580.67  412209.6  10019.28  456281.0 193843.29 689291.7 241160.43
## price_sold  88000.00  280000.0 213000.00  160000.0 180000.00 843475.0 170000.00
## CV residual 32419.33 -132209.6 202980.72 -296281.0 -13843.29 154183.3 -71160.43
##                  1211      1222      1224     1230     1239      1257      1263
## Predicted   142555.51 402733.81  78260.32 134250.3 205149.2  474196.1 168573.64
## cvpred      141052.18 399795.46  66493.60 132797.8 203743.2  472505.6 167937.04
## price_sold  111500.00 480000.00 131000.00 165000.0 339000.0  190000.0 157000.00
## CV residual -29552.18  80204.54  64506.40  32202.2 135256.8 -282505.6 -10937.04
##                 1265      1277      1282      1284      1289       1299
## Predicted   280241.0  497833.8 168437.53  338091.6 652215.79  -3739.199
## cvpred      277556.3  500110.6 164015.31  336581.6 655920.83 -11030.635
## price_sold  416000.0  313000.0 209900.00   85000.0 560200.00  45000.000
## CV residual 138443.7 -187110.6  45884.69 -251581.6 -95720.83  56030.635
##                  1312      1356      1360     1373      1378      1388
## Predicted   213007.46 338644.34  308562.2 224828.8 117244.56 145712.73
## cvpred      208710.26 333264.13  305903.2 219826.4 112922.88 144275.33
## price_sold  220000.00 425000.00  190000.0 353000.0  50000.00 215000.00
## CV residual  11289.74  91735.87 -115903.2 133173.6 -62922.88  70724.67
## 
## Sum of squares = 7.306499e+12    Mean square = 52564743314    n = 139 
## 
## fold 10 
## Observations in test set: 138 
##                      2        3         6        14        15       30       40
## Predicted   342873.736 38219.96  546869.4 131298.67 131298.67 38219.96 214681.9
## cvpred      338486.227 35970.86  545470.2 130580.96 130580.96 35970.86 214633.5
## price_sold  339900.000 90000.00  170000.0 179000.00 200000.00 90000.00 595000.0
## CV residual   1413.773 54029.14 -375470.2  48419.04  69419.04 54029.14 380366.5
##                    46       49         66        67       72       97       101
## Predicted   276104.71 164936.9   161880.8  390541.0 391086.4 721477.4  98100.49
## cvpred      273676.87 164882.1  2413027.7  412566.7 406262.6 721826.9  94870.26
## price_sold  235000.00 130000.0   160000.0  289000.0 520000.0 675000.0 315000.00
## CV residual -38676.87 -34882.1 -2253027.7 -123566.7 113737.4 -46826.9 220129.74
##                   114       124      125        131     134       145       149
## Predicted    212955.3 833006.92 388411.5 371221.386  758761  882654.5  277034.6
## cvpred       213408.2 834936.53 392228.9 373840.227  762197  889078.4  275937.0
## price_sold    54474.0 849000.00 629000.0 382750.000  110000  680000.0  140000.0
## CV residual -158934.2  14063.47 236771.1   8909.773 -652197 -209078.4 -135937.0
##                  152     172      181      198      204       229       239
## Predicted   174690.5 1880205 420940.4 175084.2 527445.4 1271916.4 419713.59
## cvpred      170164.4 1874100 422766.9 175124.4 533751.4 1271301.2 421773.38
## price_sold  335000.0 3600000 445000.0 285000.0 780000.0  700000.0 358000.00
## CV residual 164835.6 1725900  22233.1 109875.6 246248.6 -571301.2 -63773.38
##                   258        269        278       296      303      309
## Predicted    371758.0 173994.286 1203949.90  883310.0 547496.0 573973.4
## cvpred       374124.3 173548.367 1208379.86  881782.2 552184.6 573024.6
## price_sold    90201.0 165000.000 1237500.00 1400000.0 675000.0 710000.0
## CV residual -283923.3  -8548.367   29120.14  518217.8 122815.4 136975.4
##                   332       356       359      360       375       390
## Predicted    531256.2  937486.5  522776.0 501820.7  533987.4 209622.87
## cvpred       530389.7  941629.2  522415.1 507079.8  532979.8 209633.28
## price_sold   365000.0 1128000.0  314500.0 712000.0  322000.0 244554.00
## CV residual -165389.7  186370.8 -207915.1 204920.2 -210979.8  34920.72
##                   395       402      415       435       442       449
## Predicted   274966.48 551340.82 140706.8 210248.21  738928.7  275208.5
## cvpred      272450.04 556298.76 133728.0 214137.02  740953.9  272875.4
## price_sold  208000.00 480000.00 292000.0 235000.00  499000.0  170000.0
## CV residual -64450.04 -76298.76 158272.0  20862.98 -241953.9 -102875.4
##                   462       469       476       487       496      506
## Predicted   276977.30  546869.6 935498.37  777963.2  541794.6 546724.5
## cvpred      274915.69  545485.7 932596.06  780591.3  545288.6 545628.3
## price_sold  287500.00  170000.0 980000.00  525000.0  375000.0 685000.0
## CV residual  12584.31 -375485.7  47403.94 -255591.3 -170288.6 139371.7
##                   513       536      540      541       553       569      597
## Predicted    441930.1  79009.81 152138.1 340486.7  869879.4  300206.5 464259.9
## cvpred       436985.7  74639.43 151328.4 342456.9  870194.0  296690.4 469317.2
## price_sold   279000.0 110111.00 265000.0 485000.0  410000.0  173000.0 717000.0
## CV residual -157985.7  35471.57 113671.6 142543.1 -460194.0 -123690.4 247682.8
##                   615       621       656      664      678       681       682
## Predicted    34237.58  424311.2 225415.28 194777.2 439742.5 251758.97  74365.63
## cvpred       30662.56  426763.8 224595.12 195250.8 440276.7 249619.21  69768.79
## price_sold  154000.00  308500.0 190000.00 315000.0 700000.0 220000.00 173000.00
## CV residual 123337.44 -118263.8 -34595.12 119749.2 259723.3 -29619.21 103231.21
##                   687       688       689      692       721       724
## Predicted   209388.15 199936.22 281099.79  40894.2 308997.23  90484.29
## cvpred      208457.34 198027.97 279994.39  37021.6 311227.69  85736.88
## price_sold  235000.00 240000.00 343000.00 120000.0 395000.00 232500.00
## CV residual  26542.66  41972.03  63005.61  82978.4  83772.31 146763.12
##                   730       740       773       776       802      806
## Predicted    810881.0  469806.5  514471.0 1540382.0 173326.45 253317.3
## cvpred       811077.1  470260.0  513398.5 1535380.7 173087.62 251545.1
## price_sold   468000.0  275000.0  329900.0  980000.0 223000.00 550000.0
## CV residual -343077.1 -195260.0 -183498.5 -555380.7  49912.38 298454.9
##                   816       819       826       833       840       841
## Predicted   1052765.8 251609.23 576457.79 166852.77  494230.6  697046.7
## cvpred      1054674.3 249969.25 575580.55 165714.93  493243.7  697588.6
## price_sold   460000.0 224000.00 637000.00 197500.00   73000.0  385000.0
## CV residual -594674.3 -25969.25  61419.45  31785.07 -420243.7 -312588.6
##                  853       859       877       881       895      898      901
## Predicted   298265.3 241869.71 347616.70  396493.5 310667.60 284967.3 238045.3
## cvpred      300928.8 239324.09 348059.42  391234.0 314420.75 281740.0 235256.8
## price_sold  265000.0 259000.00 365000.00  120000.0 285000.00 565000.0 511000.0
## CV residual -35928.8  19675.91  16940.58 -271234.0 -29420.75 283260.0 275743.2
##                   909       918       937       950       952      959
## Predicted   319130.73 206823.16 177546.61 280656.89 307827.17 172608.3
## cvpred      321204.11 205055.99 170480.55 277863.56 311327.77 171382.0
## price_sold  235000.00 189000.00 214300.00 265000.00 260000.00 360000.0
## CV residual -86204.11 -16055.99  43819.45 -12863.56 -51327.77 188618.0
##                   969       974       998       999      1002      1015
## Predicted   176373.72 409159.44 380187.18 165236.17 158020.95  405990.2
## cvpred      175366.54 411249.38 382989.08 164050.83 156894.47  405679.4
## price_sold  200000.00 380000.00 357000.00 134900.00  90500.00  260000.0
## CV residual  24633.46 -31249.38 -25989.08 -29150.83 -66394.47 -145679.4
##                  1029     1030      1049      1075     1076     1077     1090
## Predicted   268472.22 254269.9 144324.41  56923.42 482318.8 452141.5 355365.9
## cvpred      264369.78 251553.5 143723.01  52406.11 481631.8 451910.1 356294.5
## price_sold  222000.00 222000.0  71050.00 180000.00 700000.0 700000.0 690000.0
## CV residual -42369.78 -29553.5 -72673.01 127593.89 218368.2 248089.9 333705.5
##                 1094      1102     1104      1115      1131     1143     1147
## Predicted   164242.2  789111.6 234758.1  761756.4 318850.26 235823.8 204252.8
## cvpred      158143.5  791531.5 232515.5  757295.0 320754.31 232663.0 202269.0
## price_sold  357000.0 1070000.0 141000.0 1150000.0 257000.00 495000.0 380000.0
## CV residual 198856.5  278468.5 -91515.5  392705.0 -63754.31 262337.0 177731.0
##                  1152     1153      1155      1156      1161      1163
## Predicted   212526.46 198324.1  591656.5 246644.96 210454.24  89909.46
## cvpred      209046.17 196229.9  589161.0 245854.58 207349.26  84736.18
## price_sold  180000.00 180000.0  390000.0 300000.00 284000.00 320000.00
## CV residual -29046.17 -16229.9 -199161.0  54145.42  76650.74 235263.82
##                  1167      1202    1216      1219      1231     1245       1260
## Predicted   406196.39  75267.11  328323 174646.74  345124.7 193690.8 443330.839
## cvpred      395249.16  69843.48  322017 172212.49  346316.8 186422.5 443631.327
## price_sold  350000.00 277000.00   13233 230000.00  152000.0 370000.0 435000.000
## CV residual -45249.16 207156.52 -308784  57787.51 -194316.8 183577.5  -8631.327
##                  1272      1295      1305      1316       1326     1342
## Predicted    202127.4 265926.58 150443.48 210512.93 126181.652 157388.6
## cvpred       198625.4 262048.53 148629.11 209510.15 118087.997 155474.2
## price_sold    10000.0 200000.00 195000.00 150000.00 120000.000 307000.0
## CV residual -188625.4 -62048.53  46370.89 -59510.15   1912.003 151525.8
##                  1352      1362
## Predicted   266846.61 310099.80
## cvpred      262308.33 310344.18
## price_sold  214000.00 335500.00
## CV residual -48308.33  25155.82
## 
## Sum of squares = 1.343972e+13    Mean square = 97389257205    n = 138 
## 
## Overall (Sum over all 138 folds) 
##          ms 
## 94926487556
# MSPE 
n1 = dim(housing)[1]
MSPE1 <- sum((housing$price_sold - KCV1$cvpred)^2) / n1
MSPE1
## [1] 94926487556
# Press Statistic
PRESS1 <- sum((housing$price_sold - KCV1$cvpred)^2)
PRESS1
## [1] 1.31758e+14
# Prediction R-Squared
PRS1 <- 1 - sum((housing$price_sold - KCV1$cvpred)^2) / sum((housing$price_sold - 
                                                               mean(housing$price_sold))^2)
PRS1
## [1] 0.5105264

Model 2:

# K-fold
KCV2 = cv.lm(data = clean_housing, housing_model2, m = 10, seed = 0)

## 
## fold 1 
## Observations in test set: 136 
##                     4         7        12        34         42       55
## Predicted   198296.53  561968.7 364795.28  339111.1 246704.845 267081.5
## cvpred      191947.99  566880.3 362780.85  332101.4 241407.522 259558.0
## price_sold  178000.00  275000.0 399000.00 1050000.0 235000.000 417000.0
## CV residual -13947.99 -291880.3  36219.15  717898.6  -6407.522 157442.0
##                    62       74       80       115       122       136
## Predicted    463427.5 327096.0 516405.6  544993.9  256541.9 385644.42
## cvpred       454315.0 320445.4 507848.6  549607.7  250031.1 382984.59
## price_sold   289000.0 685000.0 625000.0  254900.0   92500.0 291500.00
## CV residual -165315.0 364554.6 117151.4 -294707.7 -157531.1 -91484.59
##                    151        177      182       187       195       214
## Predicted   2040401.21 566454.284 311224.0 530573.04 472864.39  866139.2
## cvpred      2079642.98 571558.115 309219.8 532236.26 477120.59  875751.6
## price_sold  2000000.00 566000.000 440000.0 570000.00 398000.00  740000.0
## CV residual  -79642.98  -5558.115 130780.2  37763.74 -79120.59 -135751.6
##                   216       261       268       279      281      290       296
## Predicted   520189.30 1002428.6 222021.22  758534.9 128188.8 510493.1 1488848.3
## cvpred      523205.37 1018821.1 215758.98  772822.2 121156.7 514281.3 1521618.8
## price_sold  572500.00 1237500.0 244800.00 1400000.0 476000.0 710000.0 1025000.0
## CV residual  49294.63  218678.9  29041.02  627177.8 354843.3 195718.7 -496618.8
##                   301      303       304       313       323       337
## Predicted    432733.5 428137.0 1162115.9  467290.2 198211.18  400538.0
## cvpred       434527.2 407181.5 1188763.5  468869.6 193419.53  401103.2
## price_sold   255000.0 605000.0  518535.0  365000.0 235000.00  256000.0
## CV residual -179527.2 197818.5 -670228.5 -103869.6  41580.47 -145103.2
##                   344       348       350       360       371       380
## Predicted   189874.23 656896.83  436192.2  452320.1  761990.1 341834.13
## cvpred      182384.26 664551.12  438569.4  455085.4  769729.2 338862.16
## price_sold  159000.00 590000.00  265000.0  300000.0  525000.0 308000.00
## CV residual -23384.26 -74551.12 -173569.4 -155085.4 -244729.2 -30862.16
##                   387       389      390      394       398      406       417
## Predicted   298766.12  412244.8 693537.0 135520.9  407135.8 398207.9  689299.9
## cvpred      294589.12  412428.6 708309.7 128169.6  405535.9 398498.8  696541.3
## price_sold  225000.00  245000.0 999000.0 292000.0  180000.0 330000.0  560000.0
## CV residual -69589.12 -167428.6 290690.3 163830.4 -225535.9 -68498.8 -136541.3
##                   419      445       450     459       465      468       476
## Predicted   534615.33 495786.0 88214.905 1077837  89959.40 334533.0  526391.3
## cvpred      536688.39 496263.9 79428.283 1093945  83029.13 332571.2  533525.0
## price_sold  587500.00 522375.0 81500.000  799900 150000.00 466400.0  375000.0
## CV residual  50811.61  26111.1  2071.717 -294045  66970.87 133828.8 -158525.0
##                   485       510       512       527       532       542
## Predicted   333290.86  657131.6 563211.39 333036.48 396677.80  787663.4
## cvpred      331255.54  666326.2 569781.82 330851.15 395915.83  796190.3
## price_sold  265000.00  450000.0 489900.00 272000.00 347000.00 1058756.0
## CV residual -66255.54 -216326.2 -79881.82 -58851.15 -48915.83  262565.7
##                   558       565       568       582       603        607
## Predicted   318518.75 708708.07 321707.48  73697.24 348131.52 228734.390
## cvpred      317450.66 725645.81 318594.58  64000.49 345634.18 228483.899
## price_sold  360000.00 655000.00 375000.00 110000.00 329000.00 229600.000
## CV residual  42549.34 -70645.81  56405.42  45999.51 -16634.18   1116.101
##                   614       619       620        623       626       630
## Predicted   159557.22  434660.8 127801.89 275805.684  644833.1  424508.8
## cvpred      155984.37  439451.7 124092.86 276292.547  647690.9  424603.1
## price_sold  188000.00  225000.0  95500.00 270000.000  246000.0  270000.0
## CV residual  32015.63 -214451.7 -28592.86  -6292.547 -401690.9 -154603.1
##                   637      642       652       668      674       676       680
## Predicted   420027.01 358460.9  556832.5 275084.81 456214.1 171644.67  75318.16
## cvpred      423835.61 359287.2  567422.2 269659.55 459400.3 166848.07  66979.88
## price_sold  383000.00 325000.0  310000.0 343000.00 577000.0 130000.00 175000.00
## CV residual -40835.61 -34287.2 -257422.2  73340.45 117599.7 -36848.07 108020.12
##                    682       694       696      705       715       719
## Predicted   138758.275 407952.12 479886.23 473463.0  379420.9  444773.7
## cvpred      133311.482 404863.56 484840.08 483544.1  381138.5  447500.2
## price_sold  140000.000 324900.00 440000.00 815000.0  150000.0  275000.0
## CV residual   6688.518 -79963.56 -44840.08 331455.9 -231138.5 -172500.2
##                  743       749       771      839       864       867       877
## Predicted   129385.5 202306.52 340453.14  88903.8  97293.89 181730.60 573076.36
## cvpred      122184.7 199747.66 339102.86  80360.3  89675.76 178225.92 582975.23
## price_sold  295000.0 230000.00 263000.00  60000.0 207500.00 267500.00 625000.00
## CV residual 172815.3  30252.34 -76102.86 -20360.3 117824.24  89274.08  42024.77
##                  879       900       903      910      916       917       920
## Predicted   242576.2 343225.29 339241.99 228794.1 184837.4 220424.06 309262.83
## cvpred      241912.1 346110.78 340057.29 226824.4 182092.8 213308.39 308062.48
## price_sold  511000.0 299900.00 380000.00 382000.0 396300.0 256000.00 295000.00
## CV residual 269087.9 -46210.78  39942.71 155175.6 214207.2  42691.61 -13062.48
##                   934      948      960       965      968       990       992
## Predicted   187429.51 106258.0 457830.8  443463.4 240953.2  348188.7 121549.46
## cvpred      183256.16 100814.9 457530.9  446078.9 239517.4  350863.3 110280.21
## price_sold  155000.00 234900.0 560000.0  232000.0 500000.0  210000.0 170000.00
## CV residual -28256.16 134085.1 102469.1 -214078.9 260482.6 -140863.3  59719.79
##                  1008      1064      1070      1071     1074      1084
## Predicted   264716.41 271711.35 88047.709 88047.709 359547.0  66155.75
## cvpred      263667.28 269012.38 83407.001 83407.001 361802.3  58012.01
## price_sold  222000.00 215000.00 88000.000 88000.000 565000.0 155000.00
## CV residual -41667.28 -54012.38  4592.999  4592.999 203197.7  96987.99
##                  1090      1092     1094      1124      1139      1140
## Predicted   272789.15 236552.57 292151.8 220617.54 211831.44 118105.07
## cvpred      272234.82 235765.16 292250.3 219473.86 212328.99 111752.76
## price_sold  221500.00 250000.00 454500.0 256000.00 284000.00 189900.00
## CV residual -50734.82  14234.84 162249.7  36526.14  71671.01  78147.24
##                  1144     1145     1170      1179      1185     1191      1213
## Predicted    651593.6 338049.1 198383.9  351256.0 184698.21 269717.9  278225.2
## cvpred       659377.0 339878.5 196812.7  356611.1 185016.68 268330.8  278876.8
## price_sold  1240000.0 350000.0 325000.0  235000.0 152500.00 429000.0   76000.0
## CV residual  580623.0  10121.5 128187.3 -121611.1 -32516.68 160669.2 -202876.8
##                  1219      1255      1271      1278      1282       1291
## Predicted   208382.61 388434.87  318992.2 256382.45  218628.7 213982.436
## cvpred      206560.07 394148.92  322129.0 256867.26  216344.7 215033.584
## price_sold  165000.00 313000.00  125000.0 242394.00   45000.0 220000.000
## CV residual -41560.07 -81148.92 -197129.0 -14473.26 -171344.7   4966.416
##                  1305      1313      1315     1336      1343     1345      1358
## Predicted    259345.9  312604.3 249102.20 308299.5  314149.1 248727.8 299393.07
## cvpred       262068.6  314830.5 241040.42 306396.4  319594.7 240544.9 304189.86
## price_sold   150000.0  186500.0 230000.00 425000.0  219000.0 189000.0 280000.00
## CV residual -112068.6 -128330.5 -11040.42 118603.6 -100594.7 -51544.9 -24189.86
##                  1359
## Predicted   202267.08
## cvpred      201640.63
## price_sold  175000.00
## CV residual -26640.63
## 
## Sum of squares = 4.580109e+12    Mean square = 33677274428    n = 136 
## 
## fold 2 
## Observations in test set: 137 
##                     5        8         9        11       21        23       27
## Predicted   365173.62 561620.9 244671.48 311662.22 261795.7  69258.14 135097.7
## cvpred      368806.05 562126.0 247201.83 300579.04 256406.8  61390.14 129529.3
## price_sold  269900.00 680000.0 233000.00 341000.00 403000.0 110000.00 317500.0
## CV residual -98906.05 117874.0 -14201.83  40420.96 146593.2  48609.86 187970.7
##                    70       82       88        89       102       108       112
## Predicted    406764.3 262264.6 318088.1 676079.62  624051.1  293610.6 236371.61
## cvpred       413203.6 260179.9 316191.4 684657.14  631995.6  296884.2 236959.33
## price_sold   185000.0 450000.0 530000.0 670000.00  245000.0  133000.0 188500.00
## CV residual -228203.6 189820.1 213808.6 -14657.14 -386995.6 -163884.2 -48459.33
##                   127      145       149       154      155       167       173
## Predicted    684210.1 164387.1 325092.56  594884.6 589788.9 350555.13 1194287.6
## cvpred       696337.1 160033.2 326999.52  599062.2 587500.4 349641.52 1206076.4
## price_sold   110000.0 335000.0 415000.00  425000.0 853000.0 410000.00  980000.0
## CV residual -586337.1 174966.8  88000.48 -174062.2 265499.6  60358.48 -226076.4
##                   175      197       201      207      209      232      239
## Predicted   287102.04 190454.6  886693.6 508440.7 516392.1 436006.2 709000.9
## cvpred      282975.03 189596.3  903687.3 514816.4 519863.6 440328.4 721004.3
## price_sold  241000.00 290000.0  640000.0 426500.0 750000.0 950000.0 695000.0
## CV residual -41975.03 100403.7 -263687.3 -88316.4 230136.4 509671.6 -26004.3
##                   246       256       260      271        275       284
## Predicted   420690.89  244449.6  487322.1 549642.4 352644.031  786310.9
## cvpred      426371.14  244148.3  495371.7 558048.3 359263.861  797782.5
## price_sold  515000.00   19330.0  315700.0 515000.0 355000.000  490000.0
## CV residual  88628.86 -224818.3 -179671.7 -43048.3  -4263.861 -307782.5
##                  285       288      291       298       302       307       317
## Predicted   539229.6 479572.37 510493.1  371895.7  886256.4 390774.36 224623.91
## cvpred      549491.0 486889.41 515451.9  377110.2  899969.6 396251.42 224451.17
## price_sold  675000.0 484000.00 710000.0  255500.0  650000.0 325000.00 290000.00
## CV residual 125509.0  -2889.41 194548.1 -121610.2 -249969.6 -71251.42  65548.83
##                  318       329       343       374      395       397       408
## Predicted   186208.3 396848.02  670084.7 557904.14 135520.7 1196537.9 118817.46
## cvpred      185587.4 402267.07  676141.6 564329.54 124736.7 1214011.5 115878.58
## price_sold  202000.0 430000.00 1075000.0 500000.00 292000.0  999000.0 193900.00
## CV residual  16412.6  27732.93  398858.4 -64329.54 167263.3 -215011.5  78021.42
##                    413       429       442       451       464       466
## Predicted   178204.818  274691.9 274298.85 389010.91 595744.39 247163.71
## cvpred      174290.206  273564.5 273765.86 393788.96 599879.82 248997.37
## price_sold  183000.000  170000.0 287500.00 320000.00 520000.00 187500.00
## CV residual   8709.794 -103564.5  13734.14 -73788.96 -79879.82 -61497.37
##                   471       480       507       523      538       552
## Predicted   206523.54 460784.77 399490.93  610731.4 467593.7 214967.42
## cvpred      207912.26 468289.88 406242.75  621286.2 475376.5 214355.52
## price_sold  215000.00 427000.00 381300.00  420000.0 595000.0 225000.00
## CV residual   7087.74 -41289.88 -24942.75 -201286.2 119623.5  10644.48
##                   575       589       618       635       638       648
## Predicted   515150.88 203994.31 217686.44 257873.16 531582.10 472937.80
## cvpred      516937.46 203406.59 216987.53 259790.74 536551.81 474091.18
## price_sold  532000.00 175000.00 266000.00 190000.00 449000.00 390000.00
## CV residual  15062.54 -28406.59  49012.47 -69790.74 -87551.81 -84091.18
##                  657      700       713       720       727       731
## Predicted   427555.7 345812.5 236680.20  551400.7  73988.30 397963.08
## cvpred      431645.1 349474.8 236738.52  555734.7  68349.62 401303.22
## price_sold  700000.0 395000.0 144500.00   38500.0 200100.00 460000.00
## CV residual 268354.9  45525.2 -92238.52 -517234.7 131750.38  58696.78
##                    735       751       775       777       789       790
## Predicted   136011.514 202306.52 189034.69  521742.7  394890.9  340332.8
## cvpred      133048.589 200145.35 188608.65  530338.7  399967.3  339507.7
## price_sold  126000.000 230000.00 199900.00  314500.0  270000.0  210000.0
## CV residual  -7048.589  29854.65  11291.35 -215838.7 -129967.3 -129507.7
##                   796        802      805      811       830       835
## Predicted   427661.29 211048.276 495771.6 118756.2 320755.24 243983.71
## cvpred      438173.49 212678.337 499407.6 115818.1 325830.57 243182.06
## price_sold  369415.00 220000.000 637000.0 265000.0 265000.00 230000.00
## CV residual -68758.49   7321.663 137592.4 149181.9 -60830.57 -13182.06
##                   838       846      847       850       854       865
## Predicted   359116.44  235218.5 230605.9  320745.2  75982.74  81934.16
## cvpred      360985.74  234676.8 229287.6  324917.3  68247.32  77803.37
## price_sold  459900.00  128000.0 379000.0  172000.0 120000.00 207500.00
## CV residual  98914.26 -106676.8 149712.4 -152917.3  51752.68 129696.63
##                   872      880        884       894       897      940    958
## Predicted   336696.30 134718.4 573287.027 156673.20 415289.66 191699.3 215980
## cvpred      341302.43 126162.9 578048.699 153265.81 414076.06 187576.5 215367
## price_sold  275000.00 100000.0 575000.000 176500.00 350000.00 310000.0 121500
## CV residual -66302.43 -26162.9  -3048.699  23234.19 -64076.06 122423.5 -93867
##                  963      977       996      1001      1002      1003      1005
## Predicted   298698.8 178344.6  278699.3 295930.65 354563.68 160347.64 89076.048
## cvpred      297636.6 175401.0  277146.9 297488.66 355772.21 155774.99 85586.758
## price_sold  420000.0 134900.0  164000.0 280000.00 262500.00 135000.00 90000.000
## CV residual 122363.4 -40501.0 -113146.9 -17488.66 -93272.21 -20774.99  4413.242
##                  1012     1014      1016      1028      1030      1097
## Predicted   371679.21 225457.4  278119.0 239282.32  476575.9 210451.04
## cvpred      373622.22 224286.5  276387.3 237398.94  479605.6 210102.87
## price_sold  450000.00 355000.0  135000.0 190000.00  333850.0 145000.00
## CV residual  76377.78 130713.5 -141387.3 -47398.94 -145755.6 -65102.87
##                  1114      1115      1117      1127      1134      1154
## Predicted   511431.46  91903.26  428796.3  91838.32 238741.88 114376.97
## cvpred      516190.31  90612.33  429460.6  84624.65 238095.34 106834.14
## price_sold  485000.00 213000.00  160000.0 158000.00 300000.00  40000.00
## CV residual -31190.31 122387.67 -269460.6  73375.35  61904.66 -66834.14
##                  1157      1159     1169      1181      1187      1188
## Predicted    236962.8 142442.37 189709.4  92748.13 348759.72  389801.4
## cvpred       231130.7 135007.78 188045.6  85533.20 348747.04  397802.4
## price_sold    60000.0  55000.00 320000.0 277000.00 420000.00  225000.0
## CV residual -171130.7 -80007.78 131954.4 191466.80  71252.96 -172802.4
##                  1197      1211     1218      1220      1234      1235
## Predicted   189854.92  237525.9 232389.8 208382.61 118450.86  396846.3
## cvpred      184717.84  232724.8 229873.2 202526.28 109582.02  392609.6
## price_sold  230000.00   86000.0 435000.0 165000.00  58500.00  190000.0
## CV residual  45282.16 -146724.8 205126.8 -37526.28 -51082.02 -202609.6
##                  1263     1264      1272      1274      1299      1308     1325
## Predicted   383326.04 214908.6 277483.29  97510.45  93293.83 310433.44 134534.3
## cvpred      387024.47 214297.4 277054.99  92129.04  86786.73 306559.69 126582.7
## price_sold  374900.00 225000.0 200000.00 162000.00 131000.00 229000.00 131000.0
## CV residual -12124.47  10702.6 -77054.99  69870.96  44213.27 -77559.69   4417.3
##                  1333      1353
## Predicted   188612.40 219417.68
## cvpred      187749.41 215871.31
## price_sold   90000.00 245900.00
## CV residual -97749.41  30028.69
## 
## Sum of squares = 3.115819e+12    Mean square = 22743202595    n = 137 
## 
## fold 3 
## Observations in test set: 137 
##                    19        22        28        32        38        45
## Predicted    329557.3 206614.54  361168.6 249145.83 254315.35 185970.65
## cvpred       330087.1 209276.64  367429.7 252075.36 257957.49 191257.21
## price_sold   219000.0 173000.00  120000.0 230000.00 292000.00 130000.00
## CV residual -111087.1 -36276.64 -247429.7 -22075.36  34042.51 -61257.21
##                    47        60        84        87      106       120
## Predicted    355574.1  407079.3  583361.0 1005838.7 670983.8  493327.0
## cvpred       358439.6  416571.5  601522.5 1001599.9 669816.7  501519.5
## price_sold   200000.0  180000.0  218900.0  700000.0 615000.0  362500.0
## CV residual -158439.6 -236571.5 -382622.5 -301599.9 -54816.7 -139019.5
##                   142       146       172       178       188        194
## Predicted    257851.6 129792.54 515645.72 1134854.7  403759.3 1454922.27
## cvpred       260640.6 131190.57 514841.24 1123804.5  404732.8 1433299.99
## price_sold   140000.0 225000.00 525000.00 1609000.0  280000.0 1501960.00
## CV residual -120640.6  93809.43  10158.76  485195.5 -124732.8   68660.01
##                  204       218       221       224       237       238
## Predicted   417034.2 379529.56 1102686.8  889062.1 1296148.1 817730.48
## cvpred      415721.8 385099.43 1081912.2  884277.0 1278585.2 815559.86
## price_sold  834900.0 287400.00 1800000.0 1350000.0 1650000.0 792500.00
## CV residual 419178.2 -97699.43  718087.8  465723.0  371414.8 -23059.86
##                   314       322       331      332       354        368
## Predicted   460472.78 375053.13  500063.6 449222.0  97901.07 532903.519
## cvpred      460302.77 375562.84  498389.9 453191.8  97896.45 540834.557
## price_sold  365000.00 387500.00  349900.0 873500.0 275000.00 550000.000
## CV residual -95302.77  11937.16 -148489.9 420308.2 177103.55   9165.443
##                   376       378        381       399       400         401
## Predicted   228903.74 1127848.3 250281.538 272475.18  638760.3 527133.2130
## cvpred      230689.91 1113367.5 251082.522 271544.97  634743.9 525548.4622
## price_sold  200000.00 1324000.0 250000.000 200000.00 1200000.0 524900.0000
## CV residual -30689.91  210632.5  -1082.522 -71544.97  565256.1   -648.4622
##                   407       409       415       418       434       440
## Predicted    658860.5  839328.5 263540.29 393018.70  867122.6 261514.07
## cvpred       658836.2  836899.4 272054.73 393942.62  864530.4 262223.49
## price_sold   475000.0  690000.0 235000.00 330000.00  565000.0 207000.00
## CV residual -183836.2 -146899.4 -37054.73 -63942.62 -299530.4 -55223.49
##                   447       448       453       457       462       463
## Predicted    174304.7 631486.42 440055.80  552644.2 555808.30 557533.19
## cvpred       177876.7 623556.48 442615.93  554154.4 560358.63 561797.93
## price_sold    63000.0 669000.00 499900.00  215000.0 520000.00 520000.00
## CV residual -114876.7  45443.52  57284.07 -339154.4 -40358.63 -41797.93
##                   490      505       509       517       533       539
## Predicted    268202.0 408281.5 358841.89  451135.4  726021.7  560573.2
## cvpred       266055.6 407624.0 363144.98  450947.4  723071.0  558622.1
## price_sold   129900.0 559000.0 320000.00  254000.0  410000.0  399000.0
## CV residual -136155.6 151376.0 -43144.98 -196947.4 -313071.0 -159622.1
##                   555       562       581       588       595      606      615
## Predicted   237327.03 698249.73  363378.8 344928.48 605922.92 352033.5 369179.1
## cvpred      231589.42 677464.69  367576.6 349898.17 606819.71 359461.9 374738.6
## price_sold  180000.00 600000.00  200000.0 282000.00 550000.00 325000.0 331000.0
## CV residual -51589.42 -77464.69 -167576.6 -67898.17 -56819.71 -34461.9 -43738.6
##                   622        632       643       650    656       663       673
## Predicted   140730.98 275805.684 218819.72 812229.33 226737  545283.8  714536.8
## cvpred      134661.89 274442.039 224486.17 798131.17 228229  530674.7  706819.7
## price_sold  146500.00 270000.000 315000.00 749900.00 380000  300000.0  319000.0
## CV residual  11838.11  -4442.039  90513.83 -48231.17 151771 -230674.7 -387819.7
##                  675       678       702      717       739        744
## Predicted   394242.8 306794.18 226016.26 178913.1 213723.48 250728.581
## cvpred      400407.6 316230.97 229930.24 183497.2 217422.41 252634.763
## price_sold  365000.0 360000.00 140000.00 116500.0 292000.00 250000.000
## CV residual -35407.6  43769.03 -89930.24 -66997.2  74577.59  -2634.763
##                   754       757      767       769     776        780       793
## Predicted   182513.17 207623.48 525687.7 256176.71  385682 225751.626 551950.71
## cvpred      186618.91 209247.93 519034.5 258465.89  389641 228148.102 550206.42
## price_sold  170000.00 227500.00 490000.0 174900.00  267000 223000.000 451000.00
## CV residual -16618.91  18252.07 -29034.5 -83565.89 -122641  -5148.102 -99206.42
##                  801       829       831       869       881       888
## Predicted   112571.3  382647.7 320755.24 189818.13 310589.41 585474.19
## cvpred      111116.6  383665.2 328866.68 193641.81 312390.57 590455.61
## price_sold   68000.0  276000.0 265000.00 215000.00 381000.00 605000.00
## CV residual -43116.6 -107665.2 -63866.68  21358.19  68609.43  14544.39
##                   895       896       901       905        927       933
## Predicted   219953.09 219953.09  475336.2  273007.6 203403.410 335761.05
## cvpred      222727.61 222727.61  476669.7  274328.9 206105.107 343707.82
## price_sold  189000.00 189000.00  375000.0  130000.0 197000.000 270000.00
## CV residual -33727.61 -33727.61 -101669.7 -144328.9  -9105.107 -73707.82
##                   950       951      956       975       986        999
## Predicted   109575.34 202942.18 113319.0  92713.26  393737.0 114685.167
## cvpred      107215.14 206306.39 111874.1  91626.29  396574.1 113023.121
## price_sold   85000.00 240300.00 180000.0 260000.00  260000.0 115700.000
## CV residual -22215.14  33993.61  68125.9 168373.71 -136574.1   2676.879
##                  1011      1015      1035     1060      1063      1093
## Predicted   169375.02  98926.07 436347.61 276123.2 218730.40  614101.8
## cvpred      175456.77  99951.02 432891.06 273563.3 219228.54  605314.7
## price_sold  129000.00 119000.00 460000.00 499000.0 253000.00 1150000.0
## CV residual -46456.77  19048.98  27108.94 225436.7  33771.46  544685.3
##                  1095      1107     1108     1110      1113      1116      1119
## Predicted    313593.6  178706.6 137478.3 250898.0  91555.02 504614.04  86460.99
## cvpred       309728.9  183359.1 135180.5 251558.4  95390.59 506853.39  84578.14
## price_sold   158200.0   83000.0 335000.0 178800.0 180000.00 485000.00 105111.00
## CV residual -151528.9 -100359.1 199819.5 -72758.4  84609.41 -21853.39  20532.86
##                 1121     1125     1143     1150      1174      1189      1202
## Predicted   243164.6 219564.5 595916.5 207585.8 326734.65 179451.51 113543.10
## cvpred      242195.8 221669.1 599476.9 210658.7 321950.17 184007.09 105973.25
## price_sold  495000.0 380000.0 843475.0 388400.0 366000.00 111500.00 131000.00
## CV residual 252804.2 158330.9 243998.1 177741.3  44049.83 -72507.09  25026.75
##                  1204     1207     1208      1241       1254        1266
## Predicted    486644.0 294475.0 175177.8 139759.32 290766.971 179608.6960
## cvpred       493495.1 299721.2 179397.2 136959.47 286108.295 182787.3103
## price_sold   197750.0 445000.0 165000.0 157000.00 290000.000 182500.0000
## CV residual -295745.1 145278.8 -14397.2  20040.53   3891.705   -287.3103
##                  1292      1302      1307      1321      1322      1324
## Predicted    243831.8 202539.54 325793.18  322790.4 249601.33 269929.51
## cvpred       240638.2 208397.31 319747.82  319385.2 245329.56 269276.15
## price_sold     2900.0 142500.00 229900.00  200000.0 212000.00 300749.00
## CV residual -237738.2 -65897.31 -89847.82 -119385.2 -33329.56  31472.85
##                 1326     1334     1335      1339      1348      1364
## Predicted   456052.8 308299.5 308299.5 322149.18  43265.50 213807.25
## cvpred      449789.3 302356.3 302356.3 323784.99  42141.68 217629.53
## price_sold  899900.0 425000.0 425000.0 335000.00 150000.00 155000.00
## CV residual 450110.7 122643.7 122643.7  11215.01 107858.32 -62629.53
## 
## Sum of squares = 4.385764e+12    Mean square = 32012874353    n = 137 
## 
## fold 4 
## Observations in test set: 137 
##                   31        48        51        52        58       61       75
## Predicted   236694.3  348756.7  469977.5 302769.34  249434.7 308280.0 385820.6
## cvpred      235467.0  349122.7  469478.0 303768.18  249075.6 309014.1 380949.7
## price_sold  363000.0  200000.0 1075000.0 264900.00  110000.0 439000.0 550000.0
## CV residual 127533.0 -149122.7  605522.0 -38868.18 -139075.6 129985.9 169050.3
##                   91        99      100       107       130     135      148
## Predicted   410524.1 454216.39 471759.0  233407.7  352445.9  434430 327010.7
## cvpred      405771.8 450188.47 473712.3  231958.8  355128.3  435676 327376.8
## price_sold  600000.0 505000.00 625000.0   54474.0   69668.0  212000 500000.0
## CV residual 194228.2  54811.53 151287.7 -177484.8 -285460.3 -223676 172623.2
##                  166       192      199       203       205       212       215
## Predicted   243296.2 973117.19 131605.0  75115.04 256489.68 581646.71  99026.21
## cvpred      242510.0 981854.64 133195.8  73420.92 255852.46 583669.39  99633.40
## price_sold  353000.0 932000.00 120000.0 179725.00 244900.00 528000.00  40000.00
## CV residual 110490.0 -49854.64 -13195.8 106304.08 -10952.46 -55669.39 -59633.40
##                   235       241       242       251       257      306
## Predicted   405629.08 1198467.9  362116.8 278254.42 205267.93 350817.6
## cvpred      406059.97 1213090.5  361269.0 279045.04 206167.04 349667.9
## price_sold  450500.00  935000.0   90201.0 319000.00 265000.00 305500.0
## CV residual  44440.03 -278090.5 -271068.0  39954.96  58832.96 -44167.9
##                   316       330       335      347       349      369       372
## Predicted   222556.07 319970.77 522702.43 777154.0  562514.8 180788.4  663696.3
## cvpred      221090.29 322082.76 526929.38 780043.5  568155.9 179529.4  668277.2
## price_sold  289900.00 340000.00 512900.00 858700.0  444500.0 280000.0  475000.0
## CV residual  68809.71  17917.24 -14029.38  78656.5 -123655.9 100470.6 -193277.2
##                  386       411      416       423      426       433       436
## Predicted   286934.1 495572.88 557346.2 199122.42 494682.7 256555.63  513294.8
## cvpred      287847.8 501324.56 558723.9 197181.07 497950.1 257631.22  513154.6
## price_sold  255000.0 449500.00 675000.0 210000.00 900000.0 163500.00  405000.0
## CV residual -32847.8 -51824.56 116276.1  12818.93 402049.9 -94131.22 -108154.6
##                 460       477      484        497       499       506       514
## Predicted   1077837 564336.86 185717.2 386818.436 574578.86 540233.66 362747.13
## cvpred      1090159 565825.88 184874.9 386843.816 579119.25 541601.27 361792.46
## price_sold   799900 633000.00 215000.0 380000.000 482725.00 608000.00 324900.00
## CV residual -290259  67174.12  30125.1  -6843.816 -96394.25  66398.73 -36892.46
##                   519       530       557       566       567       574
## Predicted   256964.13  478910.7 374655.11  374080.2 162736.25 226029.71
## cvpred      258364.31  481503.4 374165.63  373462.8 167288.68 226331.17
## price_sold  183000.00  335000.0 279900.00  235000.0 115000.00 260000.00
## CV residual -75364.31 -146503.4 -94265.63 -138462.8 -52288.68  33668.83
##                   585       592       593       597       599       604
## Predicted    90730.89 405550.00  421598.6  336353.0  458039.5  290172.8
## cvpred       89472.27 408120.33  422608.5  336082.9  459847.4  294050.6
## price_sold  119000.00 467000.00  289000.0  229000.0  300000.0  185000.0
## CV residual  29527.73  58879.67 -133608.5 -107082.9 -159847.4 -109050.6
##                   634      645       654      665       684       685       688
## Predicted    551251.0 220897.3 288288.38 240061.7 232412.97 238937.89 373516.82
## cvpred       551996.1 221406.0 289521.44 240956.3 231873.37 239806.25 372894.86
## price_sold   320000.0 329000.0 262500.00 378000.0 219900.00 259900.00 358000.00
## CV residual -231996.1 107594.0 -27021.44 137043.7 -11973.37  20093.75 -14894.86
##                   690      695       697      703       708       710       718
## Predicted   224512.13 479886.2  271701.3 113333.3 207827.25 302559.87  489384.0
## cvpred      224820.01 484454.0  272777.9 114237.9 206827.25 304300.71  492513.9
## price_sold  184900.00 440000.0   98775.0 232500.0 273000.00 220000.00  255000.0
## CV residual -39920.01 -44454.0 -174002.9 118262.1  66172.75 -84300.71 -237513.9
##                   745       752       759      765       766       773      774
## Predicted    747522.2  477450.7  258779.0 386934.3 278187.60 357778.22 288072.4
## cvpred       752889.2  480778.8  259263.6 389106.2 281950.01 360314.33 290620.2
## price_sold  1025000.0  329900.0  115000.0 740000.0 335000.00 430000.00 565100.0
## CV residual  272110.8 -150878.8 -144263.6 350893.8  53049.99  69685.67 274479.8
##                   787      791      797       808       809      814       818
## Predicted    68208.17 522022.5 233885.8  461254.6 204293.00 248829.2  493049.6
## cvpred       67680.76 525907.2 232556.5  467235.0 204075.18 250366.7  497916.8
## price_sold  155900.00 710000.0 404325.0  136429.0 241000.00 500000.0   73000.0
## CV residual  88219.24 184092.8 171768.5 -330806.0  36924.82 249633.3 -424916.8
##                  841       860       873       898      908       911       913
## Predicted   214793.1 363785.03 339053.67 282370.84 228794.1  547875.5 374921.53
## cvpred      214232.2 363244.49 337469.45 280223.27 229399.9  548724.8 374617.28
## price_sold  360000.0 445000.00 285000.00 207000.00 382000.0  382000.0 284900.00
## CV residual 145767.8  81755.51 -52469.45 -73223.27 152600.1 -166724.8 -89717.28
##                   924       971       993       998      1010      1031
## Predicted   199054.79 209456.41  380622.8 158622.75 108221.58 207654.91
## cvpred      198885.99 205360.33  382088.9 159985.37 108840.63 207533.59
## price_sold  180000.00 230000.00  260000.0 135800.00 175000.00 175000.00
## CV residual -18885.99  24639.67 -122088.9 -24185.37  66159.37 -32533.59
##                  1034      1047      1056     1059      1066      1067
## Predicted    461707.1 364728.30 329057.65 245619.4 287070.91 364452.35
## cvpred       470135.9 365453.43 331826.28 245458.5 283724.32 367279.21
## price_sold   185000.0 319000.00 350000.00 506000.0 210000.00 449900.00
## CV residual -285135.9 -46453.43  18173.72 260541.5 -73724.32  82620.79
##                  1080      1085      1087      1099      1133      1163
## Predicted    686933.1  403455.3  61026.95  389932.0  527761.6 224827.55
## cvpred       690651.2  404682.6  60371.10  389562.7  532749.4 224295.13
## price_sold  1070000.0   75000.0 168000.00  280000.0  390000.0 288500.00
## CV residual  379348.8 -329682.6 107628.90 -109562.7 -142749.4  64204.87
##                 1168      1176       1184      1186      1190      1192
## Predicted   122252.1 222876.79 183520.104  70098.76 231381.64 186268.93
## cvpred      122217.8 222586.58 182656.868  69532.39 234355.04 184389.23
## price_sold  285000.0 170000.00 190000.000 237500.00 145000.00 111500.00
## CV residual 162782.2 -52586.58   7343.132 167967.61 -89355.04 -72889.23
##                 1195      1196      1198      1206      1222      1225
## Predicted   293889.7 156111.22  372465.5  403122.4  286345.1 321740.64
## cvpred      295673.0 157038.47  377000.6  404586.8  289475.9 320474.03
## price_sold  415000.0 130000.00   74000.0  284700.0  165000.0 235000.00
## CV residual 119327.0 -27038.47 -303000.6 -119886.8 -124475.9 -85474.03
##                  1228      1237      1249      1260      1280       1293
## Predicted   270118.55 188165.06  407106.3 168525.16 236036.47 386454.266
## cvpred      274070.77 187439.53  408392.3 171543.12 236401.98 387480.637
## price_sold  280000.00 235000.00  282200.0 209900.00 168000.00 382500.000
## CV residual   5929.23  47560.47 -126192.3  38356.88 -68401.98  -4980.637
##                  1310      1314       1317      1319      1340      1365
## Predicted    311300.5 249471.69 248547.964  218900.5 337508.85  728174.5
## cvpred       315603.2 248593.23 247598.159  219929.1 336958.24  731120.3
## price_sold   160000.0 239900.00 240316.000   10000.0 335500.00  625000.0
## CV residual -155603.2  -8693.23  -7282.159 -209929.1  -1458.24 -106120.3
## 
## Sum of squares = 3.279989e+12    Mean square = 23941528551    n = 137 
## 
## fold 5 
## Observations in test set: 137 
##                    18       26        43         56        57       65       81
## Predicted    558124.5 349441.8 189345.94 203096.297 209553.14 283810.9 270457.8
## cvpred       558812.2 349224.0 188306.85 199920.422 208805.25 239828.9 256795.7
## price_sold  1050000.0 480000.0 134000.00 190000.000 150000.00 535000.0 419900.0
## CV residual  491187.8 130776.0 -54306.85  -9920.422 -58805.25 295171.1 163104.3
##                  137       139      140       141       156       158      168
## Predicted   669574.9  377596.0 407438.8  546376.5  708800.5 356302.89 423406.3
## cvpred      672579.0  375126.8 406295.5  551930.6  709822.7 354505.63 422331.0
## price_sold  915000.0   51314.0 615000.0  375000.0  580000.0 420000.00 565000.0
## CV residual 242421.0 -323812.8 208704.5 -176930.6 -129822.7  65494.37 142669.0
##                  181       183       191      210     213       219         230
## Predicted   188722.4  577033.3 366764.13 335127.4 1029884  836967.3 545981.6786
## cvpred      179263.5  589165.1 361744.85 329742.6 1042290  847953.3 549315.3698
## price_sold  255000.0  435000.0 349900.00 450000.0  700000 1300000.0 550000.0000
## CV residual  75736.5 -154165.1 -11844.85 120257.4 -342290  452046.7    684.6302
##                   245       250       254       259       263       267
## Predicted    944462.7 1125671.0 229217.65 234097.88 1170924.4  431319.6
## cvpred       954114.4 1142942.9 227772.56 231568.76 1184469.7  435823.4
## price_sold   759000.0  651900.0 195000.00 310000.00 1010000.0  285000.0
## CV residual -195114.4 -491042.9 -32772.56  78431.24 -174469.7 -150823.4
##                   269      272       276       294       297       300
## Predicted   222021.22 362242.7  49468.85 1329145.3 514739.33 192082.52
## cvpred      215377.28 365292.3  43321.92 1347964.7 510892.25 192061.53
## price_sold  244800.00 630000.0 155000.00 1000000.0 550000.00 260000.00
## CV residual  29422.72 264707.7 111678.08 -347964.7  39107.75  67938.47
##                   308       311        320       325       328      333
## Predicted   1349118.1 122352.31 317632.144 1183421.7 397996.29 452916.9
## cvpred      1355065.7 124139.08 311219.515 1200465.5 394442.07 450264.9
## price_sold  1150000.0 215000.00 310000.000 1320000.0 331500.00 873500.0
## CV residual -205065.7  90860.92  -1219.515  119534.5 -62942.07 423235.1
##                  334       336       338       341       361       363      367
## Predicted   510643.1  813270.0 319753.28 533999.67 704885.41  390776.8 777928.2
## cvpred      503942.4  811698.4 324789.23 531292.17 711147.88  396445.9 777965.9
## price_sold  712000.0 1128000.0 335000.00 512500.00 700000.00  280000.0 940000.0
## CV residual 208057.6  316301.6  10210.77 -18792.17 -11147.88 -116445.9 162034.1
##                   385       432       441       454       474       492     495
## Predicted   359425.17 475007.59 307298.83 1082210.0  94209.91 335685.52  652436
## cvpred      353923.35 470056.28 303159.62 1088762.8  93939.75 336041.19  651755
## price_sold  364000.00 414000.00 288900.00 1550000.0 290000.00 257000.00 1500100
## CV residual  10076.65 -56056.28 -14259.62  461237.2 196060.25 -79041.19  848345
##                   501      554       556      564      576       584       587
## Predicted    492971.2 664446.2 379680.28 417557.5 475061.1 301232.75 344928.48
## cvpred       500273.8 670326.4 375627.78 419139.2 471109.9 296353.49 342960.57
## price_sold   177000.0 799000.0 305000.00 629900.0 717000.0 252000.00 282000.00
## CV residual -323273.8 128673.6 -70627.78 210760.8 245890.1 -44353.49 -60960.57
##                  596       627        639      664       667      689       691
## Predicted   607647.8 205879.24 441580.499 401316.8 216848.73 301968.0 93929.783
## cvpred      610545.3 201351.88 441233.478 403281.1 212485.08 296177.2 88431.628
## price_sold  550000.0 287990.00 449000.000 649900.0 240000.00 255000.0 84500.000
## CV residual -60545.3  86638.12   7766.522 246618.9  27514.92 -41177.2 -3931.628
##                    699       709       716       726       729        730
## Predicted   235342.984  693529.4 249650.29 231726.31  369116.7 213931.661
## cvpred      233343.947  696449.3 247450.24 229489.88  368371.2 208883.466
## price_sold  225000.000  468000.0 223500.00 228000.00  255000.0 199000.000
## CV residual  -8343.947 -228449.3 -23950.24  -1489.88 -113371.2  -9883.466
##                   760      763       784       786       795       804
## Predicted    394684.4 335471.2  79216.84  192711.2  876822.2  80014.59
## cvpred       394954.5 330835.0  77213.26  187074.6  881689.2  74027.48
## price_sold   266000.0 260000.0 282525.00   55000.0  460000.0 162000.00
## CV residual -128954.5 -70835.0 205311.74 -132074.6 -421689.2  87972.52
##                   807       816       824       826       837       843
## Predicted   697777.60 308726.27 385175.09 372056.86 243496.61  96328.76
## cvpred      699454.44 305673.88 379605.66 373157.55 240032.73  93726.36
## price_sold  599950.00 215000.00 360000.00 276000.00 259000.00 205000.00
## CV residual -99504.44 -90673.88 -19605.66 -97157.55  18967.27 111273.64
##                   844       858      885       902       906      907       922
## Predicted   203058.83 383510.72 330255.6  513668.0 179083.94 421591.6 205872.21
## cvpred      199631.95 380956.47 331639.4  516382.8 172906.04 413799.7 203630.99
## price_sold  140000.00 430000.00 495000.0  400000.0 135000.00 545000.0 180000.00
## CV residual -59631.95  49043.53 163360.6 -116382.8 -37906.04 131200.3 -23630.99
##                   923       928       939       954       955       961
## Predicted   205872.21 295275.87 318063.44 274797.59 283339.90  221339.3
## cvpred      203630.99 292871.05 319844.97 272709.28 284197.81  220952.4
## price_sold  180000.00 265000.00 253000.00 295000.00 295000.00  120000.0
## CV residual -23630.99 -27871.05 -66844.97  22290.72  10802.19 -100952.4
##                   964      989      1018     1022     1033      1037      1041
## Predicted   173699.76 273361.0  353002.4 280074.1 193255.9 214847.70  289163.8
## cvpred      167403.42 266715.2  346104.0 281701.8 181654.9 210994.94  290002.8
## price_sold  199000.00 209500.0  237160.0 385000.0 335000.0 227000.00  173000.0
## CV residual  31596.58 -57215.2 -108944.0 103298.2 153345.1  16005.06 -117002.8
##                 1069      1082      1111      1126      1128      1131     1138
## Predicted   394139.5 237955.05  86252.86 170893.76  91224.98 214857.52 207589.2
## cvpred      386086.1 234078.03  81047.86 175127.44  91464.01 216434.36 203321.8
## price_sold  570000.0 141000.00 260000.00 120000.00 165000.00 180000.00 370000.0
## CV residual 183913.9 -93078.03 178952.14 -55127.44  73535.99 -36434.36 166678.2
##                  1142      1148      1164      1165      1171      1173
## Predicted   277419.61 368285.60 218942.70 241276.30 252093.27 159813.26
## cvpred      274698.98 368487.18 213642.48 239875.99 256224.15 159964.51
## price_sold  195000.00 400000.00 187500.00 339000.00 163500.00 110650.00
## CV residual -79698.98  31512.82 -26142.48  99124.01 -92724.15 -49314.51
##                  1180      1205      1214      1236      1240     1243
## Predicted    92748.13  88141.42 360638.39 212325.35  443533.3 306281.1
## cvpred       91480.20  85774.32 355189.05 207602.05  442569.4 302317.2
## price_sold  277000.00 180000.00 435000.00 238000.00  322000.0 416000.0
## CV residual 185519.80  94225.68  79810.95  30397.95 -120569.4 113682.8
##                  1247      1268      1284      1296     1300      1304
## Predicted   122553.36  312094.3 301495.45 250746.98 210833.5 102424.69
## cvpred      125623.49  308295.9 306986.08 255162.44 213027.4 103312.94
## price_sold   27886.00  170000.0 235000.00 195000.00 367700.0 120000.00
## CV residual -97737.49 -138295.9 -71986.08 -60162.44 154672.6  16687.06
##                  1316       1318      1347       1354      1360      1362
## Predicted   240375.14 129730.198 231216.89 203046.336  377233.0 158515.51
## cvpred      238447.21 141494.236 230666.11 199904.337  385737.1 153917.13
## price_sold  227000.00 140000.000 275000.00 190000.000   70000.0  92500.00
## CV residual -11447.21  -1494.236  44333.89  -9904.337 -315737.1 -61417.13
##                  1366
## Predicted   197729.70
## cvpred      189765.27
## price_sold  215000.00
## CV residual  25234.73
## 
## Sum of squares = 4.204096e+12    Mean square = 30686831164    n = 137 
## 
## fold 6 
## Observations in test set: 137 
##                    17        20       25        33       36        41       53
## Predicted    468122.9  329557.3 179949.3  84694.03 217186.3 208782.35 360855.2
## cvpred       467996.3  326263.1 180647.6  86182.76 218669.0 207453.75 360772.6
## price_sold  1050000.0  219000.0 309000.0 230000.00 595000.0 165000.00 440000.0
## CV residual  582003.7 -107263.1 128352.4 143817.24 376331.0 -42453.75  79227.4
##                    59        69          78        83        86       96
## Predicted   601724.67 328103.76 308802.2998  530889.2 325592.48 120899.5
## cvpred      599794.31 336193.79 307219.7393  526550.7 336426.25 121056.7
## price_sold  535000.00 355000.00 307000.0000  259900.0 365000.00 315000.0
## CV residual -64794.31  18806.21   -219.7393 -266650.7  28573.75 193943.3
##                   105       114       125       160       162       163
## Predicted    803189.4 232794.20  359871.4 193494.72  758091.0  69476.71
## cvpred       800596.3 232037.14  357572.5 196029.58  757330.1  66024.19
## price_sold   667000.0 147000.00  249900.0 230000.00  385000.0 205000.00
## CV residual -133596.3 -85037.14 -107672.5  33970.42 -372330.1 138975.81
##                  165      189       193       200       208        222
## Predicted   297213.3 479584.5 472864.39  800553.5  428814.3 102043.495
## cvpred      291384.3 479754.1 470620.11  800630.8  430201.6 103104.418
## price_sold  485000.0 611000.0 398000.00  470000.0  276000.0 108000.000
## CV residual 193615.7 131245.9 -72620.11 -330630.8 -154201.6   4895.582
##                    225      229      240       247       248       249
## Predicted   1213381.30 394024.4 177324.9  783027.8 201575.11  448475.1
## cvpred      1205527.46 397032.1 175399.4  779961.6 200930.32  447590.6
## price_sold  1300000.00 525000.0 178500.0  585000.0 230000.00  275000.0
## CV residual   94472.54 127967.9   3100.6 -194961.6  29069.68 -172590.6
##                   252       310       321      340       345       346
## Predicted   208993.39 345959.93 658465.94 510643.1  391508.9 716834.54
## cvpred      207682.45 343317.06 657349.57 502201.7  396001.9 712315.64
## price_sold  165000.00 307200.00 585000.00 712000.0  236000.0 800000.00
## CV residual -42682.45 -36117.06 -72349.57 209798.3 -160001.9  87684.36
##                   352       356      359        370       375       377
## Predicted   238989.94 558752.64 131018.1 241629.749 262096.34 247109.39
## cvpred      238666.84 553633.56 131161.8 238637.674 260395.21 246955.66
## price_sold  266000.00 581000.00 266900.0 244554.000 208000.00 268000.00
## CV residual  27333.16  27366.44 135738.2   5916.326 -52395.21  21044.34
##                   392       404      420      421       430       437       446
## Predicted   1716529.3  617307.4 465985.7 365889.6 875024.86 306346.83  754169.3
## cvpred      1714737.5  618043.1 463907.6 363670.6 876291.96 305132.37  755048.7
## price_sold  2700000.0  500000.0 624900.0 549980.0 800000.00 400000.00  530000.0
## CV residual  985262.5 -118043.1 160992.4 186309.4 -76291.96  94867.63 -225048.7
##                   452       467       496        500       511      521
## Predicted   292056.09  695192.4  652436.0 421075.215 243819.58 349433.5
## cvpred      291040.45  692510.5  647066.3 419497.658 245960.59 346850.1
## price_sold  311500.00  525000.0 1500100.0 410000.000 200000.00 485000.0
## CV residual  20459.55 -167510.5  853033.7  -9497.658 -45960.59 138149.9
##                   526       528      545      546      569       573       580
## Predicted    232919.0 207646.48 435675.2 292195.5 195805.7 314619.40 584876.60
## cvpred       230626.3 204839.59 430354.0 290730.6 190750.9 311241.84 584917.27
## price_sold   128000.0 255000.00 482500.0 454500.0 219900.0 276000.00 545000.00
## CV residual -102626.3  50160.41  52146.0 163769.4  29149.1 -35241.84 -39917.27
##                  586       611       624        644       647       649
## Predicted   263562.2 379656.67 403584.32 403335.157 254227.24 295987.16
## cvpred      263406.2 377649.96 399300.59 399550.459 250080.84 291819.68
## price_sold  425000.0 300000.00 320305.00 405000.000 215000.00 270000.00
## CV residual 161593.8 -77649.96 -78995.59   5449.541 -35080.84 -21819.68
##                   655        666       671       672       677       683
## Predicted   326958.38 232604.478  81178.79  438671.6 221434.19  460932.5
## cvpred      323851.25 227930.558  80255.62  441794.0 221227.75  460670.5
## price_sold  280000.00 235000.000 120000.00  269900.0 194900.00  280000.0
## CV residual -43851.25   7069.442  39744.38 -171894.0 -26327.75 -180670.5
##                   686       722       723       747       753     755       758
## Predicted   512770.69  232823.6  354256.8 200280.80  363852.3 1267345 311484.99
## cvpred      513574.75  230511.6  351722.4 197749.51  361547.7 1278036 310837.86
## price_sold  415000.00   80000.0  163600.0 159900.00  260000.0  980000 385000.00
## CV residual -98574.75 -150511.6 -188122.4 -37849.51 -101547.7 -298036  74162.14
##                   764      785       788       794       817      834       848
## Predicted   130881.21 259460.0 196748.77  337528.9 363484.51 325525.8  595302.7
## cvpred      137618.44 259211.2 192836.63  332833.0 358807.05 330909.2  590690.4
## price_sold  205000.00 550000.0 219900.00  190000.0 337000.00 589000.0 1200000.0
## CV residual  67381.56 290788.8  27063.37 -142833.0 -21807.05 258090.8  609309.6
##                  851     857       871        874      876       878       890
## Predicted   277977.9 1040082 336696.30 173022.205 286438.0 361099.10 232272.54
## cvpred      276234.8 1059138 333776.57 171318.852 282974.1 356922.83 231805.71
## price_sold  660000.0  530000 275000.00 175000.000 565000.0 445000.00 270000.00
## CV residual 383765.2 -529138 -58776.57   3681.148 282025.9  88077.17  38194.29
##                   892       893       925       930       935      944
## Predicted    86415.11  86415.11 106038.22 323340.77 122150.61 255627.5
## cvpred       85599.53  85599.53 107981.42 320139.81 120248.69 253839.9
## price_sold  143000.00 143000.00 160500.00 260000.00 179900.00 512500.0
## CV residual  57400.47  57400.47  52518.58 -60139.81  59651.31 258660.1
##                   952       959       978       980       994      1023
## Predicted   402549.78 164416.54  219129.0 174009.34 115735.63 255886.30
## cvpred      398719.78 162958.03  214191.9 172756.12 117056.15 252190.24
## price_sold  380000.00  93000.00   90000.0  90500.00 135000.00 182850.00
## CV residual -18719.78 -69958.03 -124191.9 -82256.12  17943.85 -69340.24
##                  1025      1029      1032      1038      1044       1049
## Predicted   236734.34 219660.59 219926.67 255460.51 371545.73 263497.578
## cvpred      236425.29 219413.72 217365.34 253622.91 366674.51 261433.005
## price_sold  144900.00 205000.00 193000.00 346000.00 319900.00 253000.000
## CV residual -91525.29 -14413.72 -24365.34  92377.09 -46774.51  -8433.005
##                  1050      1065      1075     1081      1089     1105      1122
## Predicted   235068.25 377606.86 250968.81 103332.0  300773.0 267496.7 479228.46
## cvpred      236624.39 377680.44 246822.11 101036.7  297202.3 267440.8 476796.02
## price_sold  329000.00 317000.00 187000.00 253000.0   39000.0 478000.0 465000.00
## CV residual  92375.61 -60680.44 -59822.11 151963.3 -258202.3 210559.2 -11796.02
##                  1136       1166     1178     1199      1215      1217
## Predicted   138164.58 193508.376 549653.0 194534.6 439834.49 280670.03
## cvpred      138479.89 196544.935 544414.7 191883.7 434200.68 273986.95
## price_sold   50000.00 191000.000 655500.0 347500.0 351000.00 339000.00
## CV residual -88479.89  -5544.935 111085.3 155616.3 -83200.68  65013.05
##                  1265      1276      1277      1279      1297      1303
## Predicted    60464.76 236036.48  68496.71 241022.71  432641.7 278206.98
## cvpred       61362.43 233051.09  68866.20 237076.96  431761.1 276855.75
## price_sold  142000.00 168000.00  45000.00 242394.00  221000.0 225000.00
## CV residual  80637.57 -65051.09 -23866.20   5317.04 -210761.1 -51855.75
##                  1341      1349     1351      1356
## Predicted    259592.1 222877.29 219337.5  179077.5
## cvpred       261765.9 224277.78 220463.8  177187.7
## price_sold    60000.0 135000.00 353000.0   50000.0
## CV residual -201765.9 -89277.78 132536.2 -127187.7
## 
## Sum of squares = 5.008166e+12    Mean square = 36555957922    n = 137 
## 
## fold 7 
## Observations in test set: 137 
##                    24        29        44        54        73        77     79
## Predicted   322622.04 89801.146 303198.96  449624.9  458106.8 343950.03 572605
## cvpred      318571.32 96332.173 300062.11  446167.7  452279.8 347594.57 566286
## price_sold  290000.00 90000.000 230000.00  170000.0  310000.0 425000.00 700000
## CV residual -28571.32 -6332.173 -70062.11 -276167.7 -142279.8  77405.43 133714
##                    90       103       134       152       169       174
## Predicted   669860.85  343726.8  415052.9 1390141.5 412529.41  692994.9
## cvpred      663230.65  346361.9  414423.5 1378292.9 411263.01  684446.0
## price_sold  705500.00  221500.0  294900.0 1600000.0 445000.00 1100000.0
## CV residual  42269.35 -124861.9 -119523.5  221707.1  33736.99  415554.0
##                   180      190       211       233       234       253
## Predicted   571031.78 506718.8 265075.54 389865.24 702811.10 934768.72
## cvpred      564920.87 500903.2 266980.13 389046.83 699790.72 917664.84
## price_sold  600000.00 780000.0 350000.00 465000.00 647800.00 950000.00
## CV residual  35079.13 279096.8  83019.87  75953.17 -51990.72  32335.16
##                   258       262       264       265      277       278
## Predicted   506528.67 245582.57 1120298.7 487517.14 202992.2  758534.9
## cvpred      498791.46 245210.39 1114091.1 487393.74 204461.0  751076.6
## price_sold  421500.00 275000.00  837500.0 407975.00 250000.0 1400000.0
## CV residual -77291.46  29789.61 -276591.1 -79418.74  45539.0  648923.4
##                   286       309      312       351       382       391
## Predicted   296790.47 1116294.9 535415.0  321304.6 539847.40 410682.41
## cvpred      300367.67 1089533.1 529136.8  322848.1 535065.42 408318.23
## price_sold  335000.00 1842700.0 630000.0  192500.0 480000.00 325000.00
## CV residual  34632.33  753166.9 100863.2 -130348.1 -55065.42 -83318.23
##                   396       403       414      425       461       469
## Predicted    501631.8  804733.8 626633.54 494682.7 262998.13 389712.72
## cvpred       509504.7  791439.6 616621.35 494894.6 265117.72 387685.19
## price_sold   300000.0 1306000.0 550000.00 900000.0 199000.00 375000.00
## CV residual -209504.7  514560.4 -66621.35 405105.4 -66117.72 -12685.19
##                   472      475        481       493       516      518
## Predicted   608398.27 529943.2 276412.742 369125.60 118526.01 389880.2
## cvpred      602864.64 523092.7 277668.913 368997.41 124168.37 389530.4
## price_sold  530230.00 769100.0 280000.000 279000.00 110111.00 545000.0
## CV residual -72634.64 246007.3   2331.087 -89997.41 -14057.37 155469.6
##                   522       529       535        540      541       544
## Predicted    532900.9 299046.72 146736.32 386991.888 292195.5 357721.28
## cvpred       523529.5 299347.37 150697.41 382988.793 293841.3 355619.14
## price_sold   398000.0 218000.00 159000.00 390000.000 454500.0 340000.00
## CV residual -125529.5 -81347.37   8302.59   7011.207 160658.7 -15619.14
##                   549        550       553       561       570       583
## Predicted    281117.1 214967.424 398574.46  589916.6 338014.94  73566.55
## cvpred       281235.3 216408.726 392697.87  581735.8 334918.05  78187.60
## price_sold   173000.0 225000.000 465000.00 1050000.0 405000.00 111000.00
## CV residual -108235.3   8591.274  72302.13  468264.2  70081.95  32812.40
##                   591       613       628      629        631       636
## Predicted   249329.04 242166.11 380224.22 483125.1 275805.684 420027.01
## cvpred      251645.38 246953.15 381348.89 484882.7 276986.022 416304.72
## price_sold  226000.00 340000.00 349900.00 640000.0 270000.000 383000.00
## CV residual -25645.38  93046.85 -31448.89 155117.3  -6986.022 -33304.72
##                   653       660       662      669      679      701       706
## Predicted   334953.13 247024.86 434757.52 434978.1 88107.12 345812.5  269607.0
## cvpred      333296.96 248527.04 435619.54 436305.6 91452.31 341931.8  271076.7
## price_sold  302000.00 220000.00 355000.00 558650.0 95000.00 395000.0  120000.0
## CV residual -31296.96 -28527.04 -80619.54 122344.4  3547.69  53068.2 -151076.7
##                   707       734       736       738       742       750
## Predicted   254969.68 346288.14  410725.2 305187.97  94838.91 202306.52
## cvpred      258512.13 344980.45  405127.8 301273.05  99254.45 201430.74
## price_sold  235000.00 275000.00  238775.0 235000.00 171000.00 230000.00
## CV residual -23512.13 -69980.45 -166352.8 -66273.05  71745.55  28569.26
##                  756       762       768      770        781       782
## Predicted   192263.7  297562.5  296248.6 255957.7 225751.626 109352.35
## cvpred      191263.7  299186.6  291982.7 255511.3 228023.094 115780.16
## price_sold  230700.0  157000.0  172950.0 510000.0 223000.000 210000.00
## CV residual  39436.3 -142186.6 -119032.7 254488.7  -5023.094  94219.84
##                   803      821       849       856      863       866       870
## Predicted   285074.09 517122.0 225264.50 103300.26 295557.2 573076.36 342528.17
## cvpred      283989.94 512721.9 228993.31 109930.76 295954.4 562512.82 342294.08
## price_sold  300000.00 617000.0 195000.00 193500.00 330000.0 625000.00 280000.00
## CV residual  16010.06 104278.1 -33993.31  83569.24  34045.6  62487.18 -62294.08
##                   883       904       915       921       949       976
## Predicted   352648.94 250686.81 171767.96  88346.14 239205.81 382742.61
## cvpred      347169.09 253749.02 174139.68  93666.98 238530.67 382831.72
## price_sold  257500.00 169000.00 214300.00 108000.00 227000.00 357000.00
## CV residual -89669.09 -84749.02  40160.32  14333.02 -11530.67 -25831.72
##                   982       984     985       988        991      1004
## Predicted   412105.60 182368.83  393737 237232.31 102424.541 151805.33
## cvpred      406845.96 183573.98  391602 234469.46 108536.539 156996.73
## price_sold  315000.00 145000.00  260000 276670.00 105000.000 135000.00
## CV residual -91845.96 -38573.98 -131602  42200.54  -3536.539 -21996.73
##                  1007     1013         1019      1024      1026      1042
## Predicted   249356.68 158531.9 390310.63491 271246.03 179076.79  438837.8
## cvpred      248436.08 158719.6 384918.08069 271380.66 180153.65  434661.5
## price_sold  222000.00 320150.0 385000.00000 182850.00  81000.00  333500.0
## CV residual -26436.08 161430.4     81.91931 -88530.66 -99153.65 -101161.5
##                 1054      1057      1061      1077     1079      1091
## Predicted   442082.0  77946.69  311128.7 201195.14 299395.8 189595.49
## cvpred      437180.2  82880.74  310901.4 199508.32 297267.3 193933.81
## price_sold  700000.0 180000.00  130500.0 175000.00 230000.0 272000.00
## CV residual 262819.8  97119.26 -180401.4 -24508.32 -67267.3  78066.19
##                   1100      1104      1151     1152     1167     1177      1182
## Predicted   447989.036 110871.59  354978.3 241541.9 267191.9 284356.2 179617.01
## cvpred      443174.517 116238.22  353105.0 241680.0 268455.8 278239.2 178151.08
## price_sold  445500.000 180000.00  246000.0 375000.0 385000.0 520000.0 245000.00
## CV residual   2325.483  63761.78 -107105.0 133320.0 116544.2 241760.8  66848.92
##                  1200      1209      1210      1224     1229      1232
## Predicted   381896.50  386559.0 305857.66  338052.6 279632.8  339297.0
## cvpred      381185.77  382407.2 296932.65  337039.6 277650.0  332216.2
## price_sold  480000.00  152000.0 350000.00  151750.0 450000.0  145000.0
## CV residual  98814.23 -230407.2  53067.35 -185289.6 172350.0 -187216.2
##                  1239      1244      1269      1275      1285      1286
## Predicted   389823.39  397082.5 240697.83 218711.72  347708.7  308902.6
## cvpred      386488.18  395384.3 242345.86 216458.58  345709.5  305837.9
## price_sold  435000.00  295000.0 158000.00 182000.00  235000.0  160000.0
## CV residual  48511.82 -100384.3 -84345.86 -34458.58 -110709.5 -145837.9
##                  1287      1301      1323       1331      1337      1346
## Predicted   285471.72 532179.78 285289.24  88533.594  488584.4  240370.2
## cvpred      285236.94 531038.31 286938.27  93200.953  480314.2  242619.8
## price_sold  280000.00 549000.00 300749.00 100000.000  285000.0  100000.0
## CV residual  -5236.94  17961.69  13810.73   6799.047 -195314.2 -142619.8
##                  1352
## Predicted   440970.21
## cvpred      435542.23
## price_sold  467000.00
## CV residual  31457.77
## 
## Sum of squares = 3.344533e+12    Mean square = 24412648405    n = 137 
## 
## fold 8 
## Observations in test set: 136 
##                     1        10        13        35        63       64
## Predicted    332027.4 215971.55  598442.4  446599.6  700200.9 494017.3
## cvpred       333227.0 222590.17  588309.1  441979.6  711545.1 519906.2
## price_sold   214300.0 187000.00 1050000.0 1175000.0  470000.0 870000.0
## CV residual -118927.0 -35590.17  461690.9  733020.4 -241545.1 350093.8
##                    68      76        85        94       95       104       111
## Predicted   1099912.2 1164989 268434.60 2034560.8 629597.3 249230.88  289506.3
## cvpred      1108159.2 1163630 278947.68 1990745.9 630683.7 252106.33  294204.4
## price_sold   695000.0  900000 365000.00 2900000.0 875000.0 225000.00  122000.0
## CV residual -413159.2 -263630  86052.32  909254.1 244316.3 -27106.33 -172204.4
##                  117       121        133       138       144       157
## Predicted   733469.4  651354.8 288164.664  794993.5  717902.6  549353.0
## cvpred      731735.3  643300.3 284164.425  797736.7  716940.2  543325.1
## price_sold  849000.0  437000.0 290000.000  680000.0  555000.0  425000.0
## CV residual 117264.7 -206300.3   5835.575 -117736.7 -161940.2 -118325.1
##                   161      164      176       198      206       217       220
## Predicted    614410.0 297213.3 201764.0 252442.45 332923.3 413389.57 201739.73
## cvpred       614488.6 306825.3 206653.4 253906.71 361075.1 418252.28 204349.27
## price_sold   430000.0 485000.0 320000.0 242000.00 562200.0 465000.00 122000.00
## CV residual -184488.6 178174.7 113346.6 -11906.71 201124.9  46747.72 -82349.27
##                   227       243       244       273       280       295
## Predicted   419969.08 1112286.7 201711.11  777358.3 968898.96 406372.50
## cvpred      424488.88 1097006.3 204308.33  776264.4 950083.65 411734.42
## price_sold  515000.00 1937500.0 122000.00  620000.0 975000.00 385000.00
## CV residual  90511.12  840493.7 -82308.33 -156264.4  24916.35 -26734.42
##                   315       319       339       342       379       388
## Predicted   375053.14  826036.7  463366.3  600001.7 426209.57  670067.7
## cvpred      373209.55  821224.7  461466.7  600134.0 430752.74  668490.8
## price_sold  387500.00  483100.0  314500.0  380000.0 449900.00 1075000.0
## CV residual  14290.45 -338124.7 -146966.7 -220134.0  19147.26  406509.2
##                    412       428       431      435       439       449
## Predicted   178204.818  825604.7  93745.89 269060.6 261514.07  449667.1
## cvpred      177938.936  827953.5  87987.62 269843.4 262792.94  446779.7
## price_sold  183000.000  700000.0  55000.00 292900.0 207000.00  170000.0
## CV residual   5061.064 -127953.5 -32987.62  23056.6 -55792.94 -276779.7
##                   470       473        482       487       489       494
## Predicted   394952.33  526391.3 276412.742  612605.2  616338.0  674108.4
## cvpred      400661.86  532194.7 276858.359  612552.3  617951.1  673024.8
## price_sold  312500.00  375000.0 280000.000  396000.0  350000.0  460000.0
## CV residual -88161.86 -157194.7   3141.641 -216552.3 -267951.1 -213024.8
##                   504       515       525       531       548      571
## Predicted   462336.96 120250.90 103175.41  539938.5 194489.98 668776.5
## cvpred      466840.29 120662.97 106853.38  542399.0 207200.73 674543.8
## price_sold  455000.00 110111.00 180000.00  405000.0 225000.00 900000.0
## CV residual -11840.29 -10551.97  73146.62 -137399.0  17799.27 225456.2
##                   578       579       590       594       598       600
## Predicted   538302.07  458710.5 359841.05  91362.54 246351.37  410733.2
## cvpred      536564.58  462929.1 351690.67  99540.29 250302.45  409707.3
## price_sold  487000.00  290000.0 270000.00 154000.00 229000.00  308500.0
## CV residual -49564.58 -172929.1 -81690.67  54459.71 -21302.45 -101207.3
##                   605       608       609       610       612       617
## Predicted   206189.00 228734.38  540381.4  485671.9 140968.58 151014.91
## cvpred      212309.01 239624.03  541268.5  486901.2 136455.96 145243.09
## price_sold  237500.00 229600.00  260000.0  360000.0 175000.00 188000.00
## CV residual  25190.99 -10024.03 -281268.5 -126901.2  38544.04  42756.91
##                   651       711       724       733       741       761
## Predicted   812229.33 246477.77 278914.97  410637.0 281655.40  488457.3
## cvpred      802901.85 240983.96 280591.92  417090.3 289265.37  492197.8
## price_sold  749900.00 218000.00 196250.00  190000.0 275000.00  282500.0
## CV residual -53001.85 -22983.96 -84341.92 -227090.3 -14265.37 -209697.8
##                   772      783       792        812       827       836
## Predicted    311608.3 185668.0 185788.74 194417.889  61009.45 268637.87
## cvpred       317744.9 192576.3 183041.37 200730.013  66861.69 270830.14
## price_sold   172950.0 127000.0 249900.00 197500.000 165000.00 187500.00
## CV residual -144794.9 -65576.3  66858.63  -3230.013  98138.31 -83330.14
##                  842       852       859       868       886       899
## Predicted   207975.6 231575.34  375947.6 244428.97  416617.7  77540.35
## cvpred      212928.6 230133.01  373941.1 248253.96  424543.8  78116.10
## price_sold  360000.0 195000.00  120000.0 196000.00  125000.0  61000.00
## CV residual 147071.4 -35133.01 -253941.1 -52253.96 -299543.8 -17116.10
##                   919       929       936       938       943       945
## Predicted   124470.11  93592.24  378484.0  277692.2  93378.47  254159.9
## cvpred      126852.58 101607.63  390883.2  283118.7  95712.88  253224.3
## price_sold  185000.00 191600.00  230000.0  110000.0 140000.00   79900.0
## CV residual  58147.42  89992.37 -160883.2 -173118.7  44287.12 -173324.3
##                   973      974      981      983       995      1036
## Predicted   224558.87 163235.1 347429.8 509191.6 372370.21  262325.1
## cvpred      217541.74 159420.1 353125.7 512790.6 374813.37  258533.7
## price_sold  250000.00 322400.0 575000.0 487600.0 410000.00  147500.0
## CV residual  32458.26 162979.9 221874.3 -25190.6  35186.63 -111033.7
##                    1043     1055      1058     1072     1083      1086
## Predicted   263868.0122 422896.1 221594.65 174810.9 237896.0 191075.44
## cvpred      276442.1867 422607.4 228284.72 172613.8 241789.1 193706.15
## price_sold  276000.0000 700000.0 155000.00 357000.0 415000.0 149000.00
## CV residual   -442.1867 277392.6 -73284.72 184386.2 173210.9 -44706.15
##                  1101      1103      1109      1120      1123      1132
## Predicted    283679.6 299029.81 337519.60  84857.59 203509.52 231427.06
## cvpred       292974.9 296493.54 341696.99  83395.86 211082.95 226196.37
## price_sold   105000.0 260000.00 257000.00 200000.00 255000.00 150000.00
## CV residual -187974.9 -36493.54 -84696.99 116604.14  43917.05 -76196.37
##                 1135      1137     1146      1153      1158      1161      1175
## Predicted   405155.9  283661.6 167691.5 361056.24 109993.22 169651.98  366615.8
## cvpred      406750.1  290761.7 169454.6 371880.45 111006.92 169933.43  369289.9
## price_sold  592000.0  187000.0 315000.0 325000.00  96000.00 227000.00  235000.0
## CV residual 185249.9 -103761.7 145545.4 -46880.45 -15006.92  57066.57 -134289.9
##                  1226      1233      1238      1252      1253      1258
## Predicted   267629.30  323937.3 383005.97  265605.6  226287.5 517726.49
## cvpred      269789.24  332671.3 383594.49  265999.8  230328.6 520802.01
## price_sold  181900.00  145000.0 435000.00   50000.0   85000.0 590000.00
## CV residual -87889.24 -187671.3  51405.51 -215999.8 -145328.6  69197.99
##                  1259      1270      1283       1290     1294      1306
## Predicted   209004.92  436620.4 217374.66 229342.169 202693.6  960796.9
## cvpred      212584.86  439294.7 223913.26 227328.661 205121.8  962485.2
## price_sold  140000.00   42500.0 195000.00 220000.000 150000.0  665000.0
## CV residual -72584.86 -396794.7 -28913.26  -7328.661 -55121.8 -297485.2
##                  1312      1320      1327      1328      1332      1350
## Predicted   250564.91 206371.25 201438.23 201438.23 108261.26 322573.04
## cvpred      255520.18 209653.31 203917.96 203917.96 105545.23 324033.62
## price_sold  214000.00 307000.00 122000.00 122000.00 125000.00 290000.00
## CV residual -41520.18  97346.69 -81917.96 -81917.96  19454.77 -34033.62
##                  1361
## Predicted   240224.62
## cvpred      242279.29
## price_sold  214000.00
## CV residual -28279.29
## 
## Sum of squares = 5.195817e+12    Mean square = 38204536610    n = 136 
## 
## fold 9 
## Observations in test set: 136 
##                  16       37        39       50       71        92       93
## Predicted    188658 255849.0 208160.73 529909.6 350846.4 635976.39 174576.3
## cvpred       191699 254455.3 209326.87 521789.0 349475.9 635060.01 179860.6
## price_sold    90000 551900.0 185000.00 769100.0 500000.0 675000.00 445000.0
## CV residual -101699 297444.7 -24326.87 247311.0 150524.1  39939.99 265139.4
##                  98       109       110      118       126      128       131
## Predicted   1411783  433589.8 505428.98 401663.7  546387.5 301305.7  468924.8
## cvpred      1390578  428082.6 498457.24 391138.1  535410.1 300470.6  462664.5
## price_sold  2400000   67019.0 525000.00 629000.0   84123.0 490000.0   24000.0
## CV residual 1009422 -361063.6  26542.76 237861.9 -451287.1 189529.4 -438664.5
##                   153       159       184       223       228      231
## Predicted   952148.70  614083.1 211301.72 393987.18 342833.17 495176.0
## cvpred      940555.94  608404.5 211346.48 390082.42 348468.38 490919.9
## price_sold  975000.00  415500.0 285000.00 358000.00 250000.00 837679.0
## CV residual  34444.06 -192904.5  73653.52 -32082.42 -98468.38 346759.1
##                   282       283       287       289       293       326
## Predicted    897635.0 1426988.7  806249.1  298276.6  764312.7  497711.5
## cvpred       887905.1 1407367.5  798263.9  297611.1  759074.3  493117.4
## price_sold   565000.0 2350000.0  600000.0  178000.0 1125000.0  380000.0
## CV residual -322905.1  942632.5 -198263.9 -119611.1  365925.7 -113117.4
##                    353       355       358      362       365       373
## Predicted   235227.329  472882.3 453685.77 409053.7 236296.96 227774.72
## cvpred      234142.747  471731.7 448414.98 404274.6 238812.86 228407.66
## price_sold  238000.000  322000.0 485000.00 545000.0 320000.00 255500.00
## CV residual   3857.253 -149731.7  36585.02 140725.4  81187.14  27092.34
##                   383       384      393       405       410       424
## Predicted    421959.3 367118.83 210592.1 530181.02  568897.2  644178.5
## cvpred       416264.1 362356.53 211587.0 522690.92  564541.5  636074.6
## price_sold   255000.0 300000.00 135000.0 460000.00  208980.0  499000.0
## CV residual -161264.1 -62356.53 -76587.0 -62690.92 -355561.5 -137074.6
##                   427       443       444       455       458       478
## Predicted    534773.5 292451.59 363809.88 362720.72  326117.7 188998.38
## cvpred       533591.2 292454.47 362906.77 359652.51  325611.6 184915.28
## price_sold   357500.0 215000.00 297000.00 325000.00  135000.0 174528.00
## CV residual -176091.2 -77454.47 -65906.77 -34652.51 -190611.6 -10387.28
##                   479      486      488       491       502       508       524
## Predicted    605489.1 495723.6 495723.6 498901.59 149415.62 416092.62  423120.4
## cvpred       599495.2 492019.3 492019.3 492267.36 153897.24 408401.36  421375.3
## price_sold   394500.0 685000.0 685000.0 431000.00 175000.00 440000.00  211973.0
## CV residual -204995.2 192980.7 192980.7 -61267.36  21102.76  31598.64 -209402.3
##                   534       537        551       559       563       572
## Predicted   426753.68 441272.79 221784.845 1116622.1  452528.4  561982.3
## cvpred      420348.96 438185.52 222111.284 1109462.4  448904.4  554610.6
## price_sold  440000.00 420000.00 225000.000  545000.0  249900.0 1285000.0
## CV residual  19651.04 -18185.52   2888.716 -564462.4 -199004.4  730389.4
##                   601      602       616       625       633       646
## Predicted   266124.12 213909.2 116655.90 183666.58  560449.2 120272.45
## cvpred      266393.34 210953.2 122954.37 181761.59  551856.8 122320.55
## price_sold  195000.00 200000.0 109500.00 245900.00  379000.0 208000.00
## CV residual -71393.34 -10953.2 -13454.37  64138.41 -172856.8  85679.45
##                   658       681      704       712       732      737       740
## Predicted    804483.6  67928.00 473463.0  577124.7 271623.75 283458.6  386807.8
## cvpred       790456.5  67438.95 466084.9  576510.0 274072.53 285852.8  382326.5
## price_sold  1432500.0 184000.00 815000.0  155000.0 229900.00 655000.0  200000.0
## CV residual  642043.5 116561.05 348915.1 -421510.0 -44172.53 369147.2 -182326.5
##                   778       798       799       800       806       810
## Predicted    452601.6 261238.66  505987.8  433429.6  62121.60  391531.7
## cvpred       448145.9 262010.11  502373.1  429168.6  62211.96  391233.8
## price_sold   300000.0 224000.00  133000.0  310000.0 173900.00  263500.0
## CV residual -148145.9 -38010.11 -369373.1 -119168.6 111688.04 -127733.8
##                   813       820       822         853       861       887
## Predicted   887284.31  215119.1  378874.3 228832.0463  225331.3 333460.53
## cvpred      879303.86  219379.5  380576.2 230678.5038  222599.2 332605.33
## price_sold  950000.00   80000.0  276000.0 230000.0000   89000.0 235000.00
## CV residual  70696.14 -139379.5 -104576.2   -678.5038 -133599.2 -97605.33
##                   889       891        912       914        926       931
## Predicted   156673.21 336803.77 135794.498  93570.24 238566.749  280224.9
## cvpred      160242.88 335879.67 141956.208  92730.03 238692.935  284473.4
## price_sold  176500.00 283900.00 146000.000 175000.00 230000.000  176000.0
## CV residual  16257.12 -51979.67   4043.792  82269.97  -8692.935 -108473.4
##                   932       946      957      967       969       970      1006
## Predicted    195732.4 125917.93 358178.8 205536.4  443463.4 137204.35 125639.23
## cvpred       198248.0 129410.72 354717.1 208275.0  441346.5 141420.87 132339.43
## price_sold    79000.0 200000.00 510000.0 333000.0  232000.0 200000.00 159000.00
## CV residual -119248.0  70589.28 155282.9 124725.0 -209346.5  58579.13  26660.57
##                  1017     1021      1039     1045     1046      1051       1052
## Predicted    82059.05 245866.3 271397.93 401494.6 106711.0 294910.99 261604.931
## cvpred       82342.03 247718.5 272255.68 401613.4 114308.9 293983.35 265513.243
## price_sold  149900.00 467000.0 351000.00 565000.0 325000.0 310000.00 275000.000
## CV residual  67557.97 219281.5  78744.32 163386.6 210691.1  16016.65   9486.757
##                  1053      1076     1078      1088     1096      1098      1102
## Predicted    77946.70 420260.21 322346.3  266299.3 369829.7 105352.45 389611.95
## cvpred       82657.44 419196.23 322792.5  264802.3 366802.6 108423.77 383914.94
## price_sold  180000.00 475000.00 461814.0  147400.0 555000.0 140000.00 465000.00
## CV residual  97342.56  55803.77 139021.5 -117402.3 188197.4  31576.23  81085.06
##                  1118     1141      1147       1160      1162      1183
## Predicted   213503.37 113138.1  418376.5 261396.742 241276.30  342032.9
## cvpred      217595.93 119937.5  413173.1 267201.717 242890.92  337796.0
## price_sold  235000.00 320000.0  290000.0 270000.000 339000.00   50013.0
## CV residual  17404.07 200062.5 -123173.1   2798.283  96109.08 -287783.0
##                  1194     1212     1223       1227      1230      1242
## Predicted    278529.9 114517.3 183702.7 189287.450 460921.10 344203.13
## cvpred       285025.0 122188.6 187462.2 195014.803 456246.59 347883.85
## price_sold    13233.0 250000.0 370000.0 197400.000 535000.00 385000.00
## CV residual -271792.0 127811.4 182537.8   2385.197  78753.41  37116.15
##                  1245      1248      1251      1256      1257      1267
## Predicted    226327.5 115735.94 517726.49 308649.62 517726.49 561367.33
## cvpred       230910.6 124183.96 512405.48 308849.15 512405.47 555595.83
## price_sold    70000.0  27886.00 590000.00 350000.00 590000.00 560200.00
## CV residual -160910.6 -96297.96  77594.52  41150.85  77594.53   4604.17
##                  1273      1281      1288      1298     1309      1330
## Predicted   262123.55 220676.74  249523.1  375823.3 335360.1 250563.62
## cvpred      260777.05 220571.03  256715.9  370134.3 339365.3 252968.12
## price_sold  200000.00 168000.00  109000.0 1059162.0 516116.0 214000.00
## CV residual -60777.05 -52571.03 -147715.9  689027.7 176750.7 -38968.12
##                  1342      1355      1357
## Predicted   439724.32 232328.81 314752.80
## cvpred      436184.61 233153.56 319583.54
## price_sold  425500.00 245000.00 280000.00
## CV residual -10684.61  11846.44 -39583.54
## 
## Sum of squares = 7.055997e+12    Mean square = 51882327825    n = 136 
## 
## fold 10 
## Observations in test set: 136 
##                     2         3         6        14        15        30
## Predicted   277102.57 89801.146  449624.9 157035.03 157035.03 89801.146
## cvpred      279135.82 93103.817  450409.7 160255.52 160255.52 93103.817
## price_sold  339900.00 90000.000  170000.0 179000.00 200000.00 90000.000
## CV residual  60764.18 -3103.817 -280409.7  18744.48  39744.48 -3103.817
##                   40        46        49        66        67        72       97
## Predicted   221111.6 306081.07 306426.57 370763.35 433000.58  825602.7 470122.3
## cvpred      222149.3 307141.86 306347.44 377084.17 437869.78  828127.2 467072.5
## price_sold  353000.0 250000.00 285000.00 392875.00 520000.00  540000.0 525000.0
## CV residual 130850.7 -57141.86 -21347.44  15790.83  82130.22 -288127.2  57927.5
##                   101       113       116       119       123        124
## Predicted   351925.12  323151.0  415479.6  340272.8  347958.7 379240.173
## cvpred      351026.24  323709.8  413537.4  340611.7  348488.5 377894.752
## price_sold  450000.00  205000.0   63497.0   55605.0  223000.0 382750.000
## CV residual  98973.76 -118709.8 -350040.4 -285006.7 -125488.5   4855.248
##                   129       132      143       147       150       170
## Predicted    297378.8  600033.5 394715.5 238784.23  336374.3 106909.70
## cvpred       297931.4  597605.2 393390.4 241987.92  338815.3 109007.31
## price_sold   167500.0  390000.0 355000.0 325000.00  193000.0  93765.00
## CV residual -130431.4 -207605.2 -38390.4  83012.08 -145815.3 -15242.31
##                   171       179       185       186      196       202
## Predicted    809316.3  297910.4 190518.54 336272.70 279258.6  481758.2
## cvpred       805664.6  298641.1 190153.21 336950.88 280772.6  481437.5
## price_sold   528400.0  108500.0 279000.00 350000.00 515000.0  297000.0
## CV residual -277264.6 -190141.1  88846.79  13049.12 234227.4 -184437.5
##                   226       236       255       266       270      274
## Predicted   752610.31 1307304.9  529101.3 341013.72  271827.1 503023.2
## cvpred      747771.96 1301168.3  529207.9 343315.18  273826.0 500738.1
## price_sold  792000.00 1900000.0  170000.0 276000.00  140000.0 983750.0
## CV residual  44228.04  598831.7 -359207.9 -67315.18 -133826.0 483011.9
##                   292       299       305       324       327       357
## Predicted    611671.5  351171.7 709457.94 105428.50 236541.68 237265.05
## cvpred       610802.7  353549.4 705921.58 105142.28 237851.54 238117.31
## price_sold   325500.0  224000.0 728000.00 202500.00 225000.00 269300.00
## CV residual -285302.7 -129549.4  22078.42  97357.72 -12851.54  31182.69
##                   364       366       402       422       438      456      483
## Predicted   745234.51  879688.0  804733.8  644178.5  197126.3 794386.8 358506.7
## cvpred      742371.16  876847.5  801127.6  640803.5  200706.1 791733.6 357704.0
## price_sold  800000.00 1425000.0 1305000.0  499000.0   50000.0 980000.0 500000.0
## CV residual  57628.84  548152.5  503872.4 -141803.5 -150706.1 188266.4 142296.0
##                   498       503       513       520       536       543
## Predicted    568668.6 399224.56  403534.0 200007.34 458803.16 428111.22
## cvpred       564643.7 398330.42  402467.3 200241.96 458745.12 425529.58
## price_sold   415000.0 325000.00  168000.0 265000.00 555000.00 407500.00
## CV residual -149643.7 -73330.42 -234467.3  64758.04  96254.88 -18029.58
##                  547       560      577      621       640       641       659
## Predicted   292195.5  418419.6 475061.1 352018.1 257614.23  501098.0  804483.6
## cvpred      292470.4  416684.7 474070.6 352799.1 259871.88  497643.1  797935.3
## price_sold  454500.0  290000.0 717000.0 435000.0 160100.00  350000.0 1430000.0
## CV residual 162029.6 -126684.7 242929.4  82200.9 -99771.88 -147643.1  632064.7
##                   661      670       687       692       693      698       714
## Predicted    88177.53 130102.9 238937.61  413682.2 451123.48 227267.4 244419.73
## cvpred       91516.02 131665.1 240304.97  414916.7 446358.05 228889.1 245167.38
## price_sold  173000.00 248000.0 259900.00  161975.0 415000.00 318900.0 262000.00
## CV residual  81483.98 116334.9  19595.03 -252941.7 -31358.05  90010.9  16832.62
##                   721        725       728       746       748       779
## Predicted    242577.2 277763.572  73988.30  747522.2 473040.99  73907.41
## cvpred       246069.6 280172.597  77943.22  745769.8 474283.45  73758.85
## price_sold    97000.0 286000.000 200100.00 1025000.0 395000.00 104900.00
## CV residual -149069.6   5827.403 122156.78  279230.2 -79283.45  31141.15
##                   815       819      823       825       828      832      833
## Predicted    573497.9  655415.7 385175.1 275060.23 206449.74 278041.2 325525.8
## cvpred       575982.6  652164.6 382528.8 276451.72 207180.22 279218.9 328847.6
## price_sold   300000.0  385000.0 360000.0 255000.00 220000.00 450000.0 589000.0
## CV residual -275982.6 -267164.6 -22528.8 -21451.72  12819.78 170781.1 260152.4
##                   840       845        855       862       875       882
## Predicted   158649.82 187909.70 357619.542 219353.47  67677.51 455683.33
## cvpred      161339.43 189082.18 360239.227 220805.21  69390.52 457761.32
## price_sold  125000.00 220000.00 365000.000 202000.00 155100.00 430000.00
## CV residual -36339.43  30917.82   4760.773 -18805.21  85709.48 -27761.32
##                   909      918      937       941       942       947       953
## Predicted   268314.23 380734.9 198072.6 269632.47 288635.87 215919.53 385169.70
## cvpred      271119.97 381161.6 199680.1 268961.64 290524.75 218292.86 382522.69
## price_sold  290000.00 584900.0 360000.0 320500.00 192000.00 200000.00 360000.00
## CV residual  18880.03 203738.4 160319.9  51538.36 -98524.75 -18292.86 -22522.69
##                   962      966        972      979       987       997
## Predicted   158573.49 240953.2 197743.104 262467.0 298356.32  294059.1
## cvpred      160394.76 242690.8 200034.401 263643.1 301033.91  295306.7
## price_sold  202000.00 500000.0 194000.000 384000.0 250000.00  164000.0
## CV residual  41605.24 257309.2  -6034.401 120356.9 -51033.91 -131306.7
##                  1000     1009     1020      1027      1040      1048      1062
## Predicted   124903.01 400022.2 138897.9  179076.8  436816.1 371545.72  328213.4
## cvpred      129109.65 401880.3 141512.5  180501.6  435724.8 369454.28  330294.4
## price_sold   91000.00 560000.0 457500.0   71050.0  305000.0 319900.00  130500.0
## CV residual -38109.65 158119.7 315987.5 -109451.6 -130724.8 -49554.28 -199794.4
##                 1068      1073      1106      1112      1129      1130
## Predicted   362879.9 250103.04  344874.3  69591.24 214857.53 199497.79
## cvpred      364877.8 253313.06  347067.6  70733.79 219265.99 203382.79
## price_sold  690000.0 190000.00  190600.0  32000.00 180000.00 180000.00
## CV residual 325122.2 -63313.06 -156467.6 -38733.79 -39265.99 -23382.79
##                  1149      1155      1156      1172      1193     1201
## Predicted   238534.86  394246.6 482927.09  95208.81  279460.6 476477.7
## cvpred      239088.85  387899.6 481176.09 100699.21  281369.9 476461.8
## price_sold  282000.00  253000.0 402000.00  90000.00   67000.0 560000.0
## CV residual  42911.15 -134899.6 -79176.09 -10699.21 -214369.9  83538.2
##                  1203      1216      1221     1231     1246      1250     1261
## Predicted   431700.45 265310.29  553480.0 483713.9 228917.9  210595.5 230490.6
## cvpred      431909.71 266077.36  557514.6 484957.0 229845.9  215905.3 235131.1
## price_sold  389000.00 339000.00  110000.0 750000.0 372000.0   10000.0 275000.0
## CV residual -42909.71  72922.64 -447514.6 265043.0 142154.1 -205905.3  39868.9
##                  1262      1289      1295      1311      1329      1338
## Predicted    367075.9  312032.1  508693.9 265924.64 265923.35  311381.9
## cvpred       368449.2  311734.1  505520.5 269155.63 269154.17  313126.7
## price_sold    85000.0  165000.0  370000.0 214000.00 214000.00  190000.0
## CV residual -283449.2 -146734.1 -135520.5 -55155.63 -55154.17 -123126.7
##                  1344      1363
## Predicted   248912.56  287446.8
## cvpred      250568.06  287841.4
## price_sold  223000.00  170000.0
## CV residual -27568.06 -117841.4
## 
## Sum of squares = 4.457074e+12    Mean square = 32772601952    n = 136 
## 
## Overall (Sum over all 136 folds) 
##          ms 
## 32670105154
# MSPE 
n2 = dim(clean_housing)[1]
MSPE2 <- sum((clean_housing$price_sold - KCV2$cvpred)^2) / n2
MSPE2
## [1] 32670105154
# Press Statistic
PRESS2 <- sum((clean_housing$price_sold - KCV2$cvpred)^2)
PRESS2
## [1] 4.462736e+13
# Prediction R-Squared
PRS2 <- 1 - sum((clean_housing$price_sold - KCV2$cvpred)^2) / sum((clean_housing$price_sold - 
                                                               mean(clean_housing$price_sold))^2)
PRS2
## [1] 0.6187243

Model 3:

# K-fold
KCV3 = cv.lm(data = clean_housing, housing_model3, m = 10, seed = 0)

## 
## fold 1 
## Observations in test set: 136 
##                     4         7        12        34        42       55
## Predicted   207343.93  567333.9 374565.53  349224.0 256725.27 272248.9
## cvpred      201810.34  573606.5 372682.26  346047.6 252012.12 267793.7
## price_sold  178000.00  275000.0 399000.00 1050000.0 235000.00 417000.0
## CV residual -23810.34 -298606.5  26317.74  703952.4 -17012.12 149206.3
##                    62       74       80       115       122       136
## Predicted   371874.59 321095.0 452973.1  551007.3  249023.4 377034.40
## cvpred      371115.17 317451.3 456473.7  557008.7  246222.9 377232.72
## price_sold  289000.00 685000.0 625000.0  254900.0   92500.0 291500.00
## CV residual -82115.17 367548.7 168526.3 -302108.7 -153722.9 -85732.72
##                    151       177      182       187      195       214
## Predicted   2044790.25 570753.97 294791.5 529193.82 471976.2  862745.2
## cvpred      2082010.69 577955.45 292751.4 534832.79 475792.5  875966.5
## price_sold  2000000.00 566000.00 440000.0 570000.00 398000.0  740000.0
## CV residual  -82010.69 -11955.45 147248.6  35167.21 -77792.5 -135966.5
##                   216       261        268       279      281      290
## Predicted   527914.94 1012450.2 240191.015  758094.2 126365.5 514933.9
## cvpred      532660.64 1027862.2 237243.746  769576.8 120655.1 519464.0
## price_sold  572500.00 1237500.0 244800.000 1400000.0 476000.0 710000.0
## CV residual  39839.36  209637.8   7556.254  630423.2 355344.9 190536.0
##                   296       301      303       304       313       323
## Predicted   1493684.7  436646.4 330414.7 1158291.0  470577.9 195225.89
## cvpred      1520004.8  439875.8 328966.4 1181375.8  472330.4 191531.55
## price_sold  1025000.0  255000.0 605000.0  518535.0  365000.0 235000.00
## CV residual -495004.8 -184875.8 276033.6 -662840.8 -107330.4  43468.45
##                   337       344       348       350       360       371
## Predicted    405599.1 201857.11 661814.17  438520.0  454846.6  769603.1
## cvpred       408312.6 196232.36 669656.56  441780.4  458378.3  781277.0
## price_sold   256000.0 159000.00 590000.00  265000.0  300000.0  525000.0
## CV residual -152312.6 -37232.36 -79656.56 -176780.4 -158378.3 -256277.0
##                   380       387       389      390      394       398       406
## Predicted   345853.23 288903.23  412037.1 685561.2 123569.0  398253.2 403993.20
## cvpred      345533.49 286765.29  413689.0 695838.7 113730.9  399676.1 406680.01
## price_sold  308000.00 225000.00  245000.0 999000.0 292000.0  180000.0 330000.00
## CV residual -37533.49 -61765.29 -168689.0 303161.3 178269.1 -219676.1 -76680.01
##                   417       419        445       450       459       465
## Predicted    698616.0 539438.31 509982.416 95391.952 1086574.7  98529.94
## cvpred       707069.8 543206.91 514430.184 87126.326 1104386.8  92357.03
## price_sold   560000.0 587500.00 522375.000 81500.000  799900.0 150000.00
## CV residual -147069.8  44293.09   7944.816 -5626.326 -304486.8  57642.97
##                  468       476       485       510       512       527
## Predicted   328040.1  521030.5 347592.95  656996.5 565995.64 333675.17
## cvpred      328593.0  526533.9 347302.12  664758.8 572246.05 333153.11
## price_sold  466400.0  375000.0 265000.00  450000.0 489900.00 272000.00
## CV residual 137807.0 -151533.9 -82302.12 -214758.8 -82346.05 -61153.11
##                   532       542       558       565       568       582
## Predicted   405866.74  794181.3 314329.94 716534.72 327251.58  71303.49
## cvpred      408584.69  803054.3 312614.45 729367.42 326622.79  62637.65
## price_sold  347000.00 1058756.0 360000.00 655000.00 375000.00 110000.00
## CV residual -61584.69  255701.7  47385.55 -74367.42  48377.21  47362.35
##                   603        607       614       619       620        623
## Predicted   358626.60 231210.967 148594.19  428884.6 129175.81 272770.453
## cvpred      360559.67 232195.668 139171.91  431985.0 123512.07 272405.058
## price_sold  329000.00 229600.000 188000.00  225000.0  95500.00 270000.000
## CV residual -31559.67  -2595.668  48828.09 -206985.0 -28012.07  -2405.058
##                   626       630      637       642       652       668      674
## Predicted    636387.5  433434.6 416171.3 361704.57  553074.7 281409.04 450370.4
## cvpred       643807.4  436610.6 419060.4 363688.78  561151.0 279146.59 451787.1
## price_sold   246000.0  270000.0 383000.0 325000.00  310000.0 343000.00 577000.0
## CV residual -397807.4 -166610.6 -36060.4 -38688.78 -251151.0  63853.41 125212.9
##                   676       680       682       694       696      705
## Predicted   180698.35  80523.61 132789.08 418545.84 484495.69 468482.9
## cvpred      175890.63  76092.13 127185.37 419433.86 486479.43 476322.4
## price_sold  130000.00 175000.00 140000.00 324900.00 440000.00 815000.0
## CV residual -45890.63  98907.87  12814.63 -94533.86 -46479.43 338677.6
##                   715       719      743       749       771       839
## Predicted    371606.9  446817.1 135137.9 195225.89 339028.16  95391.95
## cvpred       370843.1  450215.4 127532.6 191531.55 338595.03  87126.33
## price_sold   150000.0  275000.0 295000.0 230000.00 263000.00  60000.00
## CV residual -220843.1 -175215.4 167467.4  38468.45 -75595.03 -27126.33
##                   864       867       877      879       900       903      910
## Predicted    97593.17 187196.40 565727.99 244205.8 342106.13 344648.80 233499.8
## cvpred       91404.70 183368.66 571973.95 241325.2 341724.14 344309.06 230441.3
## price_sold  207500.00 267500.00 625000.00 511000.0 299900.00 380000.00 382000.0
## CV residual 116095.30  84131.34  53026.05 269674.8 -41824.14  35690.94 151558.7
##                  916       917        920       934      948       960
## Predicted   184178.5 227343.84 304694.555 191999.65 107556.2 471173.23
## cvpred      182341.2 224183.12 302818.978 189420.28 103573.9 474976.21
## price_sold  396300.0 256000.00 295000.000 155000.00 234900.0 560000.00
## CV residual 213958.8  31816.88  -7818.978 -34420.28 131326.1  85023.79
##                   965      968       990       992     1008     1064     1070
## Predicted    452511.6 245008.7  341497.0 128848.14 258391.2 296739.5 81474.18
## cvpred       453963.9 242141.5  343145.5 121138.38 255746.3 295603.8 72977.31
## price_sold   232000.0 500000.0  210000.0 170000.00 222000.0 215000.0 88000.00
## CV residual -221963.9 257858.5 -133145.5  48861.62 -33746.3 -80603.8 15022.69
##                 1071     1074      1084      1090      1092     1094      1124
## Predicted   81474.18 362046.0  65341.40 276859.00 238049.82 289097.1 215091.98
## cvpred      72977.31 361995.3  58617.08 274520.95 235066.97 289002.9 213768.28
## price_sold  88000.00 565000.0 155000.00 221500.00 250000.00 454500.0 256000.00
## CV residual 15022.69 203004.7  96382.92 -53020.95  14933.03 165497.1  42231.72
##                  1139      1140      1144      1145     1170      1179
## Predicted   220920.25 120015.71  662885.4 326299.70 198973.0  356826.9
## cvpred      217652.81 112159.19  673658.2 323911.07 195340.9  356689.4
## price_sold  284000.00 189900.00 1240000.0 350000.00 325000.0  235000.0
## CV residual  66347.19  77740.81  566341.8  26088.93 129659.1 -121689.4
##                  1185     1191      1213      1219      1255      1271
## Predicted   181487.51 262138.3  274911.6 203329.18 389077.97  311178.2
## cvpred      180774.07 259555.7  274581.8 197728.89 386563.79  311450.9
## price_sold  152500.00 429000.0   76000.0 165000.00 313000.00  125000.0
## CV residual -28274.07 169444.3 -198581.8 -32728.89 -73563.79 -186450.9
##                   1278      1282      1291      1305      1313     1315
## Predicted   244205.758  212414.8 214035.17  251953.8  296739.5 254450.2
## cvpred      241325.192  208134.1 208612.75  253283.1  295603.8 249699.3
## price_sold  242394.000   45000.0 220000.00  150000.0  186500.0 230000.0
## CV residual   1068.808 -163134.1  11387.25 -103283.1 -109103.8 -19699.3
##                 1336      1343     1345      1358      1359
## Predicted   298612.4 316010.30 254450.2 302285.71 188802.30
## cvpred      294595.2 315194.74 249699.3 300370.11 185001.24
## price_sold  425000.0 219000.00 189000.0 280000.00 175000.00
## CV residual 130404.8 -96194.74 -60699.3 -20370.11 -10001.24
## 
## Sum of squares = 4.58725e+12    Mean square = 33729782160    n = 136 
## 
## fold 2 
## Observations in test set: 137 
##                     5        8         9        11       21        23       27
## Predicted    370075.5 553757.6 247076.10 294121.74 260070.9  66559.61 127971.4
## cvpred       372306.6 559330.9 247943.38 286824.39 256651.1  57694.27 123210.1
## price_sold   269900.0 680000.0 233000.00 341000.00 403000.0 110000.00 317500.0
## CV residual -102406.6 120669.1 -14943.38  54175.61 146348.9  52305.73 194289.9
##                    70       82       88        89       102       108       112
## Predicted    371607.6 233901.3 298672.4 641740.46  628893.3  293527.7 237246.87
## cvpred       375962.5 232673.4 297285.3 649224.97  636409.4  295947.1 236010.77
## price_sold   185000.0 450000.0 530000.0 670000.00  245000.0  133000.0 188500.00
## CV residual -190962.5 217326.6 232714.7  20775.03 -391409.4 -162947.1 -47510.77
##                   127      145       149       154      155       167       173
## Predicted    686899.4 166988.2 323430.02  542709.5 568062.4 357361.50 1193574.5
## cvpred       696400.4 160003.5 321982.01  544516.1 571934.2 353702.49 1203495.9
## price_sold   110000.0 335000.0 415000.00  425000.0 853000.0 410000.00  980000.0
## CV residual -586400.4 174996.5  93017.99 -119516.1 281065.8  56297.51 -223495.9
##                   175      197       201       207      209      232        239
## Predicted   272308.96 137606.8  892454.9 510665.99 501759.1 435709.7 687643.014
## cvpred      270986.65 132821.8  907371.9 516345.26 503666.4 439907.0 700936.061
## price_sold  241000.00 290000.0  640000.0 426500.00 750000.0 950000.0 695000.000
## CV residual -29986.65 157178.2 -267371.9 -89845.26 246333.6 510093.0  -5936.061
##                  246       256       260       271        275       284
## Predicted   425137.5  243402.8  487867.7 553416.11 358760.423  793839.9
## cvpred      429360.8  242151.6  495730.6 561117.81 363146.932  804744.2
## price_sold  515000.0   19330.0  315700.0 515000.00 355000.000  490000.0
## CV residual  85639.2 -222821.6 -180030.6 -46117.81  -8146.932 -314744.2
##                  285        288      291       298       302       307
## Predicted   542234.8 486845.178 514933.9  375354.7  897747.9 393688.69
## cvpred      552091.6 492583.027 518936.4  379700.4  910524.3 397989.31
## price_sold  675000.0 484000.000 710000.0  255500.0  650000.0 325000.00
## CV residual 122908.4  -8583.027 191063.6 -124200.4 -260524.3 -72989.31
##                   317      318       329       343       374      395       397
## Predicted   223596.74 192817.0 399736.57  668505.4 569400.62 123569.0 1206154.6
## cvpred      222394.21 191690.2 404022.32  675924.1 573269.16 114563.4 1221966.5
## price_sold  290000.00 202000.0 430000.00 1075000.0 500000.00 292000.0  999000.0
## CV residual  67605.79  10309.8  25977.68  399075.9 -73269.16 177436.6 -222966.5
##                  408         413       429       442       451       464
## Predicted   129577.3 186988.1145  273647.2 275520.75 396840.46 607213.01
## cvpred      124812.1 182081.7534  272321.6 274190.54 399005.78 608861.02
## price_sold  193900.0 183000.0000  170000.0 287500.00 320000.00 520000.00
## CV residual  69087.9    918.2466 -102321.6  13309.46 -79005.78 -88861.02
##                   466         471       480       507       523      538
## Predicted   246942.27 213887.5529 473582.08 407606.46  614172.6 466697.7
## cvpred      247809.89 214836.4509 477686.24 411872.86  621724.9 474612.6
## price_sold  187500.00 215000.0000 427000.00 381300.00  420000.0 595000.0
## CV residual -60309.89    163.5491 -50686.24 -30572.86 -201724.9 120387.4
##                    552       575       589       618       635       638
## Predicted   222526.145 507707.39 200846.53 216637.85 258317.38 521833.46
## cvpred      221326.248 511727.65 199699.94 215452.44 259157.02 529612.83
## price_sold  225000.000 532000.00 175000.00 266000.00 190000.00 449000.00
## CV residual   3673.752  20272.35 -24699.94  50547.56 -69157.02 -80612.83
##                   648      657       700       713       720       727
## Predicted   458935.16 426341.9 340560.25 236979.22  526235.2  72374.09
## cvpred      460947.79 430562.3 344991.52 235743.78  532337.5  65622.01
## price_sold  390000.00 700000.0 395000.00 144500.00   38500.0 200100.00
## CV residual -70947.79 269437.7  50008.48 -91243.78 -493837.5 134477.99
##                   731       735       751        775       777       789
## Predicted   393019.56 147242.16 195225.89 196564.139  525580.6  396499.0
## cvpred      397321.83 142433.53 194093.13 195428.082  533350.7  400792.7
## price_sold  460000.00 126000.00 230000.00 199900.000  314500.0  270000.0
## CV residual  62678.17 -16433.53  35906.87   4471.918 -218850.7 -130792.7
##                   790       796         802      805      811       830
## Predicted    342433.1 436051.78 219508.1933 502428.2 129577.3 330657.22
## cvpred       340938.4 444042.08 220443.2703 504333.9 124812.1 335112.84
## price_sold   210000.0 369415.00 220000.0000 637000.0 265000.0 265000.00
## CV residual -130938.4 -74627.08   -443.2703 132666.1 140187.9 -70112.84
##                   835      838       846      847       850       854       865
## Predicted   251699.95 349526.5  243670.5 225470.3  316517.4  74782.94  97593.17
## cvpred      250428.31 353935.7  242418.6 224263.2  321469.0  68024.93  92906.63
## price_sold  230000.00 459900.0  128000.0 379000.0  172000.0 120000.00 207500.00
## CV residual -20428.31 105964.3 -114418.6 154736.8 -149469.0  51975.07 114593.37
##                   872       880        884       894       897      940
## Predicted   342373.78 131330.80 563988.265 159434.66 421999.52 189664.6
## cvpred      344673.03 122306.19 571663.973 156262.35 424102.97 184751.7
## price_sold  275000.00 100000.00 575000.000 176500.00 350000.00 310000.0
## CV residual -69673.03 -22306.19   3336.027  20237.65 -74102.97 125248.3
##                   958      963       977       996      1001      1002
## Predicted    223596.7 298672.4 183523.12  295059.2 306628.12  361169.3
## cvpred       222394.2 297285.3 180291.58  293680.9 307348.97  365549.9
## price_sold   121500.0 420000.0 134900.00  164000.0 280000.00  262500.0
## CV residual -100894.2 122714.7 -45391.58 -129680.9 -27348.97 -103049.9
##                  1003      1005      1012     1014      1016     1028      1030
## Predicted   155673.12 96924.042 360633.97 231224.8  275714.6 242733.7  472779.1
## cvpred      150843.76 92239.148 365015.87 230003.5  276511.5 241484.1  476885.3
## price_sold  135000.00 90000.000 450000.00 355000.0  135000.0 190000.0  333850.0
## CV residual -15843.76 -2239.148  84984.13 124996.5 -141511.5 -51484.1 -143035.3
##                  1097      1114      1115      1117      1127      1134
## Predicted   211344.88 502428.87  92300.19  422133.3  93116.93 244011.92
## cvpred      212300.03 510255.95  89754.22  424236.5  86313.84 240631.63
## price_sold  145000.00 485000.00 213000.00  160000.0 158000.00 300000.00
## CV residual -67300.03 -25255.95 123245.78 -264236.5  71686.16  59368.37
##                  1154      1157     1159     1169      1181     1187      1188
## Predicted   115064.19  224473.5 144371.8 192549.4  94053.70 337154.6  389614.6
## cvpred      108207.14  221141.3 137442.7 191423.2  87248.31 339466.7  397719.1
## price_sold   40000.00   60000.0  55000.0 320000.0 277000.00 420000.0  225000.0
## CV residual -68207.14 -161141.3 -82442.7 128576.8 189751.69  80533.3 -172719.1
##                  1197      1211     1218      1220      1234      1235     1263
## Predicted   187002.56  226882.3 233232.1 203329.18 105830.28  395963.1 386937.4
## cvpred      183762.46  223544.2 232005.9 200048.94  98995.94  394336.7 389127.1
## price_sold  230000.00   86000.0 435000.0 165000.00  58500.00  190000.0 374900.0
## CV residual  46237.54 -137544.2 202994.1 -35048.94 -40495.94 -204336.7 -14227.1
##                   1264      1272      1274      1299      1308      1325
## Predicted   222526.145 271699.85  98396.11  88968.36 318879.98 125904.00
## cvpred      221326.248 272506.59  93707.60  82175.48 317443.15 119020.29
## price_sold  225000.000 200000.00 162000.00 131000.00 229000.00 131000.00
## CV residual   3673.752 -72506.59  68292.40  48824.52 -88443.15  11979.71
##                  1333      1353
## Predicted   181114.27 223536.72
## cvpred      177888.65 220206.79
## price_sold   90000.00 245900.00
## CV residual -87888.65  25693.21
## 
## Sum of squares = 3.137126e+12    Mean square = 22898730858    n = 137 
## 
## fold 3 
## Observations in test set: 137 
##                    19        22        28        32        38        45
## Predicted    316010.3 211298.65  372410.5 254450.25 261469.15 188876.11
## cvpred       322088.4 213433.89  376159.2 254897.96 261979.91 192500.77
## price_sold   219000.0 173000.00  120000.0 230000.00 292000.00 130000.00
## CV residual -103088.4 -40433.89 -256159.2 -24897.96  30020.09 -62500.77
##                    47        60        84        87       106       120
## Predicted    352678.3  398253.2  557237.7  992094.4 675524.32  497745.0
## cvpred       356979.9  408556.5  568451.3  982643.1 673200.52  503631.2
## price_sold   200000.0  180000.0  218900.0  700000.0 615000.00  362500.0
## CV residual -156979.9 -228556.5 -349551.3 -282643.1 -58200.52 -141131.2
##                   142       146        172       178       188        194
## Predicted    262212.1 139212.67 524569.316 1120105.3  388201.9 1448244.32
## cvpred       262283.7 137436.78 520946.175 1112661.9  391185.5 1433515.95
## price_sold   140000.0 225000.00 525000.000 1609000.0  280000.0 1501960.00
## CV residual -122283.7  87563.22   4053.825  496338.1 -111185.5   68444.05
##                  204       218       221       224       237       238
## Predicted   411695.0  386134.5 1098812.7  891130.5 1302849.9 815653.30
## cvpred      413137.3  388815.2 1084594.2  886167.6 1286149.7 814347.16
## price_sold  834900.0  287400.0 1800000.0 1350000.0 1650000.0 792500.00
## CV residual 421762.7 -101415.2  715405.8  463832.4  363850.3 -21847.16
##                   314      322       331      332      354        368      376
## Predicted    470577.9 355354.8  505432.4 462073.1 107971.5 549862.857 226674.7
## cvpred       469167.5 359526.7  502736.4 461477.8 107306.1 553627.139 228871.2
## price_sold   365000.0 387500.0  349900.0 873500.0 275000.0 550000.000 200000.0
## CV residual -104167.5  27973.3 -152836.4 412022.2 167693.9  -3627.139 -28871.2
##                 378         381       399       400        401       407
## Predicted   1147806 248755.8004 274777.82  633637.2 537148.845  668030.1
## cvpred      1130408 249882.4934 275046.89  633342.7 532916.247  666069.4
## price_sold  1324000 250000.0000 200000.00 1200000.0 524900.000  475000.0
## CV residual  193592    117.5066 -75046.89  566657.3  -8016.247 -191069.4
##                   409       415       418       434       440       447
## Predicted    840410.9 261409.79 388469.52  877272.7 262807.40  169531.5
## cvpred       837905.3 270133.18 391440.18  873384.3 263253.32  174496.5
## price_sold   690000.0 235000.00 330000.00  565000.0 207000.00   63000.0
## CV residual -147905.3 -35133.18 -61440.18 -308384.3 -56253.32 -111496.5
##                   448       453       457      462      463       490      505
## Predicted   634707.10 447620.07  550264.3 563319.1 563319.1  261469.2 401852.0
## cvpred      625747.98 447724.99  554009.2 566028.4 566028.4  261979.9 404174.3
## price_sold  669000.00 499900.00  215000.0 520000.0 520000.0  129900.0 559000.0
## CV residual  43252.02  52175.01 -339009.2 -46028.4 -46028.4 -132079.9 154825.7
##                   509       517       533       539       555      562
## Predicted   358225.12  453849.8  738897.2  575021.3 242283.51 715878.1
## cvpred      362661.07  453249.8  733100.0  568953.8 235514.02 693970.4
## price_sold  320000.00  254000.0  410000.0  399000.0 180000.00 600000.0
## CV residual -42661.07 -199249.8 -323100.0 -169953.8 -55514.02 -93970.4
##                   581       588       595       606       615       622
## Predicted    364187.2 344916.45 612372.81 359028.07 373748.80 122083.10
## cvpred       367931.2 349594.09 612302.41 363425.12 377432.65 121137.11
## price_sold   200000.0 282000.00 550000.00 325000.00 331000.00 146500.00
## CV residual -167931.2 -67594.09 -62302.41 -38425.12 -46432.65  25362.89
##                    632       643       650      656       663       673
## Predicted   272770.453 225871.76 808084.65 229485.0  554545.4  712399.9
## cvpred      273136.772 228107.15 798935.44 231545.4  540857.1  707886.5
## price_sold  270000.000 315000.00 749900.00 380000.0  300000.0  319000.0
## CV residual  -3136.772  86892.85 -49035.44 148454.6 -240857.1 -388886.5
##                   675       678       702       717      739        744
## Predicted   404528.50 313066.16 235373.32 183523.12 220518.8 252502.894
## cvpred      406721.12 319286.88 237148.37 187407.13 223013.5 253448.047
## price_sold  365000.00 360000.00 140000.00 116500.00 292000.0 250000.000
## CV residual -41721.12  40713.12 -97148.37 -70907.13  68986.5  -3448.047
##                   754       757       767       769       776        780
## Predicted   179434.57 203864.48 521819.01 265885.37  394491.6 223924.411
## cvpred      183919.75 206762.99 518732.21 266182.17  397170.5 226657.235
## price_sold  170000.00 227500.00 490000.00 174900.00  267000.0 223000.000
## CV residual -13919.75  20737.01 -28732.21 -91282.17 -130170.5  -3657.235
##                   793       801       829       831       869      881
## Predicted    565653.5 109175.90  387860.4 330657.22 186185.82 297542.5
## cvpred       560039.9 108452.15  391263.7 336428.78 190747.02 304515.3
## price_sold   451000.0  68000.00  276000.0 265000.00 215000.00 381000.0
## CV residual -109039.9 -40452.15 -115263.7 -71428.78  24252.98  76484.7
##                    888       895       896       901       905       927
## Predicted   597845.933 225202.64 225202.64  486235.4  282747.3 205798.05
## cvpred      598882.424 227470.44 227470.44  484066.4  282227.2 209005.97
## price_sold  605000.000 189000.00 189000.00  375000.0  130000.0 197000.00
## CV residual   6117.576 -38470.44 -38470.44 -109066.4 -152227.2 -12005.97
##                   933       950      951       956       975       986
## Predicted   341630.85  96254.92 202318.6 115124.21  87422.48  394759.3
## cvpred      346870.76  96560.26 205695.1 114515.37  88155.74  397425.2
## price_sold  270000.00  85000.00 240300.0 180000.00 260000.00  260000.0
## CV residual -76870.76 -11560.26  34604.9  65484.63 171844.26 -137425.2
##                     999     1011      1015      1035     1060      1063
## Predicted   117071.5649 175687.5 106231.76 432765.52 269632.5 218451.38
## cvpred      115965.2789 180354.2 105650.64 433590.12 269747.7 220643.18
## price_sold  115700.0000 129000.0 119000.00 460000.00 499000.0 253000.00
## CV residual   -265.2789 -51354.2  13349.36  26409.88 229252.3  32356.82
##                  1093      1095      1107     1108      1110      1113
## Predicted    620461.7  310716.7  183523.1 140818.6 249291.10 109563.59
## cvpred       611789.6  308841.5  187407.1 138964.9 250391.86 109627.24
## price_sold  1150000.0  158200.0   83000.0 335000.0 178800.00 180000.00
## CV residual  538210.4 -150641.5 -104407.1 196035.1 -71591.86  70372.76
##                  1116      1119     1121     1125     1143     1150      1174
## Predicted   502428.87  77727.08 241796.9 222927.6 607019.8 217708.5 322225.60
## cvpred      508088.15  78526.97 243260.8 225305.6 607208.8 220339.3 319792.81
## price_sold  485000.00 105111.00 495000.0 380000.0 843475.0 388400.0 366000.00
## CV residual -23088.15  26584.03 251739.2 154694.4 236266.2 168060.7  46207.19
##                  1189      1202      1204     1207     1208      1241
## Predicted   183181.66  88373.05  496286.7 288442.4 177293.4 149055.69
## cvpred      187485.31  88254.06  501437.4 295856.1 181882.3 146399.82
## price_sold  111500.00 131000.00  197750.0 445000.0 165000.0 157000.00
## CV residual -75985.31  42745.94 -303687.4 149143.9 -16882.3  10600.18
##                   1254       1266      1292      1302      1307      1321
## Predicted   293794.731 179568.393  236443.9 214570.47 318879.98  331579.5
## cvpred      292336.272 184047.096  238167.1 216950.28 316609.28  329499.8
## price_sold  290000.000 182500.000    2900.0 142500.00 229900.00  200000.0
## CV residual  -2336.272  -1547.096 -235267.1 -74450.28 -86709.28 -129499.8
##                  1322      1324     1326     1334     1335       1339      1348
## Predicted   235373.32 276905.23 442876.2 298612.4 298612.4 321363.293  30011.66
## cvpred      237148.37 277877.42 442807.8 296920.6 296920.6 327182.037  33526.37
## price_sold  212000.00 300749.00 899900.0 425000.0 425000.0 335000.000 150000.00
## CV residual -25148.37  22871.58 457092.2 128079.4 128079.4   7817.963 116473.63
##                  1364
## Predicted   217246.96
## cvpred      219497.11
## price_sold  155000.00
## CV residual -64497.11
## 
## Sum of squares = 4.383583e+12    Mean square = 31996959125    n = 137 
## 
## fold 4 
## Observations in test set: 137 
##                   31        48        51        52        58       61       75
## Predicted   239997.2  352678.3  469058.5 312262.55  250837.0 319355.3 353213.6
## cvpred      239821.9  351926.1  468102.0 314172.06  250974.5 321469.4 352476.8
## price_sold  363000.0  200000.0 1075000.0 264900.00  110000.0 439000.0 550000.0
## CV residual 123178.1 -151926.1  606898.0 -49272.06 -140974.5 117530.6 197523.2
##                   91        99      100       107       130       135      148
## Predicted   404067.7 420319.82 476466.2  236979.2  357347.7  439396.7 318344.7
## cvpred      400970.3 421784.99 479285.1  236983.0  361089.9  441146.2 320695.7
## price_sold  600000.0 505000.00 625000.0   54474.0   69668.0  212000.0 500000.0
## CV residual 199029.7  83215.01 145714.9 -182509.0 -291421.9 -229146.2 179304.3
##                  166       192        199       203       205       212
## Predicted   243938.1 977447.45 127777.547  71303.49 259000.29 587942.90
## cvpred      244142.6 986797.43 128458.666  70355.43 259373.27 590150.02
## price_sold  353000.0 932000.00 120000.000 179725.00 244900.00 528000.00
## CV residual 108857.4 -54797.43  -8458.666 109369.57 -14473.27 -62150.02
##                  215       235       241       242       251       257
## Predicted   100938.8 413494.75 1200593.4  368603.4 280338.45 226273.24
## cvpred      101111.7 414763.04 1216646.8  368310.6 281593.04 225968.14
## price_sold   40000.0 450500.00  935000.0   90201.0 319000.00 265000.00
## CV residual -61111.7  35736.96 -281646.8 -278109.6  37406.96  39031.86
##                   306       316       330       335       347       349
## Predicted   348395.90 227343.84 322017.97 524241.65 779580.63  568062.4
## cvpred      347520.14 227069.63 324740.99 528438.74 783488.53  573789.7
## price_sold  305500.00 289900.00 340000.00 512900.00 858700.00  444500.0
## CV residual -42020.14  62830.37  15259.01 -15538.74  75211.47 -129289.7
##                   369       372       386       411      416       423      426
## Predicted   192014.10  673323.1 285156.14 502012.29 561980.9 197902.39 504495.6
## cvpred      190720.68  677993.3 286549.72 509927.84 563439.1 196778.84 508389.1
## price_sold  280000.00  475000.0 255000.00 449500.00 675000.0 210000.00 900000.0
## CV residual  89279.32 -202993.3 -31549.72 -60427.84 111560.9  13221.16 391610.9
##                   433       436       460      477       484       497
## Predicted    263550.3  520093.7 1086574.7 571616.3 184593.72 391413.67
## cvpred       264054.6  520343.5 1099338.8 573352.4 182820.19 392044.95
## price_sold   163500.0  405000.0  799900.0 633000.0 215000.00 380000.00
## CV residual -100554.6 -115343.5 -299438.8  59647.6  32179.81 -12044.95
##                   499       506       514       519       530       557
## Predicted    579497.5 532940.92 371875.25 264011.82  485700.1 375160.85
## cvpred       585820.7 533561.33 371942.88 264795.42  488785.4 375057.22
## price_sold   482725.0 608000.00 324900.00 183000.00  335000.0 279900.00
## CV residual -103095.7  74438.67 -47042.88 -81795.42 -153785.4 -95157.22
##                   566       567       574       585       592       593
## Predicted    377034.4 165174.68 235373.32  88894.56 408007.94  415649.7
## cvpred       376984.8 167200.68 235330.75  88720.01 409117.94  416448.1
## price_sold   235000.0 115000.00 260000.00 119000.00 467000.00  289000.0
## CV residual -141984.8 -52200.68  24669.25  30279.99  57882.06 -127448.1
##                   597       599       604       634      645      654    665
## Predicted    345451.8  467366.1  306969.6  558976.7 221990.8 280739.9 246347
## cvpred       344491.1  469922.5  308992.4  560082.2 221562.2 282006.1 246621
## price_sold   229000.0  300000.0  185000.0  320000.0 329000.0 262500.0 378000
## CV residual -115491.1 -169922.5 -123992.4 -240082.2 107437.8 -19506.1 131379
##                   684      685       688       690       695       697      703
## Predicted   239314.26 245008.7 383116.53 232696.83 484495.69  264011.8 120611.0
## cvpred      239651.42 245244.1 383508.45 232577.04 487546.18  264795.4 121351.4
## price_sold  219900.00 259900.0 358000.00 184900.00 440000.00   98775.0 232500.0
## CV residual -19751.42  14655.9 -25508.45 -47677.04 -47546.18 -166020.4 111148.6
##                   708      710       718       745       752       759      765
## Predicted   207330.14 295400.6  498741.1  725307.1  473849.7  246748.4 384990.1
## cvpred      206744.61 296823.7  502468.6  731743.0  476859.1  247034.0 385436.0
## price_sold  273000.00 220000.0  255000.0 1025000.0  329900.0  115000.0 740000.0
## CV residual  66255.39 -76823.7 -247468.6  293257.0 -146959.1 -132034.0 354564.0
##                   766       773      774       787      791      797       808
## Predicted   289037.06 371205.47 292115.0  74976.78 531200.5 244339.6  468898.2
## cvpred      290542.59 375081.42 293709.4  74400.73 535598.4 244555.7  471764.8
## price_sold  335000.00 430000.00 565100.0 155900.00 710000.0 404325.0  136429.0
## CV residual  44457.41  54918.58 271390.6  81499.27 174401.6 159769.3 -335335.8
##                   809      814       818      841       860       873       898
## Predicted   216564.05 254035.0  488422.8 202720.1 364648.71 345377.95 264011.82
## cvpred      216244.91 254796.8  492384.8 201735.5 364507.87 344681.17 264795.42
## price_sold  241000.00 500000.0   73000.0 360000.0 445000.00 285000.00 207000.00
## CV residual  24755.09 245203.2 -419384.8 158264.5  80492.13 -59681.17 -57795.42
##                  908       911      913       924       971       993       998
## Predicted   233499.8  557832.3 371681.4 199642.11 212697.58  383056.5 155673.12
## cvpred      233403.2  559170.8 371477.4 198568.75 207907.15  383180.7 157425.02
## price_sold  382000.0  382000.0 284900.0 180000.00 230000.00  260000.0 135800.00
## CV residual 148596.8 -177170.8 -86577.4 -18568.75  22092.85 -123180.7 -21625.02
##                 1010     1031      1034      1047      1056     1059      1066
## Predicted   104565.8 206541.0  466548.7 379101.79 325035.92 238585.1 296739.53
## cvpred      104311.3 205400.6  473441.2 379377.89 327579.96 238635.2 294373.58
## price_sold  175000.0 175000.0  185000.0 319000.00 350000.00 506000.0 210000.00
## CV residual  70688.7 -30400.6 -288441.2 -60377.89  22420.04 267364.8 -84373.58
##                  1067      1080      1085      1087      1099      1133
## Predicted   372812.02  692058.6  393554.9  58723.96  398981.7  523498.7
## cvpred      372906.68  697269.3  394247.9  57413.00  399565.2  527940.4
## price_sold  449900.00 1070000.0   75000.0 168000.00  280000.0  390000.0
## CV residual  76993.32  372730.7 -319247.9 110587.00 -119565.2 -137940.4
##                  1163     1168      1176      1184      1186      1190
## Predicted   219448.18 117473.0 236517.73 181649.57  72374.09 240043.40
## cvpred      218946.19 117856.9 236242.12 179791.11  71456.91 240667.64
## price_sold  288500.00 285000.0 170000.00 190000.00 237500.00 145000.00
## CV residual  69553.81 167143.1 -66242.12  10208.89 166043.09 -95667.64
##                  1192     1195      1196      1198      1206      1222
## Predicted   183181.66 279743.1 152862.80  367250.7  414980.6  283208.8
## cvpred      181633.45 280714.5 154533.63  371278.7  415759.7  284812.2
## price_sold  111500.00 415000.0 130000.00   74000.0  284700.0  165000.0
## CV residual -70133.45 134285.5 -24533.63 -297278.7 -131059.7 -119812.2
##                  1225        1228      1237      1249      1260      1280
## Predicted   310122.01 277989.6191 186601.09  393167.2 168654.12 225664.13
## cvpred      308142.12 279442.4998 184885.47  393317.0 170780.51 225607.51
## price_sold  235000.00 280000.0000 235000.00  282200.0 209900.00 168000.00
## CV residual -73142.12    557.5002  50114.53 -111117.0  39119.49 -57607.51
##                  1293      1310      1314      1317      1319      1340
## Predicted   370343.16  300070.7 254450.25 254450.25  214155.2 321363.29
## cvpred      370100.54  302160.6 254691.97 254691.97  213766.6 319707.69
## price_sold  382500.00  160000.0 239900.00 240316.00   10000.0 335500.00
## CV residual  12399.46 -142160.6 -14791.97 -14375.97 -203766.6  15792.31
##                  1365
## Predicted   722183.59
## cvpred      723903.59
## price_sold  625000.00
## CV residual -98903.59
## 
## Sum of squares = 3.313509e+12    Mean square = 24186194576    n = 137 
## 
## fold 5 
## Observations in test set: 137 
##                    18       26       43        56        57       65       81
## Predicted    565266.5 343831.4 191954.1 216042.54 215105.76 231626.2 253647.3
## cvpred       566260.9 341894.8 190398.8 215373.36 214402.13 228546.2 254361.4
## price_sold  1050000.0 480000.0 134000.0 190000.00 150000.00 535000.0 419900.0
## CV residual  483739.1 138105.2 -56398.8 -25373.36 -64402.13 306453.8 165538.6
##                  137       139      140       141       156       158      168
## Predicted   668505.4  379309.4 415561.5  534606.2  705917.0 353481.24 420186.0
## cvpred      670313.4  377562.6 416263.5  535588.0  705001.8 350784.37 416958.8
## price_sold  915000.0   51314.0 615000.0  375000.0  580000.0 420000.00 565000.0
## CV residual 244686.6 -326248.6 198736.5 -160588.0 -125001.8  69215.63 148041.2
##                  181       183       191      210       213       219
## Predicted   194616.8 533610.04 368797.28 332530.8 1033787.7  830834.9
## cvpred      187191.3 530455.85 363679.74 326079.1 1044933.4  838614.2
## price_sold  255000.0 435000.00 349900.00 450000.0  700000.0 1300000.0
## CV residual  67808.7 -95455.85 -13779.74 123920.9 -344933.4  461385.8
##                    230       245       250      254       259       263
## Predicted   546382.754  945998.6 1099228.7 242283.5 236979.22 1181188.8
## cvpred      547797.762  953915.0 1105698.2 243694.9 234096.13 1194772.6
## price_sold  550000.000  759000.0  651900.0 195000.0 310000.00 1010000.0
## CV residual   2202.238 -194915.0 -453798.2 -48694.9  75903.87 -184772.6
##                   267        269      272       276       294      297
## Predicted    417851.0 240191.015 360098.0  62471.06 1337510.6 519424.6
## cvpred       417521.9 237426.073 361743.9  60252.05 1355729.4 515748.6
## price_sold   285000.0 244800.000 630000.0 155000.00 1000000.0 550000.0
## CV residual -132521.9   7373.927 268256.1  94747.95 -355729.4  34251.4
##                   300       308       311        320     325      328      333
## Predicted   194348.48 1348203.4 117071.56 318612.991 1183062 412096.5 462073.1
## cvpred      193996.55 1353764.1 116861.06 311649.401 1196715 411555.8 460386.8
## price_sold  260000.00 1150000.0 215000.00 310000.000 1320000 331500.0 873500.0
## CV residual  66003.45 -203764.1  98138.94  -1649.401  123285 -80055.8 413113.2
##                  334       336       338       341        361       363
## Predicted   512258.1  825750.2 293393.92 536152.71 698615.987 375146.40
## cvpred      505334.4  826259.0 288486.71 533092.05 701531.599 374361.77
## price_sold  712000.0 1128000.0 335000.00 512500.00 700000.000 280000.00
## CV residual 206665.6  301741.0  46513.29 -20592.05  -1531.599 -94361.77
##                  367        385       432       441       454      474      492
## Predicted   773424.7 364648.713 477671.29 310389.66 1075823.8 109651.2 343503.7
## cvpred      772008.7 359378.564 472459.36 306107.65 1080317.1 112151.8 344539.2
## price_sold  940000.0 364000.000 414000.00 288900.00 1550000.0 290000.0 257000.0
## CV residual 167991.3   4621.436 -58459.36 -17207.65  469682.9 177848.2 -87539.2
##                   495       501      554       556      564      576       584
## Predicted    649562.3  487647.5 661888.0 380707.69 412096.5 471515.3 307297.24
## cvpred       647689.4  492870.0 666436.6 376028.27 411555.8 466077.0 304016.75
## price_sold  1500100.0  177000.0 799000.0 305000.00 629900.0 717000.0 252000.00
## CV residual  852410.6 -315870.0 132563.4 -71028.27 218344.2 250923.0 -52016.75
##                   587       596       627       639      664       667
## Predicted   344916.45 612372.81 215834.91 433702.30 389613.9 220117.30
## cvpred      341904.52 615100.02 212174.02 430972.31 388246.2 216613.94
## price_sold  282000.00 550000.00 287990.00 449000.00 649900.0 240000.00
## CV residual -59904.52 -65100.02  75815.98  18027.69 261653.8  23386.06
##                   689       691        699       709      716      726
## Predicted   307980.82 101875.56 236176.272  698080.7 255179.4 233232.1
## cvpred      303610.19  98121.98 233263.646  700976.6 252965.8 230211.2
## price_sold  255000.00  84500.00 225000.000  468000.0 223500.0 228000.0
## CV residual -48610.19 -13621.98  -8263.646 -232976.6 -29465.8  -2211.2
##                   729       730       760       763       784       786
## Predicted    377227.6 220920.25  392290.4 342106.13  81875.65  198437.7
## cvpred       379503.6 217446.42  391021.2 338990.82  80370.45  194136.8
## price_sold   255000.0 199000.00  266000.0 260000.00 282525.00   55000.0
## CV residual -124503.6 -18446.42 -125021.2 -78990.82 202154.55 -139136.8
##                   795       804       807       816      824       826
## Predicted    885911.3  87823.96  711329.3 311605.40 395696.1  377361.4
## cvpred       891617.3  83553.49  714712.6 308483.39 391568.0  379642.3
## price_sold   460000.0 162000.00  599950.0 215000.00 360000.0  276000.0
## CV residual -431617.3  78446.51 -114762.6 -93483.39 -31568.0 -103642.3
##                   837       843       844       858      885       902
## Predicted   247417.55  94649.02 205396.57 388275.68 330414.7  523974.0
## cvpred      244918.44  90629.62 201351.71 386858.73 330968.6  527548.8
## price_sold  259000.00 205000.00 140000.00 430000.00 495000.0  400000.0
## CV residual  14081.56 114370.38 -61351.71  43141.27 164031.4 -127548.8
##                   906      907       922       923      928       939      954
## Predicted   185055.21 430029.7 199642.11 199642.11 290836.8 314463.76 277394.3
## cvpred      180262.07 423065.2 195385.56 195385.56 286950.8 314430.97 275997.9
## price_sold  135000.00 545000.0 180000.00 180000.00 265000.0 253000.00 295000.0
## CV residual -45262.07 121934.8 -15385.56 -15385.56 -21950.8 -61430.97  19002.1
##                  955       961       964       989      1018      1022     1033
## Predicted   277394.3 208608.37 179166.92 278137.89  357823.6 288977.04 208534.6
## cvpred      275997.9 204681.65 174157.18 272669.49  352302.4 290990.79 201621.0
## price_sold  295000.0 120000.00 199000.00 209500.00  237160.0 385000.00 335000.0
## CV residual  19002.1 -84681.65  24842.82 -63169.49 -115142.4  94009.21 133379.0
##                  1037      1041     1069      1082      1111      1126
## Predicted   214496.66  297006.5 395622.3 243268.98  90634.28 162170.51
## cvpred      210786.54  299315.6 388507.4 240617.27  86467.19 163618.99
## price_sold  227000.00  173000.0 570000.0 141000.00 260000.00 120000.00
## CV residual  16213.46 -126315.6 181492.6 -99617.27 173532.81 -43618.99
##                  1128      1131     1138      1142      1148      1164     1165
## Predicted    89102.19 206942.45 208206.9 272502.80 360172.48 214958.15 238183.6
## cvpred       87862.82 205938.53 204265.4 267942.39 357721.75 208280.93 235344.9
## price_sold  165000.00 180000.00 370000.0 195000.00 400000.00 187500.00 339000.0
## CV residual  77137.18 -25938.53 165734.6 -72942.39  42278.25 -20780.93 103655.1
##                  1171      1173      1180      1205      1214      1236
## Predicted   238391.27 154067.22  94053.70  95391.95 358091.30 217039.33
## cvpred      238544.21 152233.54  92996.48  94383.95 352579.93 213422.74
## price_sold  163500.00 110650.00 277000.00 180000.00 435000.00 238000.00
## CV residual -75044.21 -41583.54 184003.52  85616.05  82420.07  24577.26
##                  1240     1243      1247      1268      1284     1296     1300
## Predicted    432512.3 310122.0 109845.03  314122.3 289244.69 233305.9 198110.0
## cvpred       428623.3 305830.2 109368.69  311092.9 291268.28 233271.8 196781.2
## price_sold   322000.0 416000.0  27886.00  170000.0 235000.00 195000.0 367700.0
## CV residual -106623.3 110169.8 -81482.69 -141092.9 -56268.28 -38271.8 170918.8
##                  1304      1316      1318      1347      1354      1360
## Predicted   104565.84 254450.25 101889.35 240933.95 216042.54  363785.1
## cvpred      106879.39 255193.91 104104.43 241180.41 215373.36  368550.7
## price_sold  120000.00 227000.00 140000.00 275000.00 190000.00   70000.0
## CV residual  13120.61 -28193.91  35895.57  33819.59 -25373.36 -298550.7
##                  1362      1366
## Predicted   161977.33 199300.65
## cvpred      159319.34 192047.47
## price_sold   92500.00 215000.00
## CV residual -66819.34  22952.53
## 
## Sum of squares = 4.159404e+12    Mean square = 30360614079    n = 137 
## 
## fold 6 
## Observations in test set: 137 
##                    17        20       25        33       36       41        53
## Predicted    477135.3 316010.30 184727.5  89369.84 223804.4 208474.5 366134.57
## cvpred       477298.8 311870.08 184526.9  91669.21 224647.5 206509.0 365732.43
## price_sold  1050000.0 219000.00 309000.0 230000.00 595000.0 165000.0 440000.00
## CV residual  572701.2 -92870.08 124473.1 138330.79 370352.5 -41509.0  74267.57
##                    59        69        78        83        86       96
## Predicted   612372.81 274450.16 285617.63  507915.7 280412.25 126097.8
## cvpred      611101.55 274246.85 283313.38  501455.1 282767.44 126979.0
## price_sold  535000.00 355000.00 307000.00  259900.0 365000.00 315000.0
## CV residual -76101.55  80753.15  23686.62 -241555.1  82232.56 188021.0
##                   105       114       125       160       162       163
## Predicted    803207.6 235373.32  359369.5 175955.12  756963.6  77579.47
## cvpred       799587.4 234126.26  356387.4 173120.98  757155.2  74765.44
## price_sold   667000.0 147000.00  249900.0 230000.00  385000.0 205000.00
## CV residual -132587.4 -87126.26 -106487.4  56879.02 -372155.2 130234.56
##                  165      189       193       200       208       222
## Predicted   275253.8 485031.0 471976.18  805809.6  434652.9 100671.14
## cvpred      267625.7 485405.4 469602.63  807305.9  436080.9 100873.13
## price_sold  485000.0 611000.0 398000.00  470000.0  276000.0 108000.00
## CV residual 217374.3 125594.6 -71602.63 -337305.9 -160080.9   7126.87
##                    225      229       240       247       248       249
## Predicted   1219002.49 395963.1 168460.94  778985.3 205738.03  438787.6
## cvpred      1211595.81 399005.4 165426.62  774718.1 206098.64  435527.6
## price_sold  1300000.00 525000.0 178500.00  585000.0 230000.00  275000.0
## CV residual   88404.19 125994.6  13073.38 -189718.1  23901.36 -160527.6
##                  252       310       321      340       345       346       352
## Predicted   208474.5 342106.13 658067.08 512258.1  365109.5 716087.67 240592.49
## cvpred      206509.0 338662.94 655617.09 503514.2  364928.6 710140.43 239484.83
## price_sold  165000.0 307200.00 585000.00 712000.0  236000.0 800000.00 266000.00
## CV residual -41509.0 -31462.94 -70617.09 208485.8 -128928.6  89859.57  26515.17
##                   356      359         370       375       377       392
## Predicted   563586.79 139212.7 248681.9938 270167.76 249291.10 1730019.9
## cvpred      558613.19 140444.1 245391.1732 269850.08 248415.79 1731215.7
## price_sold  581000.00 266900.0 244554.0000 208000.00 268000.00 2700000.0
## CV residual  22386.81 126455.9   -837.1732 -61850.08  19584.21  968784.3
##                   404      420      421       430       437       446       452
## Predicted    629487.9 486101.6 362179.8 867027.57 310375.21  760844.5 294256.22
## cvpred       631321.6 486504.6 359272.8 867759.75 308732.24  761139.7 294581.95
## price_sold   500000.0 624900.0 549980.0 800000.00 400000.00  530000.0 311500.00
## CV residual -131321.6 138395.4 190707.2 -67759.75  91267.76 -231139.7  16918.05
##                   467       496       500       511      521       526
## Predicted    699345.1  649562.3 423799.26 242451.59 347057.6  236176.3
## cvpred       695598.4  644485.9 420138.89 244041.36 343746.7  234950.7
## price_sold   525000.0 1500100.0 410000.00 200000.00 485000.0  128000.0
## CV residual -170598.4  855614.1 -10138.89 -44041.36 141253.3 -106950.7
##                   528       545      546        569       573       580
## Predicted   207270.12 427472.55 289097.1 217708.453 318419.15 596700.87
## cvpred      205272.41 421511.05 286885.8 215989.556 314343.27 597658.76
## price_sold  255000.00 482500.00 454500.0 219900.000 276000.00 545000.00
## CV residual  49727.59  60988.95 167614.2   3910.444 -38343.27 -52658.76
##                  586      611       624        644       647       649
## Predicted   263610.4 386536.0 408201.78 406268.217 256711.48 302627.82
## cvpred      263117.5 384279.5 401725.55 402139.581 253635.13 298130.15
## price_sold  425000.0 300000.0 320305.00 405000.000 215000.00 270000.00
## CV residual 161882.5 -84279.5 -81420.55   2860.419 -38635.13 -28130.15
##                   655        666       671       672       677       683
## Predicted   329928.08 243462.828  88626.91  417181.8 222332.30  467499.9
## cvpred      326159.61 240032.601  88507.19  415743.9 223136.15  467406.1
## price_sold  280000.00 235000.000 120000.00  269900.0 194900.00  280000.0
## CV residual -46159.61  -5032.601  31492.81 -145843.9 -28236.15 -187406.1
##                   686       722       723       747       753       755
## Predicted    525312.2  238183.6  358834.2 207343.93  365257.8 1233246.6
## cvpred       526762.6  237011.6  355837.9 207747.43  362433.0 1238713.6
## price_sold   415000.0   80000.0  163600.0 159900.00  260000.0  980000.0
## CV residual -111762.6 -157011.6 -192237.9 -47847.43 -102433.0 -258713.6
##                   758       764      785       788       794       817      834
## Predicted   319682.93 119955.69 259997.1 197694.76  339295.8 371339.95 299876.9
## cvpred      320687.81 125471.26 259407.7 193042.05  335777.6 366278.37 300352.7
## price_sold  385000.00 205000.00 550000.0 219900.00  190000.0 337000.00 589000.0
## CV residual  64312.19  79528.74 290592.3  26857.95 -145777.6 -29278.37 288647.3
##                   848      851       857       871        874      876
## Predicted    587541.4 271164.6 1056060.6 342373.78 169531.535 289900.0
## cvpred       583207.7 268474.3 1079133.7 338937.74 166525.813 287710.2
## price_sold  1200000.0 660000.0  530000.0 275000.00 175000.000 565000.0
## CV residual  616792.3 391525.7 -549133.7 -63937.74   8474.187 277289.8
##                   878       890       892       893       925       930
## Predicted   360975.43 233232.13  94381.37  94381.37 111049.45 328322.18
## cvpred      358036.24 231927.87  94415.36  94415.36 113927.89 324510.82
## price_sold  445000.00 270000.00 143000.00 143000.00 160500.00 260000.00
## CV residual  86963.76  38072.13  48584.64  48584.64  46572.11 -64510.82
##                   935      944       952       959       978       980
## Predicted   133859.68 256250.0 409078.54 169070.04  226467.1 178705.43
## cvpred      134948.15 255560.5 405024.97 168451.23  222582.9 178343.98
## price_sold  179900.00 512500.0 380000.00  93000.00   90000.0  90500.00
## CV residual  44951.85 256939.5 -25024.97 -75451.23 -132582.9 -87843.98
##                   994      1023      1025      1029      1032      1038
## Predicted   116863.93 268294.22 229485.03 220726.40 221589.37 262138.28
## cvpred      117498.44 267926.49 228080.69 221487.36 219974.13 261606.12
## price_sold  135000.00 182850.00 144900.00 205000.00 193000.00 346000.00
## CV residual  17501.56 -85076.49 -83180.69 -16487.36 -26974.13  84393.88
##                  1044       1049     1050      1065     1075     1081      1089
## Predicted   379101.79 258049.728 217708.5 361049.23 244132.0 113652.1  293974.8
## cvpred      374247.53 255009.123 215989.6 360511.26 240719.6 114200.9  289494.5
## price_sold  319900.00 253000.000 329000.0 317000.00 187000.0 253000.0   39000.0
## CV residual -54347.53  -2009.123 113010.4 -43511.26 -53719.6 138799.1 -250494.5
##                 1105       1122     1136        1166     1178     1199
## Predicted   265216.2 469701.159 143227.4 188192.5375 543780.7 200920.3
## cvpred      264766.3 467266.842 144566.1 190732.2625 538278.1 201152.3
## price_sold  478000.0 465000.000  50000.0 191000.0000 655500.0 347500.0
## CV residual 213233.7  -2266.842 -94566.1    267.7375 117221.9 146347.7
##                  1215      1217      1265     1276      1277        1279
## Predicted   435635.86 270168.42  74247.64 225664.1  61326.65 244205.7581
## cvpred      429892.41 262404.51  76143.09 221758.5  60477.74 243194.6139
## price_sold  351000.00 339000.00 142000.00 168000.0  45000.00 242394.0000
## CV residual -78892.41  76595.49  65856.91 -53758.5 -15477.74   -800.6139
##                  1297     1303      1341      1349     1351      1356
## Predicted    440467.3 284888.5  246153.1 207611.58 230094.1  168460.9
## cvpred       439651.4 284964.0  247593.2 208022.23 231105.3  165426.6
## price_sold   221000.0 225000.0   60000.0 135000.00 353000.0   50000.0
## CV residual -218651.4 -59964.0 -187593.2 -73022.23 121894.7 -115426.6
## 
## Sum of squares = 4.974171e+12    Mean square = 36307815266    n = 137 
## 
## fold 7 
## Observations in test set: 137 
##                    24        29        44        54        73       77       79
## Predicted   323578.30 83347.722 320827.99  462756.1  439397.4 319281.5 523632.5
## cvpred      318672.56 87501.905 317054.65  457998.7  432227.8 320164.5 521210.7
## price_sold  290000.00 90000.000 230000.00  170000.0  310000.0 425000.0 700000.0
## CV residual -28672.56  2498.095 -87054.65 -287998.7 -122227.8 104835.5 178789.3
##                    90       103       134       152       169       174
## Predicted   631302.13  346447.9  421658.1 1400260.6 415903.60  694808.9
## cvpred      624337.08  347359.9  419127.5 1387069.9 413366.93  686776.2
## price_sold  705500.00  221500.0  294900.0 1600000.0 445000.00 1100000.0
## CV residual  81162.92 -125859.9 -124227.5  212930.1  31633.07  413223.8
##                   180      190       211       233       234       253
## Predicted   575898.67 506677.0 265751.55 394893.11 716073.23 926594.70
## cvpred      568874.56 498443.8 266577.49 392334.04 710333.87 911763.76
## price_sold  600000.00 780000.0 350000.00 465000.00 647800.00 950000.00
## CV residual  31125.44 281556.2  83422.51  72665.96 -62533.87  38236.24
##                   258       262       264       265       277       278
## Predicted   505640.66 238718.94 1090380.5 492511.39 213901.34  758094.2
## cvpred      498541.65 239516.07 1088562.8 491191.71 213536.69  752399.6
## price_sold  421500.00 275000.00  837500.0 407975.00 250000.00 1400000.0
## CV residual -77041.65  35483.93 -251062.8 -83216.71  36463.31  647600.4
##                   286       309       312       351       382      391
## Predicted   299936.88 1109889.1 557163.20  330414.7 545580.46 411085.9
## cvpred      301934.59 1088324.9 550119.12  331309.6 539659.35 408544.1
## price_sold  335000.00 1842700.0 630000.00  192500.0 480000.00 325000.0
## CV residual  33065.41  754375.1  79880.88 -138809.6 -59659.35 -83544.1
##                   396       403       414      425       461       469      472
## Predicted    511379.4  809825.0 628625.63 504495.6 247149.90 399710.80 628298.0
## cvpred       517125.2  799527.6 621657.73 502053.4 247956.02 397156.87 620194.4
## price_sold   300000.0 1306000.0 550000.00 900000.0 199000.00 375000.00 530230.0
## CV residual -217125.2  506472.4 -71657.73 397946.6 -48956.02 -22156.87 -89964.4
##                  475        481       493       516      518       522
## Predicted   528852.4 277126.652 368201.30 116462.46 396632.8  535885.1
## cvpred      522913.4 277964.728 368001.15 121787.26 394075.6  528818.3
## price_sold  769100.0 280000.000 279000.00 110111.00 545000.0  398000.0
## CV residual 246186.6   2035.272 -89001.15 -11676.26 150924.4 -130818.3
##                   529       535        540      541        544       549
## Predicted   303891.61 141293.85 385331.534 289097.1 349660.338  285156.1
## cvpred      304758.22 145509.81 381626.955 291083.2 347053.048  286002.8
## price_sold  218000.00 159000.00 390000.000 454500.0 340000.000  173000.0
## CV residual -86758.22  13490.19   8373.045 163416.8  -7053.048 -113002.8
##                    550       553       561       570       583       591
## Predicted   222526.145 390952.17  585801.0 335207.26  71169.67 251432.30
## cvpred      223306.011 387253.59  582310.2 332584.56  75310.87 252242.98
## price_sold  225000.000 465000.00 1050000.0 405000.00 111000.00 226000.00
## CV residual   1693.989  77746.41  467689.8  72415.44  35689.13 -26242.98
##                   613       628    629        631       636       653       660
## Predicted   252235.24 391681.32 480928 272770.453 416171.25 336813.16 255179.39
## cvpred      253046.78 389118.82 484254 274739.202 413634.87 334192.17 255994.07
## price_sold  340000.00 349900.00 640000 270000.000 383000.00 302000.00 220000.00
## CV residual  86953.22 -39218.82 155746  -4739.202 -30634.87 -32192.17 -35994.07
##                   662      669       679       701       706       707
## Predicted   446014.17 447753.9 88700.713 340560.25  277929.6 259387.98
## cvpred      443509.61 445251.2 92860.602 337943.26  278768.5 261342.46
## price_sold  355000.00 558650.0 95000.000 395000.00  120000.0 235000.00
## CV residual -88509.61 113398.8  2139.398  57056.74 -158768.5 -26342.46
##                   734       736       738       742       750       756
## Predicted   352945.94  405940.5 299342.22  99005.22 195225.89 203864.48
## cvpred      349206.83  402257.9 296681.29 103176.10 195976.65 203489.14
## price_sold  275000.00  238775.0 235000.00 171000.00 230000.00 230700.00
## CV residual -74206.83 -163482.9 -61681.29  67823.90  34023.35  27210.86
##                   762       768      770        781      782       803
## Predicted    298003.3  310122.0 249157.3 223924.411 116730.1 289974.49
## cvpred       298863.6  306337.3 249965.5 225841.086 122055.2 287303.57
## price_sold   157000.0  172950.0 510000.0 223000.000 210000.0 300000.00
## CV residual -141863.6 -133387.3 260034.5  -2841.086  87944.8  12696.43
##                   821       849       856       863       866       870
## Predicted   523900.85 236905.41 102544.68 291981.20 565727.99 349125.04
## cvpred      517956.62 238835.93 107854.65 292835.11 558693.03 346517.18
## price_sold  617000.00 195000.00 193500.00 330000.00 625000.00 280000.00
## CV residual  99043.38 -43835.93  85645.35  37164.89  66306.97 -66517.18
##                   883       904       915        921       949       976
## Predicted   344039.70 253499.69 163241.11  95391.952 240191.01 390878.37
## cvpred      341426.42 255447.89 167480.47  99558.974 240989.71 388315.02
## price_sold  257500.00 169000.00 214300.00 108000.000 227000.00 357000.00
## CV residual -83926.42 -86447.89  46819.53   8441.026 -13989.71 -31315.02
##                  982       984       985       988        991      1004
## Predicted   404930.0 188802.30  394759.3 227952.94 108700.622 155673.12
## cvpred      402381.6 189546.22  392200.1 227603.28 114017.152 161039.72
## price_sold  315000.0 145000.00  260000.0 276670.00 105000.000 135000.00
## CV residual -87381.6 -44546.22 -132200.1  49066.72  -9017.152 -26039.72
##                  1007     1013       1019      1024      1026      1042
## Predicted   258391.18 161368.2 389406.296 268294.22  185055.2  447680.1
## cvpred      259209.29 162082.9 386841.378 269122.88  185795.1  446312.6
## price_sold  222000.00 320150.0 385000.000 182850.00   81000.0  333500.0
## CV residual -37209.29 158067.1  -1841.378 -86272.88 -104795.1 -112812.6
##                 1054      1057      1061      1077      1079      1091
## Predicted   438192.3  83615.37  323162.4 198437.69 308040.83 184177.79
## cvpred      434544.1  87769.84  324049.5 199191.87 305389.17 189574.79
## price_sold  700000.0 180000.00  130500.0 175000.00 230000.00 272000.00
## CV residual 265455.9  92230.16 -193549.5 -24191.87 -75389.17  82425.21
##                   1100      1104      1151     1152     1167     1177      1182
## Predicted   453180.694 104344.42  370329.4 250421.7 262599.8 283357.1 173887.73
## cvpred      449548.448 110791.63  368879.4 252366.6 264557.7 279543.8 173480.43
## price_sold  445500.000 180000.00  246000.0 375000.0 385000.0 520000.0 245000.00
## CV residual  -4048.448  69208.37 -122879.4 122633.4 120442.3 240456.2  71519.57
##                  1200      1209      1210      1224     1229      1232
## Predicted   390952.17  377422.1 299489.84  330414.7 269900.1  328857.5
## cvpred      387253.59  375979.7 294558.42  331309.6 270730.5  325092.7
## price_sold  480000.00  152000.0 350000.00  151750.0 450000.0  145000.0
## CV residual  92746.41 -223979.7  55441.58 -179559.6 179269.5 -180092.7
##                  1239      1244      1269      1275      1285      1286
## Predicted   395709.85  404870.0 242332.21 223061.44  349224.0  315206.7
## cvpred      390881.01  401186.2 243133.19 223841.88  349003.6  314950.0
## price_sold  435000.00  295000.0 158000.00 182000.00  235000.0  160000.0
## CV residual  44118.99 -106186.2 -85133.19 -41841.88 -114003.6 -154950.0
##                     1287      1301      1323      1331      1337      1346
## Predicted   277989.61906 541638.87 276905.23  89965.15  476064.7  254450.2
## cvpred      279963.93263 538100.93 281149.03  95261.71  472456.9  254128.8
## price_sold  280000.00000 549000.00 300749.00 100000.00  285000.0  100000.0
## CV residual     36.06737  10899.07  19599.97   4738.29 -187456.9 -154128.8
##                  1352
## Predicted   435382.00
## cvpred      431730.78
## price_sold  467000.00
## CV residual  35269.22
## 
## Sum of squares = 3.370195e+12    Mean square = 24599961696    n = 137 
## 
## fold 8 
## Observations in test set: 136 
##                     1        10        13        35        63       64
## Predicted    336425.5 218511.40  585801.0  455261.9  632372.1 434846.7
## cvpred       337836.5 222861.49  576942.3  449887.2  620854.0 434607.7
## price_sold   214300.0 187000.00 1050000.0 1175000.0  470000.0 870000.0
## CV residual -123536.5 -35861.49  473057.7  725112.8 -150854.0 435392.3
##                    68      76       85        94       95       104       111
## Predicted   1063824.5 1151406 243402.8 2024775.9 624343.2 251833.77  294182.4
## cvpred      1051137.7 1137688 246331.6 1980509.3 625017.6 254281.09  298181.5
## price_sold   695000.0  900000 365000.0 2900000.0 875000.0 225000.00  122000.0
## CV residual -356137.7 -237688 118668.4  919490.7 249982.4 -29281.09 -176181.5
##                  117       121       133       138       144       157
## Predicted   734273.4  620730.0 272308.96  796710.2  718615.9  553014.0
## cvpred      732640.5  621610.7 273587.12  799276.1  717877.1  546027.4
## price_sold  849000.0  437000.0 290000.00  680000.0  555000.0  425000.0
## CV residual 116359.5 -184610.7  16412.88 -119276.1 -162877.1 -121027.4
##                   161      164      176       198      206       217       220
## Predicted    611094.6 275253.8 210481.9 251432.30 330644.1 418178.62 213633.69
## cvpred       612525.5 288097.7 215290.5 253902.54 359999.0 422861.34 214292.36
## price_sold   430000.0 485000.0 320000.0 242000.00 562200.0 465000.00 122000.00
## CV residual -182525.5 196902.3 104709.5 -11902.54 202201.0  42138.66 -92292.36
##                   227       243       244       273       280       295
## Predicted   425137.51 1105577.8 213633.69  775907.3 970414.10 414565.35
## cvpred      429422.86 1090506.9 214292.36  775691.2 951327.29 419454.39
## price_sold  515000.00 1937500.0 122000.00  620000.0 975000.00 385000.00
## CV residual  85577.14  846993.1 -92292.36 -155691.2  23672.71 -34454.39
##                  315       319       339       342        379       388
## Predicted   355354.8  842403.8  466697.0  603005.1 438519.987  668505.4
## cvpred      359654.9  834596.5  464639.3  600928.0 442041.178  666658.1
## price_sold  387500.0  483100.0  314500.0  380000.0 449900.000 1075000.0
## CV residual  27845.1 -351496.5 -150139.3 -220928.0   7858.822  408341.9
##                    412       428       431       435       439       449
## Predicted   186988.115  826598.7  88373.05 268829.52 262807.40  462756.1
## cvpred      185374.216  827633.8  84450.35 270306.35 264628.11  456953.5
## price_sold  183000.000  700000.0  55000.00 292900.00 207000.00  170000.0
## CV residual  -2374.216 -127633.8 -29450.35  22593.65 -57628.11 -286953.5
##                   470       473       482       487       489       494
## Predicted   399736.57  521030.5 277126.65  612299.0  620328.5  684029.1
## cvpred      405472.35  527604.2 278129.71  613661.1  621232.1  681295.3
## price_sold  312500.00  375000.0 280000.00  396000.0  350000.0  460000.0
## CV residual -92972.35 -152604.2   1870.29 -217661.1 -271232.1 -221295.3
##                   504       515       525       531        548      571
## Predicted   468155.28 116462.46 111510.94  553535.5 213352.254 660550.4
## cvpred      473954.19 118875.69 114206.91  554459.0 221966.873 666921.3
## price_sold  455000.00 110111.00 180000.00  405000.0 225000.000 900000.0
## CV residual -18954.19  -8764.69  65793.09 -149459.0   3033.127 233078.7
##                   578       579       590       594      598       600
## Predicted   545981.28  468496.7 356692.37  99259.08 257320.6  409420.0
## cvpred      543366.26  470306.2 349182.16 106624.59 259454.6  410632.9
## price_sold  487000.00  290000.0 270000.00 154000.00 229000.0  308500.0
## CV residual -56366.26 -180306.2 -79182.16  47375.41 -30454.6 -102132.9
##                   605       608       609       610       612       617
## Predicted   217708.45 231210.97  531007.4  496064.6 138617.35 148594.19
## cvpred      222104.39 242775.76  533041.4  496299.9 135795.56 141232.77
## price_sold  237500.00 229600.00  260000.0  360000.0 175000.00 188000.00
## CV residual  15395.61 -13175.76 -273041.4 -136299.9  39204.44  46767.23
##                   651        711       724       733       741       761
## Predicted   808084.65 220458.755 281409.04  415502.1 283357.06  480689.2
## cvpred      798267.11 220727.702 282167.57  420337.7 291768.36  485596.6
## price_sold  749900.00 218000.000 196250.00  190000.0 275000.00  282500.0
## CV residual -48367.11  -2727.702 -85917.57 -230337.7 -16768.36 -203096.6
##                 772       783       792       812       827       836      842
## Predicted    310122 192549.40 187389.59 199240.63  68553.19 270703.06 202720.1
## cvpred       317005 198381.95 185752.77 204691.11  73702.12 272072.92 207971.9
## price_sold   172950 127000.00 249900.00 197500.00 165000.00 187500.00 360000.0
## CV residual -144055 -71381.95  64147.23  -7191.11  91297.88 -84572.92 152028.1
##                   852       859       868       886       899       919
## Predicted   226882.34  365243.4 251967.59  413287.1  77325.61 130514.06
## cvpred      226784.49  365184.8 254407.28  422219.1  78003.68 132124.92
## price_sold  195000.00  120000.0 196000.00  125000.0  61000.00 185000.00
## CV residual -31784.49 -245184.8 -58407.28 -297219.1 -17003.68  52875.08
##                   929       936       938       943       945       973
## Predicted   100998.80  388663.4  276785.2  92641.65  245008.7 227878.48
## cvpred      108264.97  399001.4  281777.7  96415.09  247845.8 219959.73
## price_sold  191600.00  230000.0  110000.0 140000.00   79900.0 250000.00
## CV residual  83335.03 -169001.4 -171777.7  43584.91 -167945.8  30040.27
##                  974      981       983       995      1036         1043
## Predicted   165650.0 349065.0 516688.10 363651.92  251506.1 262406.58627
## cvpred      161284.6 353724.3 519539.84 367478.26  250002.2 275984.13669
## price_sold  322400.0 575000.0 487600.00 410000.00  147500.0 276000.00000
## CV residual 161115.4 221275.7 -31939.84  42521.74 -102502.2     15.86331
##                 1055      1058     1072     1083     1086      1101      1103
## Predicted   418545.8 230154.16 170929.1 241127.8 195345.3  288710.0 313734.62
## cvpred      419237.6 233839.42 170232.2 244186.4 197224.1  296815.7 308677.37
## price_sold  700000.0 155000.00 357000.0 415000.0 149000.0  105000.0 260000.00
## CV residual 280762.4 -78839.42 186767.8 170813.6 -48224.1 -191815.7 -48677.37
##                  1109      1120      1123      1132     1135      1137     1146
## Predicted   332069.27  78797.68 210883.39 243669.80 415709.8 277781.99 175211.5
## cvpred      337699.03  79391.69 215669.05 234849.35 416563.5 286687.51 174270.1
## price_sold  257000.00 200000.00 255000.00 150000.00 592000.0 187000.00 315000.0
## CV residual -80699.03 120608.31  39330.95 -84849.35 175436.5 -99687.51 140729.9
##                 1153      1158     1161      1175      1226      1233      1238
## Predicted   368395.8 118945.11 181991.0  356826.9 268561.87  328857.5 395709.85
## cvpred      375921.2 117246.64 180486.6  361042.9 270053.99  334670.6 393735.69
## price_sold  325000.0  96000.00 227000.0  235000.0 181900.00  145000.0 435000.00
## CV residual -50921.2 -21246.64  46513.4 -126042.9 -88153.99 -189670.6  41264.31
##                  1252      1253      1258      1259      1270      1283
## Predicted    257052.9  222258.5 524316.11 203255.38  440467.3 203716.87
## cvpred       259202.2  226394.6 526732.28 208476.61  439907.4 212881.69
## price_sold    50000.0   85000.0 590000.00 140000.00   42500.0 195000.00
## CV residual -209202.2 -141394.6  63267.72 -68476.61 -397407.4 -17881.69
##                  1290      1294      1306      1312     1320      1327
## Predicted   214035.17 215105.76  950147.9 256249.99 193753.8 213633.69
## cvpred      214670.91 215680.38  951716.2 258445.14 199517.6 214292.36
## price_sold  220000.00 150000.00  665000.0 214000.00 307000.0 122000.00
## CV residual   5329.09 -65680.38 -286716.2 -44445.14 107482.4 -92292.36
##                  1328      1332      1350      1361
## Predicted   213633.69 102217.02 323578.30 241796.91
## cvpred      214292.36 101473.74 325722.96 244817.36
## price_sold  122000.00 125000.00 290000.00 214000.00
## CV residual -92292.36  23526.26 -35722.96 -30817.36
## 
## Sum of squares = 5.225747e+12    Mean square = 38424612020    n = 136 
## 
## fold 9 
## Observations in test set: 136 
##                   16       37        39       50       71       92       93
## Predicted   181114.3 267625.1 214436.64 528852.4 315668.2 611227.8 160698.4
## cvpred      184518.9 268367.1 217822.46 520162.3 316383.1 609747.3 166143.2
## price_sold   90000.0 551900.0 185000.00 769100.0 500000.0 675000.0 445000.0
## CV residual -94518.9 283532.9 -32822.46 248937.7 183616.9  65252.7 278856.8
##                  98       109       110      118       126      128       131
## Predicted   1409228  437850.9 493314.34 412216.5  554011.4 303624.0  475054.2
## cvpred      1388727  433854.5 486672.87 405620.8  545307.1 304345.7  471036.8
## price_sold  2400000   67019.0 525000.00 629000.0   84123.0 490000.0   24000.0
## CV residual 1011273 -366835.5  38327.13 223379.2 -461184.1 185654.3 -447036.8
##                   153       159       184       223       228      231
## Predicted   959039.65  601057.7 210883.39 401524.33 327712.42 496867.6
## cvpred      948078.21  594940.7 211657.44 400162.22 328420.54 492837.9
## price_sold  975000.00  415500.0 285000.00 358000.00 250000.00 837679.0
## CV residual  26921.79 -179440.7  73342.56 -42162.22 -78420.54 344841.1
##                   282       283       287       289       293       326
## Predicted    901167.3 1437672.2  816783.3  294717.7  757707.2  500748.5
## cvpred       892852.3 1419769.7  810544.5  292830.7  749473.1  496716.6
## price_sold   565000.0 2350000.0  600000.0  178000.0 1125000.0  380000.0
## CV residual -327852.3  930230.3 -210544.5 -114830.7  375526.9 -116716.6
##                    353       355       358      362      365      373       383
## Predicted   239388.066  472852.9 458326.05 411487.4 216370.2 226273.2  427546.4
## cvpred      240146.028  471450.6 454318.11 407505.9 217141.2 227038.6  423555.8
## price_sold  238000.000  322000.0 485000.00 545000.0 320000.0 255500.0  255000.0
## CV residual  -2146.028 -149450.6  30681.89 137494.1 102858.8  28461.4 -168555.8
##                  384       393      405       410       424       427       443
## Predicted   368931.1 222332.30 529193.8  527186.5  652981.7  528063.2 300144.51
## cvpred      364973.6 225713.67 523117.3  521111.1  646835.4  524601.1 300868.19
## price_sold  300000.0 135000.00 460000.0  208980.0  499000.0  357500.0 215000.00
## CV residual -64973.6 -90713.67 -63117.3 -312131.1 -147835.4 -167101.1 -85868.19
##                   444       455       458       478       479      486      488
## Predicted   369198.10 346582.37  322032.4 200103.60  606946.0 495930.8 495930.8
## cvpred      369882.81 342637.48  320715.2 198269.95  600825.6 491901.6 491901.6
## price_sold  297000.00 325000.00  135000.0 174528.00  394500.0 685000.0 685000.0
## CV residual -72882.81 -17637.48 -185715.2 -23741.95 -206325.6 193098.4 193098.4
##                   491       502       508       524        534       537
## Predicted   508644.17 143361.24 419710.71  424408.4 434772.894 447158.58
## cvpred      504607.83 146201.97 413110.77  423033.3 430778.237 445770.71
## price_sold  431000.00 175000.00 440000.00  211973.0 440000.000 420000.00
## CV residual -73607.83  28798.03  26889.23 -211060.3   9221.763 -25770.71
##                    551       559       563       572      601       602
## Predicted   222526.145 1132937.4  451902.5  567333.9 253975.0 230154.16
## cvpred      223293.621 1123906.4  447898.1  561235.8 254724.7 230917.33
## price_sold  225000.000  545000.0  249900.0 1285000.0 195000.0 200000.00
## CV residual   1706.379 -578906.4 -197998.1  723764.2 -59724.7 -30917.33
##                    616      625       633       646       658       681
## Predicted   111450.924 189872.9  569742.7 120477.20  818657.5  68479.38
## cvpred      116923.444 190658.8  563643.3 123330.85  807775.2  68748.59
## price_sold  109500.000 245900.0  379000.0 208000.00 1432500.0 184000.00
## CV residual  -7423.444  55241.2 -184643.3  84669.15  624724.8 115251.41
##                  704       712       732      737       740       778       798
## Predicted   468482.9  583124.5 277394.30 277126.7  380927.3  447546.3 259863.26
## cvpred      459241.7  581660.0 278130.82 277863.3  374349.2  440930.6 260609.66
## price_sold  815000.0  155000.0 229900.00 655000.0  200000.0  300000.0 224000.00
## CV residual 355758.3 -426660.0 -48230.82 377136.7 -174349.2 -140930.6 -36609.66
##                   799       800       806       810       813       820
## Predicted    506101.5  434639.1  80329.77  387740.4 883027.18  216444.0
## cvpred       502066.6  430644.5  83206.07  386386.0 872108.63  219828.7
## price_sold   133000.0  310000.0 173900.00  263500.0 950000.00   80000.0
## CV residual -369066.6 -120644.5  90693.93 -122886.0  77891.37 -139828.7
##                   822        853     861      887       889       891
## Predicted    377361.4 229752.683  232623 331935.4 159434.66 335548.72
## cvpred       378041.5 230516.081  230771 330612.6 162851.52 334223.83
## price_sold   276000.0 230000.000   89000 235000.0 176500.00 283900.00
## CV residual -102041.5   -516.081 -141771 -95612.6  13648.48 -50323.83
##                    912       914          926       931       932       946
## Predicted   137546.755 100597.33 231820.07243  276784.5  189070.0 121547.80
## cvpred      143004.549 100848.41 229968.52418  279550.0  189856.3 124400.84
## price_sold  146000.000 175000.00 230000.00000  176000.0   79000.0 200000.00
## CV residual   2995.451  74151.59     31.47582 -103550.0 -110856.3  75599.16
##                  957      967       969       970      1006      1017     1021
## Predicted   364187.2 203255.4  452511.6 130647.89 120551.01  93712.25 247016.1
## cvpred      362846.2 204033.7  451120.7 133495.79 126018.39  96581.00 247769.7
## price_sold  510000.0 333000.0  232000.0 200000.00 159000.00 149900.00 467000.0
## CV residual 147153.8 128966.3 -219120.7  66504.21  32981.61  53319.00 219230.3
##                  1039     1045     1046       1051      1052      1053
## Predicted   269900.11 402728.8 103421.4 303550.151 237648.34  83615.37
## cvpred      270640.86 401366.0 108898.5 301658.126 238407.29  89103.60
## price_sold  351000.00 565000.0 325000.0 310000.000 275000.00 180000.00
## CV residual  80359.14 163634.0 216101.5   8341.874  36592.71  90896.40
##                  1076     1078      1088     1096      1098      1102      1118
## Predicted   410952.08 315728.2  270911.4 372410.5 108299.15 394893.11 215373.41
## cvpred      406970.87 313829.3  269622.9 368451.1 111159.67 390920.96 218758.71
## price_sold  475000.00 461814.0  147400.0 555000.0 140000.00 465000.00 235000.00
## CV residual  68029.13 147984.7 -122222.9 186548.9  28840.33  74079.04  16241.29
##                 1141      1147       1160     1162      1183      1194     1212
## Predicted   107570.0  422461.0 261092.786 238183.6  333527.6  279743.1 117339.2
## cvpred      113044.7  418473.3 266480.864 238942.3  326976.3  283092.1 122808.4
## price_sold  320000.0  290000.0 270000.000 339000.0   50013.0   13233.0 250000.0
## CV residual 206955.3 -128473.3   3519.136 100057.7 -276963.3 -269859.1 127191.6
##               1223     1227      1230      1242      1245      1248      1251
## Predicted   185516 180579.0 464630.27 349223.95  213426.1 109845.03 524316.11
## cvpred      188333 183983.9 461203.96 352533.71  214198.7 115318.45 520856.12
## price_sold  370000 197400.0 535000.00 385000.00   70000.0  27886.00 590000.00
## CV residual 181667  13416.1  73796.04  32466.29 -144198.7 -87432.45  69143.88
##                  1256      1257      1267     1273      1281      1288
## Predicted   313854.66 524316.11 576240.13 271699.9 225664.13  241870.7
## cvpred      311956.82 520856.12 572750.84 269825.8 223816.06  245241.1
## price_sold  350000.00 590000.00 560200.00 200000.0 168000.00  109000.0
## CV residual  38043.18  69143.88 -12550.84 -69825.8 -55816.06 -136241.1
##                  1298     1309      1330      1342       1355      1357
## Predicted    381658.9 325838.9 256249.99 447158.58 245082.513 302285.71
## cvpred       378279.4 326548.0 256998.43 445770.71 248451.041 303008.18
## price_sold  1059162.0 516116.0 214000.00 425500.00 245000.000 280000.00
## CV residual  680882.6 189568.0 -42998.43 -20270.71  -3451.041 -23008.18
## 
## Sum of squares = 7.027044e+12    Mean square = 51669442529    n = 136 
## 
## fold 10 
## Observations in test set: 136 
##                     2         3         6        14        15        30
## Predicted   294330.03 83347.722  462756.1 161308.21 161308.21 83347.722
## cvpred      297522.36 87693.857  464942.8 164963.84 164963.84 87693.857
## price_sold  339900.00 90000.000  170000.0 179000.00 200000.00 90000.000
## CV residual  42377.64  2306.143 -294942.8  14036.16  35036.16  2306.143
##                   40        46       49        66       67      72        97
## Predicted   230094.1 318225.30 309854.4 326641.82 377689.1  791431 469058.46
## cvpred      233510.2 320915.44 310869.6 328017.56 377183.0  788227 465692.11
## price_sold  353000.0 250000.00 285000.0 392875.00 520000.0  540000 525000.00
## CV residual 119489.8 -70915.44 -25869.6  64857.44 142817.0 -248227  59307.89
##                   101       113       116       119       123        124
## Predicted   351132.41  324039.8  421658.1  345644.9  348931.2 382313.583
## cvpred      350299.82  325005.6  420579.8  346954.5  349810.3 381372.391
## price_sold  450000.00  205000.0   63497.0   55605.0  223000.0 382750.000
## CV residual  99700.18 -120005.6 -357082.8 -291349.5 -126810.3   1377.609
##                   129       132       143       147       150       170
## Predicted    301750.4  592953.8 396231.36 235580.95  330414.7 107094.73
## cvpred       303212.8  591278.9 395241.69 238977.91  331777.3 109654.09
## price_sold   167500.0  390000.0 355000.00 325000.00  193000.0  93765.00
## CV residual -135712.8 -201278.9 -40241.69  86022.09 -138777.3 -15889.09
##                   171       179       185        186      196       202
## Predicted    815519.5  292175.0 191137.34 338686.048 280948.2  474459.5
## cvpred       812231.5  291966.8 191280.97 340019.837 282064.1  472778.4
## price_sold   528400.0  108500.0 279000.00 350000.000 515000.0  297000.0
## CV residual -283831.5 -183466.8  87719.03   9980.163 232935.9 -175778.4
##                   226       236       255       266       270      274
## Predicted   750674.48 1311756.8  530665.2 345184.10  259388.0 509714.8
## cvpred      745908.33 1305902.6  530911.4 346076.29  259293.9 508329.9
## price_sold  792000.00 1900000.0  170000.0 276000.00  140000.0 983750.0
## CV residual  46091.67  594097.4 -360911.4 -70076.29 -119293.9 475420.1
##                   292       299      305       324       327       357
## Predicted    606946.0  355963.9 715552.4 110768.01 237380.69 240592.49
## cvpred       604803.5  358522.6 712612.6 111610.53 239067.32 242267.93
## price_sold   325500.0  224000.0 728000.0 202500.00 225000.00 269300.00
## CV residual -279303.5 -134522.6  15387.4  90889.47 -14067.32  27032.07
##                   364       366       402       422       438      456      483
## Predicted   739567.03  877807.4  809825.0  652981.7  197098.8 790747.4 357689.8
## cvpred      734839.56  874721.4  804852.9  650678.9  201048.7 786260.7 356834.4
## price_sold  800000.00 1425000.0 1305000.0  499000.0   50000.0 980000.0 500000.0
## CV residual  65160.44  550278.6  500147.1 -151678.9 -151048.7 193739.3 143165.6
##                   498       503       513       520      536       543      547
## Predicted    588210.5 406743.50  403993.2 204385.99 454980.4 438118.51 289097.1
## cvpred       586133.3 407421.28  402976.5 204483.48 453786.2 436982.96 288899.5
## price_sold   415000.0 325000.00  168000.0 265000.00 555000.0 407500.00 454500.0
## CV residual -171133.3 -82421.28 -234976.5  60516.52 101213.8 -29482.96 165600.5
##                 560      577       621       640       641       659       661
## Predicted    422461 471515.3 353942.07 243864.30  510859.8  818657.5  95391.95
## cvpred       421380 469844.5 355222.73 243824.29  509052.0  813654.5  99696.14
## price_sold   290000 717000.0 435000.00 160100.00  350000.0 1430000.0 173000.00
## CV residual -131380 247155.5  79777.27 -83724.29 -159052.0  616345.5  73303.86
##                   670       687       692       693       698        714
## Predicted   145770.08 245008.71  416512.7 464943.49 225068.82 253841.142
## cvpred      148194.75 246668.76  417156.5 462010.45 226798.32 255470.436
## price_sold  248000.00 259900.00  161975.0 415000.00 318900.00 262000.000
## CV residual  99805.25  13231.24 -255181.5 -47010.45  92101.68   6529.564
##                   721       725       728       746       748       779
## Predicted    230154.2 271104.54  72374.09  725307.1 453776.01  91095.77
## cvpred       231866.0 272673.71  76758.44  721048.3 452585.92  92006.80
## price_sold    97000.0 286000.00 200100.00 1025000.0 395000.00 104900.00
## CV residual -134866.0  13326.29 123341.56  303951.7 -57585.92  12893.20
##                   815       819       823       825        828      832
## Predicted    573354.7  648953.2 395696.06 280873.75 216102.556 270094.0
## cvpred       575575.2  643256.3 394708.26 282408.89 217863.289 269962.6
## price_sold   300000.0  385000.0 360000.00 255000.00 220000.000 450000.0
## CV residual -275575.2 -258256.3 -34708.26 -27408.89   2136.711 180037.4
##                  833      840       845       855       862       875       882
## Predicted   299876.9 161159.9 195225.89 347592.95 218109.93  70292.91 407814.76
## cvpred      301345.8 163531.0 197059.34 348476.74 219863.67  72980.46 406365.77
## price_sold  589000.0 125000.0 220000.00 365000.00 202000.00 155100.00 430000.00
## CV residual 287654.2 -38531.0  22940.66  16523.26 -17863.67  82119.54  23634.23
##                   909      918      937       941       942       947       953
## Predicted   260933.85 366582.3 202987.7 268428.70 276785.20 209678.97 395696.06
## cvpred      262538.45 363991.8 204794.1 267884.16 276630.52 211462.07 394708.26
## price_sold  290000.00 584900.0 360000.0 320500.00 192000.00 200000.00 360000.00
## CV residual  27461.55 220908.2 155205.9  52615.84 -84630.52 -11462.07 -34708.26
##                   962      966         972      979       987       997
## Predicted   169397.71 245008.7 192014.0967 269498.6 304025.43  295059.2
## cvpred      171321.11 246668.8 193858.7271 271073.4 305479.94  296544.9
## price_sold  202000.00 500000.0 194000.0000 384000.0 250000.00  164000.0
## CV residual  30678.89 253331.2    141.2729 112926.6 -55479.94 -132544.9
##                  1000     1009     1020      1027      1040      1048      1062
## Predicted   134201.14 399517.0 141889.2  185055.2  445285.0 379101.79  323162.4
## cvpred      138370.15 400219.9 144327.3  186924.1  445828.6 378171.78  324550.2
## price_sold   91000.00 560000.0 457500.0   71050.0  305000.0 319900.00  130500.0
## CV residual -47370.15 159780.1 313172.7 -115874.1 -140828.6 -58271.78 -194050.2
##                 1068      1073      1106      1112      1129      1130
## Predicted   354819.5 240592.49  335816.4  73906.18 206942.45 206942.45
## cvpred      355678.1 242267.93  336741.2  76581.14 210439.15 210439.15
## price_sold  690000.0 190000.00  190600.0  32000.00 180000.00 180000.00
## CV residual 334321.9 -52267.93 -146141.2 -44581.14 -30439.15 -30439.15
##                  1149      1155      1156      1172      1193      1201
## Predicted   241053.98  396263.1 489374.06 90708.085  275520.8 472377.65
## cvpred      241023.75  388876.1 485936.96 95028.584  277074.5 471122.78
## price_sold  282000.00  253000.0 402000.00 90000.000   67000.0 560000.00
## CV residual  40976.25 -135876.1 -83936.96 -5028.584 -210074.5  88877.22
##                  1203      1216      1221     1231     1246      1250      1261
## Predicted   425137.51 270168.42  543050.9 483974.8 236370.1  203329.2 221261.70
## cvpred      424047.17 269617.82  544958.0 485668.7 236356.2  206838.5 224708.53
## price_sold  389000.00 339000.00  110000.0 750000.0 372000.0   10000.0 275000.00
## CV residual -35047.17  69382.18 -434958.0 264331.3 135643.8 -196838.5  50291.47
##                  1262      1289      1295      1311      1329      1338
## Predicted    355816.3  304011.6  523840.8 256249.99 256249.99  312872.3
## cvpred       354967.4  302058.1  521987.7 257870.89 257870.89  315581.1
## price_sold    85000.0  165000.0  370000.0 214000.00 214000.00  190000.0
## CV residual -269967.4 -137058.1 -151987.7 -43870.89 -43870.89 -125581.1
##                  1344      1363
## Predicted   254450.25  289780.6
## cvpred      257781.48  290865.8
## price_sold  223000.00  170000.0
## CV residual -34781.48 -120865.8
## 
## Sum of squares = 4.442851e+12    Mean square = 32668019244    n = 136 
## 
## Overall (Sum over all 136 folds) 
##          ms 
## 32665358834
# MSPE 
n3 = dim(clean_housing)[1]
MSPE3 <- sum((clean_housing$price_sold - KCV3$cvpred)^2) / n3
MSPE3
## [1] 32665358834
# Press Statistic
PRESS3 <- sum((clean_housing$price_sold - KCV3$cvpred)^2)
PRESS3
## [1] 4.462088e+13
# Prediction R-Squared
PRS3 <- 1 - sum((clean_housing$price_sold - KCV3$cvpred)^2) / sum((clean_housing$price_sold - 
                                                               mean(clean_housing$price_sold))^2)
PRS3
## [1] 0.6187797

Comparing predicted R-Squared for each model

When comparing each of the models below, we see that model 3 has the highest predicted r-squared. This isn’t surprising considering model 3 was selected using the adjusted r-squared during variable selection and is utilizing our cleaned data that contains no outliers.

Our models ability to make predictions shows similar results to our models traditional r-squared that we utilized to predict the goodness of fit of each model excluding model 2 which has a much lower predicted r-squared value.

# Model 1
PRS1
## [1] 0.5105264
summary(housing_model1)$adj.r.squared
## [1] 0.5343469
# Model 2
PRS2
## [1] 0.6187243
summary(housing_model2)$adj.r.squared
## [1] 0.623373
# Model 3
PRS3
## [1] 0.6187797
summary(housing_model3)$adj.r.squared
## [1] 0.6228366

Conclusion

Despite finding that housing_model3 was the strongest, the overall results are not ideal. Having a higher ability to predict new observations and explain the variability in our model would make it more reliable and a stronger predictor of future observations. However, from housing_model3, square footage of a house is the number one predictor of price with number of bedrooms and number of bathrooms following as number two and three, respectively. It was also found that lot size, house age, and number of parking spaces have little influence on house prices. One recommendation from these findings to drive the best value for buyers would be to search for houses that have a larger lot size and smaller square footage. Taking this approach will keep housing prices lower but will provide the property space needed to expand on the existing home. This expansion would not only drive up the value of the home by increasing the square footage but would allow for a reduction in the amount spent on purchasing the house.

For future analysis, there are a few key changes that would help improve the model creation and predictability of the housing market. The first would be to narrow the scope of the dataset. If a specific buyer type or price range is chosen, the ability to predict costs may increase. For example, houses sold for $7 million are outside of the “typical” buyer and create noise in a model. If the typical buyer is the focus, the data collection process may yield better results. Second, increasing the sample size provides more information to work with that will in turn produce better, more accurate models. The last recommendation, which is the most important, is data quality. During the cleaning process many mistakes and duplicate values were found in the data. While corrected, it is not guaranteed that all mistakes will be caught. Finding ways to source better data, perhaps through established organizations who store that data, may help drive better quality data and in turn better models.