pacman::p_load(olsrr, ggstatsplot, sf, tmap, tidyverse, gtsummary, performance, see, sfdep)
condo_resale <- read_csv("data/aspatial/Condo_resale_2015.csv")
mpsz <- read_rds("data/rds/mpsz.rds")
condo_resale_sf <- read_rds("data/rds/condo_resale_sf.rds")
ggcormat(condo_resale[, 5:23])
condo_mlr <- lm(formula = SELLING_PRICE ~ AREA_SQM..., data = condo_resale_sf)
summary(condo_mlr)
metric <- compare_performance(condo_mlr, condo_fw_mlr$model, condo_bw_mlr$model, condo_sb_mlr)
ggcoefstats(condo_sb_mlr$model, sort = "ascending")
check_collinearity(condo_sb_mlr$model)
plot(check_collinearity(condo_sb_mlr$model)) +
theme(axis.text.x = element_text(angle = 45, hjust = 1))
out <- plot(check_model(condo_sb_mlr$model, panel = FALSE))
out[[2]]
plot(check_normality(condo_sb_mlr$model))
outliers <- check_outliers(condo_sb_mlr$model, method = "cook")
mlr_output <- as.data.frame(condo_fw_mlr$model$residuals) %>% rename(`FW_MLR_RES` = `condo_fw_mlr$model$residuals`)