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

Fitting linear models

If your future role involves building predictive models, the interviewer might be interested in testing your knowledge of linear regression.

Linear regression models are one of the basic forms of predicting values for linearly related data. Linear regression model requires normality and homoscedasticity of the errors. If you fit a linear regression model during the interview, ensure that these assumptions are met.

You are already familiar with the cats dataset. The dataset is available in your environment. To add a regression line to the plot, you can use abline() applied on a linear model's object.

Bu egzersiz

Practicing Statistics Interview Questions in R

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

Uygulamalı interaktif egzersiz

Bu örnek kodu tamamlayarak bu egzersizi bitirin.

# Draw the scatterplot
___(___ ~ ___, data = ___)

# Fit the linear model
model <- ___(___ ~ ___, data = ___)

# Add the regression line
___(model)
Kodu Düzenle ve Çalıştır