MulaiMulai sekarang secara gratis

Evaluating the different parameters in the model

We are imputing our data for a reason - we want to analyze the data!

In this example, we are interested in predicting sea temperature, so we will build a linear model predicting sea temperature.

We will fit this model to each of the datasets we created and then explore the coefficients in the data.

The objects from the previous lesson (ocean_cc, ocean_imp_lm_wind, ocean_imp_lm_all, and bound_models) are loaded into the workspace.

Latihan ini adalah bagian dari kursus

Dealing With Missing Data in R

Lihat Kursus

Petunjuk latihan

  • Create the model summary for each dataset with columns for residuals using residuals, predict, and tidy.
  • Explore the coefficients in the model and put the model with the highest estimate for air_temp_c in the object best_model

Latihan interaktif praktis

Cobalah latihan ini dengan menyelesaikan kode contoh berikut.

# Create the model summary for each dataset
model_summary <- bound_models %>% 
  group_by(imp_model) %>%
  nest() %>%
  mutate(mod = map(data, ~lm(sea_temp_c ~ air_temp_c + humidity + year, data = .)),
         res = map(mod, ___),
         pred = map(mod, ___),
         tidy = map(mod, ___))

# Explore the coefficients in the model
model_summary %>% 
	select(___,___) %>% 
	unnest()
best_model <- "___"
Edit dan Jalankan Kode