# install packages
library(corrplot)
## corrplot 0.92 loaded
library(ggplot2)
library(reshape2)
library(liver)
## 
## Attaching package: 'liver'
## The following object is masked from 'package:base':
## 
##     transform
library(tidyr)
## 
## Attaching package: 'tidyr'
## The following object is masked from 'package:reshape2':
## 
##     smiths
library(leaps)
library(GGally)
## Registered S3 method overwritten by 'GGally':
##   method from   
##   +.gg   ggplot2
#read data
data <- data(house)
# Check our NA
length(which(is.na(house), arr.ind=TRUE))
## [1] 0

EDA

summary(house)
##    house.age      distance.to.MRT   stores.number       latitude    
##  Min.   : 0.000   Min.   :  23.38   Min.   : 0.000   Min.   :24.93  
##  1st Qu.: 9.025   1st Qu.: 289.32   1st Qu.: 1.000   1st Qu.:24.96  
##  Median :16.100   Median : 492.23   Median : 4.000   Median :24.97  
##  Mean   :17.713   Mean   :1083.89   Mean   : 4.094   Mean   :24.97  
##  3rd Qu.:28.150   3rd Qu.:1454.28   3rd Qu.: 6.000   3rd Qu.:24.98  
##  Max.   :43.800   Max.   :6488.02   Max.   :10.000   Max.   :25.01  
##    longitude       unit.price    
##  Min.   :121.5   Min.   :  7.60  
##  1st Qu.:121.5   1st Qu.: 27.70  
##  Median :121.5   Median : 38.45  
##  Mean   :121.5   Mean   : 37.98  
##  3rd Qu.:121.5   3rd Qu.: 46.60  
##  Max.   :121.6   Max.   :117.50
# Example data frame structure
library(leaflet)

# Create a leaflet map
map <- leaflet(data = house) %>%
  addTiles()  # You can choose different tilesets with addProviderTiles() if desired

# Add markers to the map based on latitude and longitude
map <- map %>% addMarkers(
  lat = ~latitude,
  lng = ~longitude,
  label = ~unit.price,
  popup = ~paste("Median House Price: $", unit.price),
  clusterOptions = markerClusterOptions()
)

# Display the map
map
# Boxplots for each varaible
boxplot(house$house.age)

boxplot(house$distance.to.MRT)

boxplot(house$stores.number)

boxplot(house$latitude)

boxplot(house$longitude)

boxplot(house$unit.price, main="Box Plot of Unit Price")

library(ggplot2)

# Create a list of plots
plots <- list()

# Loop through each numeric variable and create a density plot with a line
for (i in 1:ncol(house)) {
  p <- ggplot(house, aes(x = house[, i])) +
    geom_density(color = "blue") +
    labs(title = colnames(house)[i], x = "Value", y = "Density")
  plots[[i]] <- p
}

# Print the plots one by one
for (i in 1:ncol(house)) {
  print(plots[[i]])
}

#Correlation matrix
correlation_matrix <- cor(house)
corrplot(correlation_matrix)

hist(house$unit.price, main="Distribution of Unit Price", xlab="Unit Price")

library(car)
## Loading required package: carData
symbox(house$unit.price, ylab = "unit price", main = "Boxplots for Each Transformations of Unit Price")

transprice <- (house$unit.price)^0.5
hist(transprice, ylab = "unit price", main="Distribution of Unit Price in Square root Transformation", xlab="Unit Price")

names(house)
## [1] "house.age"       "distance.to.MRT" "stores.number"   "latitude"       
## [5] "longitude"       "unit.price"

EDA: Check Assumption

pairs(house)

ggpairs( house )

Model:

\[ Y_{unit.price} = -580.5 -0.02*X_{house.age} -0.0004*X_{distance.to.MRT} + 0.09*X_{stores.number} + 21.83*X_{latitude}+0.365*X_{longitude}\]

model1 <- lm(unit.price^0.5 ~., data=house)
summary(model1)
## 
## Call:
## lm(formula = unit.price^0.5 ~ ., data = house)
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -3.6426 -0.3926 -0.0687  0.3552  4.4799 
## 
## Coefficients:
##                   Estimate Std. Error t value Pr(>|t|)    
## (Intercept)     -5.805e+02  4.706e+02  -1.233    0.218    
## house.age       -2.132e-02  2.955e-03  -7.216 2.63e-12 ***
## distance.to.MRT -3.782e-04  5.481e-05  -6.900 1.99e-11 ***
## stores.number    9.132e-02  1.441e-02   6.336 6.25e-10 ***
## latitude         2.183e+01  3.406e+00   6.409 4.05e-10 ***
## longitude        3.446e-01  3.724e+00   0.093    0.926    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 0.6793 on 408 degrees of freedom
## Multiple R-squared:  0.6381, Adjusted R-squared:  0.6337 
## F-statistic: 143.9 on 5 and 408 DF,  p-value: < 2.2e-16
plot(model1)

s = summary(model1)
data.frame(s$coefficients)
##                      Estimate   Std..Error     t.value     Pr...t..
## (Intercept)     -5.804553e+02 4.706491e+02 -1.23330794 2.181710e-01
## house.age       -2.132262e-02 2.954890e-03 -7.21604710 2.629399e-12
## distance.to.MRT -3.782137e-04 5.481049e-05 -6.90038863 1.989437e-11
## stores.number    9.132277e-02 1.441392e-02  6.33573470 6.252533e-10
## latitude         2.182880e+01 3.405926e+00  6.40906402 4.047266e-10
## longitude        3.446381e-01 3.724248e+00  0.09253897 9.263153e-01
s$r.squared
## [1] 0.6381435

Remove Outliers

#Outliers location
outliers <- rstandard(model1)[rstandard(model1) < -2 | rstandard(model1) > 2] #leverage plot
matrix <- as.matrix(outliers)
rownames <- rownames(matrix)
levoutlier<-as.numeric(rownames)
length(levoutlier)
## [1] 20
outliersmore <- which(model1$fitted.values < 4.5) #residual plot
mat <- as.matrix(outliersmore)
row <- rownames(mat)
resoutlier<-as.numeric(row)
length(resoutlier)
## [1] 36
outliers <- union(levoutlier, resoutlier)
length(outliers)
## [1] 53
#New data set without the outliers
data_no_outlier <- house[-outliers,]
model2 <- lm(unit.price^0.5 ~., data=data_no_outlier)
summary(model2)
## 
## Call:
## lm(formula = unit.price^0.5 ~ ., data = data_no_outlier)
## 
## Residuals:
##      Min       1Q   Median       3Q      Max 
## -1.25287 -0.28715  0.00386  0.28657  1.66668 
## 
## Coefficients:
##                   Estimate Std. Error t value Pr(>|t|)    
## (Intercept)     -1.159e+03  3.240e+02  -3.576 0.000397 ***
## house.age       -2.896e-02  2.101e-03 -13.781  < 2e-16 ***
## distance.to.MRT -5.908e-04  4.583e-05 -12.891  < 2e-16 ***
## stores.number    6.768e-02  1.035e-02   6.539 2.16e-10 ***
## latitude         2.966e+01  2.496e+00  11.884  < 2e-16 ***
## longitude        3.496e+00  2.547e+00   1.373 0.170742    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 0.455 on 355 degrees of freedom
## Multiple R-squared:  0.7455, Adjusted R-squared:  0.7419 
## F-statistic:   208 on 5 and 355 DF,  p-value: < 2.2e-16
plot(model2)

# Perform the Durbin-Watson test
library(car)
d = durbinWatsonTest(model2)
d
##  lag Autocorrelation D-W Statistic p-value
##    1     -0.01887703      2.024025   0.826
##  Alternative hypothesis: rho != 0
s2 <- summary(model2)
data.frame(s2$coefficients)
##                      Estimate   Std..Error    t.value     Pr...t..
## (Intercept)     -1.158639e+03 3.239736e+02  -3.576339 3.967260e-04
## house.age       -2.895541e-02 2.101116e-03 -13.780967 6.611972e-35
## distance.to.MRT -5.908531e-04 4.583443e-05 -12.891031 1.873129e-31
## stores.number    6.768070e-02 1.034982e-02   6.539313 2.155294e-10
## latitude         2.966045e+01 2.495818e+00  11.884060 1.196885e-27
## longitude        3.495557e+00 2.546659e+00   1.372605 1.707416e-01

