साल और साइज़ से house price समझना

Tidyverse में डेटा के साथ Modeling

Albert Y. Kim

Assistant Professor of Statistical and Data Sciences

दोहरा: Seattle house prices

library(dplyr)
library(moderndive)

# Preview only certain variables:
house_prices %>% 
  select(price, sqft_living, condition, waterfront) %>% 
  glimpse()
Observations: 21,613
Variables: 4
$ price       <dbl> 221900, 538000, 180000, 604000...
$ sqft_living <int> 1180, 2570, 770, 1960, 1680, 5420...
$ condition   <fct> 3, 3, 3, 5, 3, 3, 3, 3, 3, 3, 3...
Tidyverse में डेटा के साथ Modeling

दोहरा: Price और size वैरिएबल्स

Tidyverse में डेटा के साथ Modeling

दोहरा: log10 ट्रांसफॉर्मेशन

Tidyverse में डेटा के साथ Modeling

दोहरा: डेटा ट्रांसफॉर्मेशन

# log10() transform price and size
house_prices <- house_prices %>%
  mutate(
    log10_price = log10(price),
    log10_size = log10(sqft_living)
  )
Tidyverse में डेटा के साथ Modeling

House price के लिए मॉडल

  • आउटपुट वैरिएबल $y$ - house price (USD): price
  • दो संख्यात्मक explanatory/predictor वैरिएबल्स:
    • $x_1$ - house size: log10_size
    • $x_2$ - year built: yr_built
Tidyverse में डेटा के साथ Modeling

House price, size और year का exploratory visualization

log10_price, log10_size, और yr_built का 3D स्कैटरप्लॉट

Tidyverse में डेटा के साथ Modeling

Regression plane

Regression plane वाला 3D स्कैटरप्लॉट (''interactive version'' का लिंक)।

Tidyverse में डेटा के साथ Modeling

Regression तालिका

# Fit regression model using formula of form: y ~ x1 + x2
model_price_1 <- lm(log10_price ~ log10_size + yr_built, 
                    data = house_prices)

# Output regression table get_regression_table(model_price_1)
# A tibble: 3 x 7
  term       estimate std_error statistic p_value...
  <chr>         <dbl>     <dbl>     <dbl>   <dbl>...
1 intercept   5.38      0.0754       71.4       0...
2 log10_size  0.913     0.00647     141.        0...
3 yr_built   -0.00138   0.00004     -33.8       0...
Tidyverse में डेटा के साथ Modeling

अभ्यास करते हैं!

Tidyverse में डेटा के साथ Modeling

Preparing Video For Download...