ComenzarEmpieza gratis

Predicting house prices

Perhaps the most useful feature of statistical models like linear regression is that you can make predictions. That is, you specify values for each of the explanatory variables, feed them to the model, and you get a prediction for the corresponding response variable. The code flow is as follows.

explanatory_data <- tibble(
  explanatory_var = some_values
)
explanatory_data %>%
  mutate(
    response_var = predict(model, explanatory_data)
  )

Here, you'll make predictions for the house prices in the Taiwan real estate dataset.

taiwan_real_estate is available. The linear regression model of house price versus number of convenience stores is available as mdl_price_vs_conv (print it and read the call to see how it was made); and dplyr is loaded.

Este ejercicio forma parte del curso

Introduction to Regression in R

Ver curso

Ejercicio interactivo práctico

Prueba este ejercicio y completa el código de muestra.

# Create a tibble with n_convenience column from zero to ten
explanatory_data <- ___
Editar y ejecutar código