\[ Y^{0.5}_{unit.price} = -1158.639 -0.029*X_{house.age} -0.0006*X_{distance.to.MRT} + 0.067*X_{stores.number} + 29.66*X_{latitude}+3.49*X_{longitude}\]

Homoscedasticity:

residuals <- model2$residuals
ggplot(data = data.frame(residuals = residuals), aes(x = fitted(model2), y = residuals)) +
  geom_point() +
  geom_smooth(method = "loess", se = FALSE, color = "blue") +
  labs(title = "Residuals vs. Fitted Values", x = "Fitted Values", y = "Residuals")
## `geom_smooth()` using formula = 'y ~ x'

qqnorm(residuals)

# QQ-plot
qqnorm(residuals)
qqline(residuals)

# Shapiro-Wilk test
shapiro.test(residuals)
## 
##  Shapiro-Wilk normality test
## 
## data:  residuals
## W = 0.99652, p-value = 0.6245

The p-value is greater than significance level, so fail to reject the null hypothesis, meaning that there is strong evidence to suggest normality.

Multicollinearity:

vif(model2)
##       house.age distance.to.MRT   stores.number        latitude       longitude 
##        1.012439        1.963795        1.479819        1.131224        1.443359
vif(model1)
##       house.age distance.to.MRT   stores.number        latitude       longitude 
##        1.014249        4.282985        1.613339        1.599017        2.923881

Model Selection:

p=5
models =regsubsets(unit.price^0.5~., data =data_no_outlier, nvmax =p)
summary(models)
## Subset selection object
## Call: regsubsets.formula(unit.price^0.5 ~ ., data = data_no_outlier, 
##     nvmax = p)
## 5 Variables  (and intercept)
##                 Forced in Forced out
## house.age           FALSE      FALSE
## distance.to.MRT     FALSE      FALSE
## stores.number       FALSE      FALSE
## latitude            FALSE      FALSE
## longitude           FALSE      FALSE
## 1 subsets of each size up to 5
## Selection Algorithm: exhaustive
##          house.age distance.to.MRT stores.number latitude longitude
## 1  ( 1 ) " "       "*"             " "           " "      " "      
## 2  ( 1 ) "*"       "*"             " "           " "      " "      
## 3  ( 1 ) "*"       "*"             " "           "*"      " "      
## 4  ( 1 ) "*"       "*"             "*"           "*"      " "      
## 5  ( 1 ) "*"       "*"             "*"           "*"      "*"
modelss <- summary(models)
data.frame(modelss$outmat)
##          house.age distance.to.MRT stores.number latitude longitude
## 1  ( 1 )                         *                                 
## 2  ( 1 )         *               *                                 
## 3  ( 1 )         *               *                      *          
## 4  ( 1 )         *               *             *        *          
## 5  ( 1 )         *               *             *        *         *
m1 <- lm(unit.price^0.5~distance.to.MRT, data =data_no_outlier)
m2 <- lm(unit.price^0.5~house.age+distance.to.MRT, data =data_no_outlier)
m3 <- lm(unit.price^0.5~house.age+distance.to.MRT+latitude, data =data_no_outlier)
m4 <- lm(unit.price^0.5~house.age+distance.to.MRT+stores.number+latitude, data=data_no_outlier)
m5 <- lm(unit.price^0.5~house.age+distance.to.MRT+stores.number+latitude+longitude, data =data_no_outlier)
# Create a vector of model names
model_names <- c("m1", "m2", "m3", "m4", "m5")

# Create an empty data frame to store AIC values
aic_data <- data.frame(Model = character(length(model_names)), AIC = numeric(length(model_names)))

# Calculate and store AIC values for each model
for (i in 1:length(model_names)) {
  model <- get(model_names[i])  # Get the model by name
  aic_value <- AIC(model)
  aic_data[i, ] <- c(model_names[i], aic_value)
}

# Display the table of AIC values
print(aic_data)
##   Model              AIC
## 1    m1 714.114574310383
## 2    m2 627.925936238496
## 3    m3  502.27481418991
## 4    m4 463.809226197423
## 5    m5 463.898403702297
result.sum = summary(models)
criteria <- data.frame(Nvar = 1:(p),
                       R2 = result.sum$rsq,
                       R2adj = result.sum$adjr2,
                       CP = result.sum$cp,
                       BIC = result.sum$bic)
criteria <- cbind(criteria, AIC = as.numeric(aic_data$AIC))
print(criteria)
##   Nvar        R2     R2adj         CP       BIC      AIC
## 1    1 0.4796386 0.4781891 368.889675 -224.0389 714.1146
## 2    2 0.5924215 0.5901445 213.560759 -306.3387 627.9259
## 3    3 0.7138176 0.7114127  46.216537 -428.1009 502.2748
## 4    4 0.7441641 0.7412895   5.884046 -462.6776 463.8092
## 5    5 0.7455146 0.7419303   6.000000 -458.6996 463.8984
ggplot(data = criteria, aes(x = Nvar)) +
  geom_line(aes(y = R2), color = "red") +
  labs(title = "R2")

ggplot(data = criteria, aes(x = Nvar)) +
  geom_line(aes(y = R2adj), color = "green") +
  labs(title = "R2adj")

ggplot(data = criteria, aes(x = Nvar)) +
  geom_line(aes(y = CP), color = "purple") +
  labs(title = "CP")

ggplot(data = criteria, aes(x = Nvar)) +
  geom_line(aes(y = BIC), color = "orange") +
  labs(title = "BIC")

ggplot(data = criteria, aes(x = Nvar)) +
  geom_line(aes(y = AIC), color = "blue") +
  labs(title = "AIC")

##Estimated best subset by each criterion > 
which.best.subset = data.frame(R2 = which.max(result.sum$rsq),
                               R2adj = which.max(result.sum$adjr2), 
                               CP = which.min(result.sum$cp),
                               BIC = which.min(result.sum$bic),
                               AIC = which.min(criteria$AIC))
which.best.subset
##   R2 R2adj CP BIC AIC
## 1  5     5  4   4   4
model3 <- lm(unit.price^0.5 ~ house.age+ distance.to.MRT+ stores.number+ latitude, data=data_no_outlier)
summary(model3)
## 
## Call:
## lm(formula = unit.price^0.5 ~ house.age + distance.to.MRT + stores.number + 
##     latitude, data = data_no_outlier)
## 
## Residuals:
##      Min       1Q   Median       3Q      Max 
## -1.28420 -0.28787 -0.00941  0.28640  1.67750 
## 
## Coefficients:
##                   Estimate Std. Error t value Pr(>|t|)    
## (Intercept)     -7.221e+02  6.181e+01 -11.682  < 2e-16 ***
## house.age       -2.900e-02  2.103e-03 -13.788  < 2e-16 ***
## distance.to.MRT -6.225e-04  3.967e-05 -15.694  < 2e-16 ***
## stores.number    6.732e-02  1.036e-02   6.498 2.74e-10 ***
## latitude         2.919e+01  2.476e+00  11.793  < 2e-16 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 0.4556 on 356 degrees of freedom
## Multiple R-squared:  0.7442, Adjusted R-squared:  0.7413 
## F-statistic: 258.9 on 4 and 356 DF,  p-value: < 2.2e-16
s3 <- summary(model3)
data.frame(s3$coefficients)
##                      Estimate   Std..Error    t.value     Pr...t..
## (Intercept)     -7.220997e+02 6.181090e+01 -11.682399 6.525818e-27
## house.age       -2.900191e-02 2.103449e-03 -13.787784 5.970874e-35
## distance.to.MRT -6.224931e-04 3.966536e-05 -15.693619 1.482819e-42
## stores.number    6.731745e-02 1.035927e-02   6.498279 2.742849e-10
## latitude         2.919293e+01 2.475535e+00  11.792573 2.551752e-27

stepwise selection

#backward stepwise selection

Full = lm(unit.price^0.5~., data =data_no_outlier) #includes all predictors
backward = step(Full, direction='backward', scope=formula(Full), trace=0)
backward$anova
##          Step Df  Deviance Resid. Df Resid. Dev       AIC
## 1             NA        NA       355   73.49790 -562.5752
## 2 - longitude  1 0.3900659       356   73.88797 -562.6644

#Forward stepwise selection

