MulaiMulai sekarang secara gratis

Comparing the R-squared of two models

Let's now compute \(R^2\) for the one numerical and one categorical explanatory/predictor variable model you fit in the Chapter 3, price as a function of size and whether the house had a view of the waterfront, and compare its \(R^2\) with the one you just computed.

Latihan ini adalah bagian dari kursus

Modeling with Data in the Tidyverse

Lihat Kursus

Latihan interaktif praktis

Cobalah latihan ini dengan menyelesaikan kode contoh berikut.

# Fit model
model_price_4 <- lm(log10_price ~ log10_size + waterfront,
                    data = house_prices)

# Get fitted/values & residuals, compute R^2 using residuals
get_regression_points(model_price_4) %>% 
  ___
Edit dan Jalankan Kode