MulaiMulai sekarang secara gratis

Best model by sex

In the previous exercise, you predicted age from either shuckedWeight or shellWeight. shellWeight did a better job predicting age with the highest r.squared.

In this exercise, run the simple linear regression of age by shellWeight three times - one for each abalone sex ("I", "F", "M"). Save your results from each lm() model and compare the model fit statistics such as r.squared.

The abaloneKeep dataset and dplyr package are loaded and a plot of each model fit is also provided for you.

Latihan ini adalah bagian dari kursus

R For SAS Users

Lihat Kursus

Latihan interaktif praktis

Cobalah latihan ini dengan menyelesaikan kode contoh berikut.

# Save model output and output of model summary for infants
modelInfants <- lm(___ ~ ___, data = ___, subset = ___)
summaryInfants <- summary(___)
Edit dan Jalankan Kode