BaşlayınÜcretsiz Başlayın

lm() with a categorical explanatory variable

Linear regressions also work with categorical explanatory variables. In this case, the code to run the model is the same, but the coefficients returned by the model are different. Here you'll run a linear regression on the Taiwan real estate dataset.

taiwan_real_estate is available.

Bu egzersiz

Introduction to Regression in R

kursunun bir parçasıdır
Kursu Görüntüle

Uygulamalı interaktif egzersiz

Bu örnek kodu tamamlayarak bu egzersizi bitirin.

# Run a linear regression of price_twd_msq vs. house_age_years
mdl_price_vs_age <- ___

# See the result
mdl_price_vs_age
Kodu Düzenle ve Çalıştır