Empty =lm(unit.price^0.5 ~ 1, data=data_no_outlier) # 1 means only intercept
forward =step(Empty, direction='forward', scope=formula(Full), trace=0) #results of forward selection
forward$anova
##                Step Df   Deviance Resid. Df Resid. Dev        AIC
## 1                   NA         NA       360  288.80995  -78.54238
## 2 + distance.to.MRT -1 138.524406       359  150.28554 -312.35905
## 3       + house.age -1  32.572803       358  117.71274 -398.54768
## 4        + latitude -1  35.060409       357   82.65233 -524.19881
## 5   + stores.number -1   8.764364       356   73.88797 -562.66439
model3 <- lm(unit.price^0.5 ~ house.age+ distance.to.MRT+ stores.number+ latitude, data=data_no_outlier)
summary(model3)
## 
## Call:
## lm(formula = unit.price^0.5 ~ house.age + distance.to.MRT + stores.number + 
##     latitude, data = data_no_outlier)
## 
## Residuals:
##      Min       1Q   Median       3Q      Max 
## -1.28420 -0.28787 -0.00941  0.28640  1.67750 
## 
## Coefficients:
##                   Estimate Std. Error t value Pr(>|t|)    
## (Intercept)     -7.221e+02  6.181e+01 -11.682  < 2e-16 ***
## house.age       -2.900e-02  2.103e-03 -13.788  < 2e-16 ***
## distance.to.MRT -6.225e-04  3.967e-05 -15.694  < 2e-16 ***
## stores.number    6.732e-02  1.036e-02   6.498 2.74e-10 ***
## latitude         2.919e+01  2.476e+00  11.793  < 2e-16 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 0.4556 on 356 degrees of freedom
## Multiple R-squared:  0.7442, Adjusted R-squared:  0.7413 
## F-statistic: 258.9 on 4 and 356 DF,  p-value: < 2.2e-16
model3$coefficients
##     (Intercept)       house.age distance.to.MRT   stores.number        latitude 
##   -7.220997e+02   -2.900191e-02   -6.224931e-04    6.731745e-02    2.919293e+01

Final Model

\[ Y_{unit.price} = -722.1 -0.029*X_{house.age} - 0.0006*X_{distance.to.MRT} + 0.067*X_{stores.number} + 29.19*X_{latitude}\]

library(caret)
## Loading required package: lattice
library(lattice)
train_control<- trainControl(method="cv", number= 5, savePredictions = TRUE) 
model<- train(unit.price^0.5 ~ house.age+ distance.to.MRT+ stores.number+ latitude, data=data_no_outlier, trControl=train_control, method="lm")
print(model)
## Linear Regression 
## 
## 361 samples
##   4 predictor
## 
## No pre-processing
## Resampling: Cross-Validated (5 fold) 
## Summary of sample sizes: 289, 289, 289, 288, 289 
## Resampling results:
## 
##   RMSE       Rsquared   MAE      
##   0.4551404  0.7445673  0.3613449
## 
## Tuning parameter 'intercept' was held constant at a value of TRUE
model$pred
##         pred      obs rowIndex intercept Resample
## 1   5.368099 4.701064        9      TRUE    Fold1
## 2   5.735804 6.434283       10      TRUE    Fold1
## 3   4.776349 4.878524       13      TRUE    Fold1
## 4   6.324422 6.115554       17      TRUE    Fold1
## 5   7.196188 6.906519       19      TRUE    Fold1
## 6   6.992344 7.183314       21      TRUE    Fold1
## 7   6.311095 5.796551       27      TRUE    Fold1
## 8   5.594921 5.848077       30      TRUE    Fold1
## 9   5.231551 5.224940       33      TRUE    Fold1
## 10  6.252754 6.473021       49      TRUE    Fold1
## 11  6.827481 7.314369       50      TRUE    Fold1
## 12  5.523318 5.029911       56      TRUE    Fold1
## 13  6.318601 6.655825       57      TRUE    Fold1
## 14  5.821804 6.066300       67      TRUE    Fold1
## 15  6.763571 6.935416       73      TRUE    Fold1
## 16  6.168882 6.928203       78      TRUE    Fold1
## 17  5.775836 6.403124       83      TRUE    Fold1
## 18  6.733428 6.760178       92      TRUE    Fold1
## 19  7.282853 8.426150       94      TRUE    Fold1
## 20  6.786781 7.183314       99      TRUE    Fold1
## 21  5.216700 4.806246      101      TRUE    Fold1
## 22  6.356839 5.594640      106      TRUE    Fold1
## 23  7.009920 7.576279      110      TRUE    Fold1
## 24  6.507841 6.123724      114      TRUE    Fold1
## 25  6.232121 6.123724      116      TRUE    Fold1
## 26  5.488893 4.560702      119      TRUE    Fold1
## 27  7.005077 6.572671      131      TRUE    Fold1
## 28  4.573593 4.277850      137      TRUE    Fold1
## 29  6.415284 6.115554      140      TRUE    Fold1
## 30  6.927294 7.602631      141      TRUE    Fold1
## 31  6.775064 7.449832      143      TRUE    Fold1
## 32  5.951887 5.531727      145      TRUE    Fold1
## 33  5.863222 6.115554      147      TRUE    Fold1
## 34  5.042501 4.847680      148      TRUE    Fold1
## 35  6.579389 6.480741      154      TRUE    Fold1
## 36  6.993521 7.021396      167      TRUE    Fold1
## 37  6.122886 6.252999      171      TRUE    Fold1
## 38  5.009605 5.157519      177      TRUE    Fold1
## 39  5.362240 4.571652      186      TRUE    Fold1
## 40  5.481025 6.300794      188      TRUE    Fold1
## 41  6.348051 6.618157      190      TRUE    Fold1
## 42  6.164545 6.503845      194      TRUE    Fold1
## 43  5.608862 5.449771      207      TRUE    Fold1
## 44  5.338120 4.806246      214      TRUE    Fold1
## 45  5.485963 4.722288      215      TRUE    Fold1
## 46  5.994849 6.410928      232      TRUE    Fold1
## 47  6.705151 6.332456      233      TRUE    Fold1
## 48  7.196188 7.049823      238      TRUE    Fold1
## 49  7.403076 6.693280      244      TRUE    Fold1
## 50  6.805542 7.141428      250      TRUE    Fold1
## 51  6.937737 6.670832      251      TRUE    Fold1
## 52  6.054366 4.949747      254      TRUE    Fold1
## 53  6.644397 6.519202      255      TRUE    Fold1
## 54  5.489731 6.196773      264      TRUE    Fold1
## 55  5.048715 4.969909      271      TRUE    Fold1
## 56  6.667154 6.480741      276      TRUE    Fold1
## 57  6.285115 6.123724      277      TRUE    Fold1
## 58  5.864826 5.558777      292      TRUE    Fold1
## 59  6.243185 6.082763      296      TRUE    Fold1
## 60  7.123241 7.328028      302      TRUE    Fold1
## 61  6.795569 6.855655      303      TRUE    Fold1
## 62  6.979168 6.715653      312      TRUE    Fold1
## 63  4.797085 4.969909      313      TRUE    Fold1
## 64  6.849303 6.928203      316      TRUE    Fold1
## 65  7.050806 7.035624      327      TRUE    Fold1
## 66  5.351546 5.522681      329      TRUE    Fold1
## 67  5.964260 6.115554      331      TRUE    Fold1
## 68  7.282853 8.348653      332      TRUE    Fold1
## 69  6.226262 5.958188      349      TRUE    Fold1
## 70  6.837612 6.300794      352      TRUE    Fold1
## 71  6.864505 6.418723      353      TRUE    Fold1
## 72  6.793580 6.371813      359      TRUE    Fold1
## 73  6.952873 7.402702        4      TRUE    Fold2
## 74  6.211498 6.348228        7      TRUE    Fold2
## 75  6.771048 6.833740        8      TRUE    Fold2
## 76  6.323456 6.268971       12      TRUE    Fold2
## 77  5.327892 5.412947       20      TRUE    Fold2
## 78  5.746468 6.228965       24      TRUE    Fold2
## 79  7.148622 7.422937       32      TRUE    Fold2
## 80  5.178704 4.785394       34      TRUE    Fold2
## 81  5.153515 5.029911       35      TRUE    Fold2
## 82  6.861802 6.797058       37      TRUE    Fold2
## 83  6.803167 7.341662       40      TRUE    Fold2
## 84  6.546145 6.480741       42      TRUE    Fold2
## 85  6.256184 6.648308       43      TRUE    Fold2
## 86  5.354494 5.196152       45      TRUE    Fold2
## 87  6.806037 7.416198       55      TRUE    Fold2
## 88  6.724396 7.536577       59      TRUE    Fold2
## 89  5.926659 6.066300       72      TRUE    Fold2
## 90  6.563455 6.180615       89      TRUE    Fold2
## 91  6.929177 7.375636       91      TRUE    Fold2
## 92  6.964523 6.862944       95      TRUE    Fold2
## 93  6.850320 7.720104      105      TRUE    Fold2
## 94  5.411793 5.540758      115      TRUE    Fold2
## 95  6.015894 6.496153      118      TRUE    Fold2
## 96  6.860322 6.841053      120      TRUE    Fold2
## 97  6.474905 6.884766      121      TRUE    Fold2
## 98  6.195315 6.123724      126      TRUE    Fold2
## 99  6.306234 6.332456      127      TRUE    Fold2
## 100 6.680008 7.224957      130      TRUE    Fold2
## 101 7.403076 6.685806      134      TRUE    Fold2
## 102 6.854582 6.276942      139      TRUE    Fold2
## 103 7.355866 7.476630      157      TRUE    Fold2
## 104 5.328827 4.636809      160      TRUE    Fold2
## 105 4.911920 5.069517      161      TRUE    Fold2
## 106 5.911263 6.534524      166      TRUE    Fold2
## 107 6.174983 6.049793      169      TRUE    Fold2
## 108 5.678095 5.612486      175      TRUE    Fold2
## 109 5.167867 5.118594      180      TRUE    Fold2
## 110 7.328980 7.615773      185      TRUE    Fold2
## 111 6.272606 6.782330      195      TRUE    Fold2
## 112 6.929177 7.000000      196      TRUE    Fold2
## 113 4.555292 4.358899      199      TRUE    Fold2
## 114 5.411793 5.779273      200      TRUE    Fold2
## 115 5.243161 4.888763      202      TRUE    Fold2
## 116 7.337591 7.259477      218      TRUE    Fold2
## 117 6.047529 6.371813      229      TRUE    Fold2
## 118 6.662487 6.633250      241      TRUE    Fold2
## 119 5.309478 4.847680      246      TRUE    Fold2
## 120 5.832071 5.735852      249      TRUE    Fold2
## 121 4.985621 4.669047      257      TRUE    Fold2
## 122 6.837321 6.789698      260      TRUE    Fold2
## 123 5.466063 5.974948      262      TRUE    Fold2
## 124 5.351371 5.422177      265      TRUE    Fold2
## 125 6.260705 6.496153      272      TRUE    Fold2
## 126 7.487954 7.056912      278      TRUE    Fold2
## 127 5.540351 5.186521      279      TRUE    Fold2
## 128 6.580677 6.140033      280      TRUE    Fold2
## 129 5.380877 5.594640      283      TRUE    Fold2
## 130 6.024678 6.172520      284      TRUE    Fold2
## 131 5.658920 4.857983      287      TRUE    Fold2
## 132 5.580036 6.292853      288      TRUE    Fold2
## 133 7.127332 7.791020      309      TRUE    Fold2
## 134 6.187838 5.753260      317      TRUE    Fold2
## 135 5.003570 5.431390      318      TRUE    Fold2
## 136 6.870413 6.488451      323      TRUE    Fold2
## 137 6.401437 7.190271      324      TRUE    Fold2
## 138 6.680008 7.436397      337      TRUE    Fold2
## 139 5.008748 5.059644      338      TRUE    Fold2
## 140 4.970825 5.594640      341      TRUE    Fold2
## 141 6.579148 6.348228      343      TRUE    Fold2
## 142 6.270536 6.519202      344      TRUE    Fold2
## 143 5.293881 5.648008      345      TRUE    Fold2
## 144 4.760425 4.722288      356      TRUE    Fold2
## 145 6.971873 6.877500        3      TRUE    Fold3
## 146 7.349384 7.622336       11      TRUE    Fold3
## 147 5.134664 4.959839       22      TRUE    Fold3
## 148 7.017714 6.920983       23      TRUE    Fold3
## 149 5.375884 5.196152       25      TRUE    Fold3
## 150 6.453676 5.839521       39      TRUE    Fold3
## 151 6.903859 7.190271       47      TRUE    Fold3
## 152 7.340645 7.681146       62      TRUE    Fold3
## 153 5.723083 5.458938       69      TRUE    Fold3
## 154 4.354253 4.207137       74      TRUE    Fold3
## 155 7.206875 7.127412       76      TRUE    Fold3
## 156 6.075561 5.882176       86      TRUE    Fold3
## 157 6.895120 7.141428       87      TRUE    Fold3
## 158 7.346471 7.886698       88      TRUE    Fold3
## 159 6.576007 5.735852       90      TRUE    Fold3
## 160 5.797258 5.839521       97      TRUE    Fold3
## 161 6.444464 6.276942      100      TRUE    Fold3
## 162 6.262918 6.811755      103      TRUE    Fold3
## 163 6.795316 6.745369      109      TRUE    Fold3
## 164 6.989782 6.971370      111      TRUE    Fold3
## 165 7.168083 7.416198      112      TRUE    Fold3
## 166 6.240345 6.595453      122      TRUE    Fold3
## 167 6.376483 6.519202      123      TRUE    Fold3
## 168 6.004248 5.375872      125      TRUE    Fold3
## 169 6.337501 6.292853      142      TRUE    Fold3
## 170 6.795316 7.429670      144      TRUE    Fold3
## 171 7.340645 7.622336      150      TRUE    Fold3
## 172 6.069850 5.924525      151      TRUE    Fold3
## 173 5.122182 4.857983      158      TRUE    Fold3
## 174 4.380318 4.669047      159      TRUE    Fold3
## 175 4.230847 4.690416      162      TRUE    Fold3
## 176 6.471494 6.655825      163      TRUE    Fold3
## 177 6.257304 6.503845      164      TRUE    Fold3
## 178 6.011041 5.882176      168      TRUE    Fold3
## 179 6.282044 6.942622      170      TRUE    Fold3
## 180 6.977699 6.774954      174      TRUE    Fold3
## 181 7.079882 7.224957      182      TRUE    Fold3
## 182 6.462974 6.387488      189      TRUE    Fold3
## 183 6.685099 6.268971      203      TRUE    Fold3
## 184 7.573513 7.867655      204      TRUE    Fold3
## 185 5.518251 5.779273      210      TRUE    Fold3
## 186 6.425972 6.172520      230      TRUE    Fold3
## 187 5.352740 4.868265      231      TRUE    Fold3
## 188 6.373570 6.363961      235      TRUE    Fold3
## 189 6.561442 5.412947      236      TRUE    Fold3
## 190 5.897435 5.830952      239      TRUE    Fold3
## 191 6.026021 5.576737      242      TRUE    Fold3
## 192 5.419754 5.059644      245      TRUE    Fold3
## 193 6.577890 5.865151      247      TRUE    Fold3
## 194 5.766019 5.338539      259      TRUE    Fold3
## 195 6.879386 6.074537      261      TRUE    Fold3
## 196 4.825260 4.816638      263      TRUE    Fold3
## 197 6.525996 7.085196      267      TRUE    Fold3
## 198 4.187817 4.969909      268      TRUE    Fold3
## 199 6.801283 6.542171      273      TRUE    Fold3
## 200 6.495798 6.519202      282      TRUE    Fold3
## 201 6.094872 6.041523      290      TRUE    Fold3
## 202 6.093928 5.966574      291      TRUE    Fold3
## 203 7.366862 7.314369      297      TRUE    Fold3
## 204 6.424480 6.826419      298      TRUE    Fold3
## 205 6.367744 6.503845      304      TRUE    Fold3
## 206 5.385476 5.347897      305      TRUE    Fold3
## 207 6.633277 6.730527      310      TRUE    Fold3
## 208 6.577369 6.324555      315      TRUE    Fold3
## 209 5.263089 4.571652      320      TRUE    Fold3
## 210 6.352269 6.565059      321      TRUE    Fold3
## 211 4.909907 4.774935      322      TRUE    Fold3
## 212 7.322430 6.826419      336      TRUE    Fold3
## 213 5.336971 4.795832      347      TRUE    Fold3
## 214 6.126352 6.099180      354      TRUE    Fold3
## 215 7.129354 6.363961      355      TRUE    Fold3
## 216 7.369775 7.071068      358      TRUE    Fold3
## 217 6.931922 6.156298        1      TRUE    Fold4
## 218 7.003826 6.496153        2      TRUE    Fold4
## 219 6.611916 6.503845       18      TRUE    Fold4
## 220 7.178233 7.496666       26      TRUE    Fold4
## 221 6.831611 7.021396       31      TRUE    Fold4
## 222 6.046394 6.188699       41      TRUE    Fold4
## 223 4.656137 3.701351       48      TRUE    Fold4
## 224 5.260718 4.615192       52      TRUE    Fold4
## 225 7.000786 7.120393       58      TRUE    Fold4
## 226 7.468498 7.375636       65      TRUE    Fold4
## 227 4.875400 5.059644       68      TRUE    Fold4
## 228 5.003496 5.147815       70      TRUE    Fold4
## 229 6.588069 6.348228       71      TRUE    Fold4
## 230 6.584964 6.610598       75      TRUE    Fold4
## 231 5.420356 5.196152       77      TRUE    Fold4
## 232 6.154814 6.572671       80      TRUE    Fold4
## 233 4.689466 4.669047       81      TRUE    Fold4
## 234 4.646324 4.012481       82      TRUE    Fold4
## 235 5.918964 5.522681       93      TRUE    Fold4
## 236 5.210742 5.157519       96      TRUE    Fold4
## 237 5.218200 5.531727      104      TRUE    Fold4
## 238 6.366118 6.928203      107      TRUE    Fold4
## 239 7.114867 6.284903      117      TRUE    Fold4
## 240 6.900585 7.169379      124      TRUE    Fold4
## 241 7.015489 6.745369      129      TRUE    Fold4
## 242 6.392013 6.300794      132      TRUE    Fold4
## 243 6.399675 6.395311      136      TRUE    Fold4
## 244 5.916578 6.041523      153      TRUE    Fold4
## 245 6.637112 6.058052      155      TRUE    Fold4
## 246 6.409011 6.526868      156      TRUE    Fold4
## 247 6.257063 6.148170      165      TRUE    Fold4
## 248 6.574957 5.621388      172      TRUE    Fold4
## 249 6.917667 6.789698      176      TRUE    Fold4
## 250 6.396809 6.395311      181      TRUE    Fold4
## 251 5.804758 5.576737      184      TRUE    Fold4
## 252 6.662892 6.935416      187      TRUE    Fold4
## 253 6.157661 6.204837      192      TRUE    Fold4
## 254 6.695110 6.964194      193      TRUE    Fold4
## 255 6.235317 6.371813      206      TRUE    Fold4
## 256 5.417508 5.366563      208      TRUE    Fold4
## 257 6.675628 6.434283      209      TRUE    Fold4
## 258 6.685284 6.942622      211      TRUE    Fold4
## 259 6.652159 6.387488      212      TRUE    Fold4
## 260 6.067001 5.477226      216      TRUE    Fold4
## 261 4.654659 3.714835      217      TRUE    Fold4
## 262 7.318145 7.197222      220      TRUE    Fold4
## 263 5.651374 5.366563      224      TRUE    Fold4
## 264 5.710278 5.540758      225      TRUE    Fold4
## 265 4.807221 4.939636      226      TRUE    Fold4
## 266 5.366326 5.630275      228      TRUE    Fold4
## 267 6.385354 6.403124      237      TRUE    Fold4
## 268 4.855471 5.263079      240      TRUE    Fold4
## 269 6.972668 6.737952      243      TRUE    Fold4
## 270 7.363780 7.503333      248      TRUE    Fold4
## 271 6.575865 5.753260      281      TRUE    Fold4
## 272 6.833785 7.880355      285      TRUE    Fold4
## 273 6.639495 6.058052      286      TRUE    Fold4
## 274 6.830464 6.196773      289      TRUE    Fold4
## 275 6.365433 6.024948      293      TRUE    Fold4
## 276 7.301063 7.099296      294      TRUE    Fold4
## 277 4.669904 6.418723      299      TRUE    Fold4
## 278 5.360632 5.594640      307      TRUE    Fold4
## 279 6.167822 6.442049      325      TRUE    Fold4
## 280 6.933883 7.536577      330      TRUE    Fold4
## 281 6.960372 7.300685      333      TRUE    Fold4
## 282 7.519871 6.877500      334      TRUE    Fold4
## 283 6.226117 6.348228      335      TRUE    Fold4
## 284 6.030991 5.941380      342      TRUE    Fold4
## 285 6.618082 5.674504      346      TRUE    Fold4
## 286 5.244512 5.263079      350      TRUE    Fold4
## 287 4.940756 5.300943      357      TRUE    Fold4
## 288 6.821923 7.245688      360      TRUE    Fold4
## 289 7.346698 7.993748      361      TRUE    Fold4
## 290 7.082049 6.565059        5      TRUE    Fold5
## 291 5.244090 5.665686        6      TRUE    Fold5
## 292 6.637935 5.856620       14      TRUE    Fold5
## 293 5.953412 7.106335       15      TRUE    Fold5
## 294 7.298401 8.372574       16      TRUE    Fold5
## 295 6.335283 6.855655       28      TRUE    Fold5
## 296 6.868358 7.556454       29      TRUE    Fold5
## 297 6.858499 6.906519       36      TRUE    Fold5
## 298 5.588829 5.890671       38      TRUE    Fold5
## 299 4.403150 4.549725       44      TRUE    Fold5
## 300 6.344216 6.236986       46      TRUE    Fold5
## 301 6.224465 6.511528       51      TRUE    Fold5
## 302 7.115614 7.949843       53      TRUE    Fold5
## 303 4.944039 5.263079       54      TRUE    Fold5
## 304 6.353203 6.016644       60      TRUE    Fold5
## 305 6.990897 6.480741       61      TRUE    Fold5
## 306 5.779150 6.387488       63      TRUE    Fold5
## 307 6.329327 6.024948       64      TRUE    Fold5
## 308 5.165342 5.431390       66      TRUE    Fold5
## 309 6.918175 6.737952       79      TRUE    Fold5
## 310 6.800866 7.197222       84      TRUE    Fold5
## 311 7.335745 7.713624       85      TRUE    Fold5
## 312 5.352034 5.329165       98      TRUE    Fold5
## 313 6.738435 7.300685      102      TRUE    Fold5
## 314 6.297733 5.700877      108      TRUE    Fold5
## 315 6.373760 6.403124      113      TRUE    Fold5
## 316 5.177180 5.329165      128      TRUE    Fold5
## 317 6.074118 6.964194      133      TRUE    Fold5
## 318 5.174220 5.375872      135      TRUE    Fold5
## 319 6.398716 5.966574      138      TRUE    Fold5
## 320 6.464435 6.587868      146      TRUE    Fold5
## 321 7.172186 7.668116      149      TRUE    Fold5
## 322 7.235022 6.723095      152      TRUE    Fold5
## 323 5.518743 5.049752      173      TRUE    Fold5
## 324 7.015320 6.633250      178      TRUE    Fold5
## 325 5.656560 5.848077      179      TRUE    Fold5
## 326 6.918175 6.595453      183      TRUE    Fold5
## 327 6.509829 6.340347      191      TRUE    Fold5
## 328 6.577502 6.340347      197      TRUE    Fold5
## 329 5.406950 6.826419      198      TRUE    Fold5
## 330 6.366820 5.692100      201      TRUE    Fold5
## 331 6.228430 6.244998      205      TRUE    Fold5
## 332 6.350969 6.371813      213      TRUE    Fold5
## 333 4.825504 5.089204      219      TRUE    Fold5
## 334 6.455338 5.147815      221      TRUE    Fold5
## 335 6.301761 6.625708      222      TRUE    Fold5
## 336 7.298401 7.956130      223      TRUE    Fold5
## 337 6.905063 7.280110      227      TRUE    Fold5
## 338 5.624373 4.795832      234      TRUE    Fold5
## 339 5.520178 6.082763      252      TRUE    Fold5
## 340 6.815227 7.375636      253      TRUE    Fold5
## 341 6.554147 6.172520      256      TRUE    Fold5
## 342 6.677922 5.839521      258      TRUE    Fold5
## 343 6.896185 7.416198      266      TRUE    Fold5
## 344 6.890266 7.280110      269      TRUE    Fold5
## 345 4.535878 4.370355      270      TRUE    Fold5
## 346 6.840743 6.449806      274      TRUE    Fold5
## 347 5.806006 5.224940      275      TRUE    Fold5
## 348 5.803527 6.549809      295      TRUE    Fold5
## 349 6.802284 6.156298      300      TRUE    Fold5
## 350 5.333891 5.549775      301      TRUE    Fold5
## 351 4.535746 5.069517      306      TRUE    Fold5
## 352 5.168301 5.486347      308      TRUE    Fold5
## 353 7.189629 6.700746      311      TRUE    Fold5
## 354 6.876003 6.862944      314      TRUE    Fold5
## 355 4.806532 4.979960      319      TRUE    Fold5
## 356 6.918175 7.224957      326      TRUE    Fold5
## 357 5.243951 4.878524      328      TRUE    Fold5
## 358 5.054808 5.224940      339      TRUE    Fold5
## 359 6.282926 6.212890      340      TRUE    Fold5
## 360 6.577290 6.107373      348      TRUE    Fold5
## 361 6.571088 5.338539      351      TRUE    Fold5
model$pred
##         pred      obs rowIndex intercept Resample
## 1   5.368099 4.701064        9      TRUE    Fold1
## 2   5.735804 6.434283       10      TRUE    Fold1
## 3   4.776349 4.878524       13      TRUE    Fold1
## 4   6.324422 6.115554       17      TRUE    Fold1
## 5   7.196188 6.906519       19      TRUE    Fold1
## 6   6.992344 7.183314       21      TRUE    Fold1
## 7   6.311095 5.796551       27      TRUE    Fold1
## 8   5.594921 5.848077       30      TRUE    Fold1
## 9   5.231551 5.224940       33      TRUE    Fold1
## 10  6.252754 6.473021       49      TRUE    Fold1
## 11  6.827481 7.314369       50      TRUE    Fold1
## 12  5.523318 5.029911       56      TRUE    Fold1
## 13  6.318601 6.655825       57      TRUE    Fold1
## 14  5.821804 6.066300       67      TRUE    Fold1
## 15  6.763571 6.935416       73      TRUE    Fold1
## 16  6.168882 6.928203       78      TRUE    Fold1
## 17  5.775836 6.403124       83      TRUE    Fold1
## 18  6.733428 6.760178       92      TRUE    Fold1
## 19  7.282853 8.426150       94      TRUE    Fold1
## 20  6.786781 7.183314       99      TRUE    Fold1
## 21  5.216700 4.806246      101      TRUE    Fold1
## 22  6.356839 5.594640      106      TRUE    Fold1
## 23  7.009920 7.576279      110      TRUE    Fold1
## 24  6.507841 6.123724      114      TRUE    Fold1
## 25  6.232121 6.123724      116      TRUE    Fold1
## 26  5.488893 4.560702      119      TRUE    Fold1
## 27  7.005077 6.572671      131      TRUE    Fold1
## 28  4.573593 4.277850      137      TRUE    Fold1
## 29  6.415284 6.115554      140      TRUE    Fold1
## 30  6.927294 7.602631      141      TRUE    Fold1
## 31  6.775064 7.449832      143      TRUE    Fold1
## 32  5.951887 5.531727      145      TRUE    Fold1
## 33  5.863222 6.115554      147      TRUE    Fold1
## 34  5.042501 4.847680      148      TRUE    Fold1
## 35  6.579389 6.480741      154      TRUE    Fold1
## 36  6.993521 7.021396      167      TRUE    Fold1
## 37  6.122886 6.252999      171      TRUE    Fold1
## 38  5.009605 5.157519      177      TRUE    Fold1
## 39  5.362240 4.571652      186      TRUE    Fold1
## 40  5.481025 6.300794      188      TRUE    Fold1
## 41  6.348051 6.618157      190      TRUE    Fold1
## 42  6.164545 6.503845      194      TRUE    Fold1
## 43  5.608862 5.449771      207      TRUE    Fold1
## 44  5.338120 4.806246      214      TRUE    Fold1
## 45  5.485963 4.722288      215      TRUE    Fold1
## 46  5.994849 6.410928      232      TRUE    Fold1
## 47  6.705151 6.332456      233      TRUE    Fold1
## 48  7.196188 7.049823      238      TRUE    Fold1
## 49  7.403076 6.693280      244      TRUE    Fold1
## 50  6.805542 7.141428      250      TRUE    Fold1
## 51  6.937737 6.670832      251      TRUE    Fold1
## 52  6.054366 4.949747      254      TRUE    Fold1
## 53  6.644397 6.519202      255      TRUE    Fold1
## 54  5.489731 6.196773      264      TRUE    Fold1
## 55  5.048715 4.969909      271      TRUE    Fold1
## 56  6.667154 6.480741      276      TRUE    Fold1
## 57  6.285115 6.123724      277      TRUE    Fold1
## 58  5.864826 5.558777      292      TRUE    Fold1
## 59  6.243185 6.082763      296      TRUE    Fold1
## 60  7.123241 7.328028      302      TRUE    Fold1
## 61  6.795569 6.855655      303      TRUE    Fold1
## 62  6.979168 6.715653      312      TRUE    Fold1
## 63  4.797085 4.969909      313      TRUE    Fold1
## 64  6.849303 6.928203      316      TRUE    Fold1
## 65  7.050806 7.035624      327      TRUE    Fold1
## 66  5.351546 5.522681      329      TRUE    Fold1
## 67  5.964260 6.115554      331      TRUE    Fold1
## 68  7.282853 8.348653      332      TRUE    Fold1
## 69  6.226262 5.958188      349      TRUE    Fold1
## 70  6.837612 6.300794      352      TRUE    Fold1
## 71  6.864505 6.418723      353      TRUE    Fold1
## 72  6.793580 6.371813      359      TRUE    Fold1
## 73  6.952873 7.402702        4      TRUE    Fold2
## 74  6.211498 6.348228        7      TRUE    Fold2
## 75  6.771048 6.833740        8      TRUE    Fold2
## 76  6.323456 6.268971       12      TRUE    Fold2
## 77  5.327892 5.412947       20      TRUE    Fold2
## 78  5.746468 6.228965       24      TRUE    Fold2
## 79  7.148622 7.422937       32      TRUE    Fold2
## 80  5.178704 4.785394       34      TRUE    Fold2
## 81  5.153515 5.029911       35      TRUE    Fold2
## 82  6.861802 6.797058       37      TRUE    Fold2
## 83  6.803167 7.341662       40      TRUE    Fold2
## 84  6.546145 6.480741       42      TRUE    Fold2
## 85  6.256184 6.648308       43      TRUE    Fold2
## 86  5.354494 5.196152       45      TRUE    Fold2
## 87  6.806037 7.416198       55      TRUE    Fold2
## 88  6.724396 7.536577       59      TRUE    Fold2
## 89  5.926659 6.066300       72      TRUE    Fold2
## 90  6.563455 6.180615       89      TRUE    Fold2
## 91  6.929177 7.375636       91      TRUE    Fold2
## 92  6.964523 6.862944       95      TRUE    Fold2
## 93  6.850320 7.720104      105      TRUE    Fold2
## 94  5.411793 5.540758      115      TRUE    Fold2
## 95  6.015894 6.496153      118      TRUE    Fold2
## 96  6.860322 6.841053      120      TRUE    Fold2
## 97  6.474905 6.884766      121      TRUE    Fold2
## 98  6.195315 6.123724      126      TRUE    Fold2
## 99  6.306234 6.332456      127      TRUE    Fold2
## 100 6.680008 7.224957      130      TRUE    Fold2
## 101 7.403076 6.685806      134      TRUE    Fold2
## 102 6.854582 6.276942      139      TRUE    Fold2
## 103 7.355866 7.476630      157      TRUE    Fold2
## 104 5.328827 4.636809      160      TRUE    Fold2
## 105 4.911920 5.069517      161      TRUE    Fold2
## 106 5.911263 6.534524      166      TRUE    Fold2
## 107 6.174983 6.049793      169      TRUE    Fold2
## 108 5.678095 5.612486      175      TRUE    Fold2
## 109 5.167867 5.118594      180      TRUE    Fold2
## 110 7.328980 7.615773      185      TRUE    Fold2
## 111 6.272606 6.782330      195      TRUE    Fold2
## 112 6.929177 7.000000      196      TRUE    Fold2
## 113 4.555292 4.358899      199      TRUE    Fold2
## 114 5.411793 5.779273      200      TRUE    Fold2
## 115 5.243161 4.888763      202      TRUE    Fold2
## 116 7.337591 7.259477      218      TRUE    Fold2
## 117 6.047529 6.371813      229      TRUE    Fold2
## 118 6.662487 6.633250      241      TRUE    Fold2
## 119 5.309478 4.847680      246      TRUE    Fold2
## 120 5.832071 5.735852      249      TRUE    Fold2
## 121 4.985621 4.669047      257      TRUE    Fold2
## 122 6.837321 6.789698      260      TRUE    Fold2
## 123 5.466063 5.974948      262      TRUE    Fold2
## 124 5.351371 5.422177      265      TRUE    Fold2
## 125 6.260705 6.496153      272      TRUE    Fold2
## 126 7.487954 7.056912      278      TRUE    Fold2
## 127 5.540351 5.186521      279      TRUE    Fold2
## 128 6.580677 6.140033      280      TRUE    Fold2
## 129 5.380877 5.594640      283      TRUE    Fold2
## 130 6.024678 6.172520      284      TRUE    Fold2
## 131 5.658920 4.857983      287      TRUE    Fold2
## 132 5.580036 6.292853      288      TRUE    Fold2
## 133 7.127332 7.791020      309      TRUE    Fold2
## 134 6.187838 5.753260      317      TRUE    Fold2
## 135 5.003570 5.431390      318      TRUE    Fold2
## 136 6.870413 6.488451      323      TRUE    Fold2
## 137 6.401437 7.190271      324      TRUE    Fold2
## 138 6.680008 7.436397      337      TRUE    Fold2
## 139 5.008748 5.059644      338      TRUE    Fold2
## 140 4.970825 5.594640      341      TRUE    Fold2
## 141 6.579148 6.348228      343      TRUE    Fold2
## 142 6.270536 6.519202      344      TRUE    Fold2
## 143 5.293881 5.648008      345      TRUE    Fold2
## 144 4.760425 4.722288      356      TRUE    Fold2
## 145 6.971873 6.877500        3      TRUE    Fold3
## 146 7.349384 7.622336       11      TRUE    Fold3
## 147 5.134664 4.959839       22      TRUE    Fold3
## 148 7.017714 6.920983       23      TRUE    Fold3
## 149 5.375884 5.196152       25      TRUE    Fold3
## 150 6.453676 5.839521       39      TRUE    Fold3
## 151 6.903859 7.190271       47      TRUE    Fold3
## 152 7.340645 7.681146       62      TRUE    Fold3
## 153 5.723083 5.458938       69      TRUE    Fold3
## 154 4.354253 4.207137       74      TRUE    Fold3
## 155 7.206875 7.127412       76      TRUE    Fold3
## 156 6.075561 5.882176       86      TRUE    Fold3
## 157 6.895120 7.141428       87      TRUE    Fold3
## 158 7.346471 7.886698       88      TRUE    Fold3
## 159 6.576007 5.735852       90      TRUE    Fold3
## 160 5.797258 5.839521       97      TRUE    Fold3
## 161 6.444464 6.276942      100      TRUE    Fold3
## 162 6.262918 6.811755      103      TRUE    Fold3
## 163 6.795316 6.745369      109      TRUE    Fold3
## 164 6.989782 6.971370      111      TRUE    Fold3
## 165 7.168083 7.416198      112      TRUE    Fold3
## 166 6.240345 6.595453      122      TRUE    Fold3
## 167 6.376483 6.519202      123      TRUE    Fold3
## 168 6.004248 5.375872      125      TRUE    Fold3
## 169 6.337501 6.292853      142      TRUE    Fold3
## 170 6.795316 7.429670      144      TRUE    Fold3
## 171 7.340645 7.622336      150      TRUE    Fold3
## 172 6.069850 5.924525      151      TRUE    Fold3
## 173 5.122182 4.857983      158      TRUE    Fold3
## 174 4.380318 4.669047      159      TRUE    Fold3
## 175 4.230847 4.690416      162      TRUE    Fold3
## 176 6.471494 6.655825      163      TRUE    Fold3
## 177 6.257304 6.503845      164      TRUE    Fold3
## 178 6.011041 5.882176      168      TRUE    Fold3
## 179 6.282044 6.942622      170      TRUE    Fold3
## 180 6.977699 6.774954      174      TRUE    Fold3
## 181 7.079882 7.224957      182      TRUE    Fold3
## 182 6.462974 6.387488      189      TRUE    Fold3
## 183 6.685099 6.268971      203      TRUE    Fold3
## 184 7.573513 7.867655      204      TRUE    Fold3
## 185 5.518251 5.779273      210      TRUE    Fold3
## 186 6.425972 6.172520      230      TRUE    Fold3
## 187 5.352740 4.868265      231      TRUE    Fold3
## 188 6.373570 6.363961      235      TRUE    Fold3
## 189 6.561442 5.412947      236      TRUE    Fold3
## 190 5.897435 5.830952      239      TRUE    Fold3
## 191 6.026021 5.576737      242      TRUE    Fold3
## 192 5.419754 5.059644      245      TRUE    Fold3
## 193 6.577890 5.865151      247      TRUE    Fold3
## 194 5.766019 5.338539      259      TRUE    Fold3
## 195 6.879386 6.074537      261      TRUE    Fold3
## 196 4.825260 4.816638      263      TRUE    Fold3
## 197 6.525996 7.085196      267      TRUE    Fold3
## 198 4.187817 4.969909      268      TRUE    Fold3
## 199 6.801283 6.542171      273      TRUE    Fold3
## 200 6.495798 6.519202      282      TRUE    Fold3
## 201 6.094872 6.041523      290      TRUE    Fold3
## 202 6.093928 5.966574      291      TRUE    Fold3
## 203 7.366862 7.314369      297      TRUE    Fold3
## 204 6.424480 6.826419      298      TRUE    Fold3
## 205 6.367744 6.503845      304      TRUE    Fold3
## 206 5.385476 5.347897      305      TRUE    Fold3
## 207 6.633277 6.730527      310      TRUE    Fold3
## 208 6.577369 6.324555      315      TRUE    Fold3
## 209 5.263089 4.571652      320      TRUE    Fold3
## 210 6.352269 6.565059      321      TRUE    Fold3
## 211 4.909907 4.774935      322      TRUE    Fold3
## 212 7.322430 6.826419      336      TRUE    Fold3
## 213 5.336971 4.795832      347      TRUE    Fold3
## 214 6.126352 6.099180      354      TRUE    Fold3
## 215 7.129354 6.363961      355      TRUE    Fold3
## 216 7.369775 7.071068      358      TRUE    Fold3
## 217 6.931922 6.156298        1      TRUE    Fold4
## 218 7.003826 6.496153        2      TRUE    Fold4
## 219 6.611916 6.503845       18      TRUE    Fold4
## 220 7.178233 7.496666       26      TRUE    Fold4
## 221 6.831611 7.021396       31      TRUE    Fold4
## 222 6.046394 6.188699       41      TRUE    Fold4
## 223 4.656137 3.701351       48      TRUE    Fold4
## 224 5.260718 4.615192       52      TRUE    Fold4
## 225 7.000786 7.120393       58      TRUE    Fold4
## 226 7.468498 7.375636       65      TRUE    Fold4
## 227 4.875400 5.059644       68      TRUE    Fold4
## 228 5.003496 5.147815       70      TRUE    Fold4
## 229 6.588069 6.348228       71      TRUE    Fold4
## 230 6.584964 6.610598       75      TRUE    Fold4
## 231 5.420356 5.196152       77      TRUE    Fold4
## 232 6.154814 6.572671       80      TRUE    Fold4
## 233 4.689466 4.669047       81      TRUE    Fold4
## 234 4.646324 4.012481       82      TRUE    Fold4
## 235 5.918964 5.522681       93      TRUE    Fold4
## 236 5.210742 5.157519       96      TRUE    Fold4
## 237 5.218200 5.531727      104      TRUE    Fold4
## 238 6.366118 6.928203      107      TRUE    Fold4
## 239 7.114867 6.284903      117      TRUE    Fold4
## 240 6.900585 7.169379      124      TRUE    Fold4
## 241 7.015489 6.745369      129      TRUE    Fold4
## 242 6.392013 6.300794      132      TRUE    Fold4
## 243 6.399675 6.395311      136      TRUE    Fold4
## 244 5.916578 6.041523      153      TRUE    Fold4
## 245 6.637112 6.058052      155      TRUE    Fold4
## 246 6.409011 6.526868      156      TRUE    Fold4
## 247 6.257063 6.148170      165      TRUE    Fold4
## 248 6.574957 5.621388      172      TRUE    Fold4
## 249 6.917667 6.789698      176      TRUE    Fold4
## 250 6.396809 6.395311      181      TRUE    Fold4
## 251 5.804758 5.576737      184      TRUE    Fold4
## 252 6.662892 6.935416      187      TRUE    Fold4
## 253 6.157661 6.204837      192      TRUE    Fold4
## 254 6.695110 6.964194      193      TRUE    Fold4
## 255 6.235317 6.371813      206      TRUE    Fold4
## 256 5.417508 5.366563      208      TRUE    Fold4
## 257 6.675628 6.434283      209      TRUE    Fold4
## 258 6.685284 6.942622      211      TRUE    Fold4
## 259 6.652159 6.387488      212      TRUE    Fold4
## 260 6.067001 5.477226      216      TRUE    Fold4
## 261 4.654659 3.714835      217      TRUE    Fold4
## 262 7.318145 7.197222      220      TRUE    Fold4
## 263 5.651374 5.366563      224      TRUE    Fold4
## 264 5.710278 5.540758      225      TRUE    Fold4
## 265 4.807221 4.939636      226      TRUE    Fold4
## 266 5.366326 5.630275      228      TRUE    Fold4
## 267 6.385354 6.403124      237      TRUE    Fold4
## 268 4.855471 5.263079      240      TRUE    Fold4
## 269 6.972668 6.737952      243      TRUE    Fold4
## 270 7.363780 7.503333      248      TRUE    Fold4
## 271 6.575865 5.753260      281      TRUE    Fold4
## 272 6.833785 7.880355      285      TRUE    Fold4
## 273 6.639495 6.058052      286      TRUE    Fold4
## 274 6.830464 6.196773      289      TRUE    Fold4
## 275 6.365433 6.024948      293      TRUE    Fold4
## 276 7.301063 7.099296      294      TRUE    Fold4
## 277 4.669904 6.418723      299      TRUE    Fold4
## 278 5.360632 5.594640      307      TRUE    Fold4
## 279 6.167822 6.442049      325      TRUE    Fold4
## 280 6.933883 7.536577      330      TRUE    Fold4
## 281 6.960372 7.300685      333      TRUE    Fold4
## 282 7.519871 6.877500      334      TRUE    Fold4
## 283 6.226117 6.348228      335      TRUE    Fold4
## 284 6.030991 5.941380      342      TRUE    Fold4
## 285 6.618082 5.674504      346      TRUE    Fold4
## 286 5.244512 5.263079      350      TRUE    Fold4
## 287 4.940756 5.300943      357      TRUE    Fold4
## 288 6.821923 7.245688      360      TRUE    Fold4
## 289 7.346698 7.993748      361      TRUE    Fold4
## 290 7.082049 6.565059        5      TRUE    Fold5
## 291 5.244090 5.665686        6      TRUE    Fold5
## 292 6.637935 5.856620       14      TRUE    Fold5
## 293 5.953412 7.106335       15      TRUE    Fold5
## 294 7.298401 8.372574       16      TRUE    Fold5
## 295 6.335283 6.855655       28      TRUE    Fold5
## 296 6.868358 7.556454       29      TRUE    Fold5
## 297 6.858499 6.906519       36      TRUE    Fold5
## 298 5.588829 5.890671       38      TRUE    Fold5
## 299 4.403150 4.549725       44      TRUE    Fold5
## 300 6.344216 6.236986       46      TRUE    Fold5
## 301 6.224465 6.511528       51      TRUE    Fold5
## 302 7.115614 7.949843       53      TRUE    Fold5
## 303 4.944039 5.263079       54      TRUE    Fold5
## 304 6.353203 6.016644       60      TRUE    Fold5
## 305 6.990897 6.480741       61      TRUE    Fold5
## 306 5.779150 6.387488       63      TRUE    Fold5
## 307 6.329327 6.024948       64      TRUE    Fold5
## 308 5.165342 5.431390       66      TRUE    Fold5
## 309 6.918175 6.737952       79      TRUE    Fold5
## 310 6.800866 7.197222       84      TRUE    Fold5
## 311 7.335745 7.713624       85      TRUE    Fold5
## 312 5.352034 5.329165       98      TRUE    Fold5
## 313 6.738435 7.300685      102      TRUE    Fold5
## 314 6.297733 5.700877      108      TRUE    Fold5
## 315 6.373760 6.403124      113      TRUE    Fold5
## 316 5.177180 5.329165      128      TRUE    Fold5
## 317 6.074118 6.964194      133      TRUE    Fold5
## 318 5.174220 5.375872      135      TRUE    Fold5
## 319 6.398716 5.966574      138      TRUE    Fold5
## 320 6.464435 6.587868      146      TRUE    Fold5
## 321 7.172186 7.668116      149      TRUE    Fold5
## 322 7.235022 6.723095      152      TRUE    Fold5
## 323 5.518743 5.049752      173      TRUE    Fold5
## 324 7.015320 6.633250      178      TRUE    Fold5
## 325 5.656560 5.848077      179      TRUE    Fold5
## 326 6.918175 6.595453      183      TRUE    Fold5
## 327 6.509829 6.340347      191      TRUE    Fold5
## 328 6.577502 6.340347      197      TRUE    Fold5
## 329 5.406950 6.826419      198      TRUE    Fold5
## 330 6.366820 5.692100      201      TRUE    Fold5
## 331 6.228430 6.244998      205      TRUE    Fold5
## 332 6.350969 6.371813      213      TRUE    Fold5
## 333 4.825504 5.089204      219      TRUE    Fold5
## 334 6.455338 5.147815      221      TRUE    Fold5
## 335 6.301761 6.625708      222      TRUE    Fold5
## 336 7.298401 7.956130      223      TRUE    Fold5
## 337 6.905063 7.280110      227      TRUE    Fold5
## 338 5.624373 4.795832      234      TRUE    Fold5
## 339 5.520178 6.082763      252      TRUE    Fold5
## 340 6.815227 7.375636      253      TRUE    Fold5
## 341 6.554147 6.172520      256      TRUE    Fold5
## 342 6.677922 5.839521      258      TRUE    Fold5
## 343 6.896185 7.416198      266      TRUE    Fold5
## 344 6.890266 7.280110      269      TRUE    Fold5
## 345 4.535878 4.370355      270      TRUE    Fold5
## 346 6.840743 6.449806      274      TRUE    Fold5
## 347 5.806006 5.224940      275      TRUE    Fold5
## 348 5.803527 6.549809      295      TRUE    Fold5
## 349 6.802284 6.156298      300      TRUE    Fold5
## 350 5.333891 5.549775      301      TRUE    Fold5
## 351 4.535746 5.069517      306      TRUE    Fold5
## 352 5.168301 5.486347      308      TRUE    Fold5
## 353 7.189629 6.700746      311      TRUE    Fold5
## 354 6.876003 6.862944      314      TRUE    Fold5
## 355 4.806532 4.979960      319      TRUE    Fold5
## 356 6.918175 7.224957      326      TRUE    Fold5
## 357 5.243951 4.878524      328      TRUE    Fold5
## 358 5.054808 5.224940      339      TRUE    Fold5
## 359 6.282926 6.212890      340      TRUE    Fold5
## 360 6.577290 6.107373      348      TRUE    Fold5
## 361 6.571088 5.338539      351      TRUE    Fold5
model$resample
##        RMSE  Rsquared       MAE Resample
## 1 0.4668688 0.7390410 0.3785614    Fold1
## 2 0.4041783 0.8055002 0.3265182    Fold2
## 3 0.3907139 0.8149901 0.3052933    Fold3
## 4 0.4729552 0.7318698 0.3519278    Fold4
## 5 0.5409860 0.6314354 0.4444235    Fold5