IniziaInizia gratis

Manually calculating predictions

As with simple linear regression, you can manually calculate the predictions from the model coefficients. The only change for the parallel slopes case is that the intercept is different for each category of the categorical explanatory variable. That means you need to consider the case when each each category occurs separately.

taiwan_real_estate, mdl_price_vs_both, and explanatory_data are available; dplyr is loaded.

Questo esercizio fa parte del corso

Intermediate Regression in R

Visualizza il corso

Esercizio pratico interattivo

Prova a risolvere questo esercizio completando il codice di esempio.

# Get the coefficients from mdl_price_vs_both
coeffs <- ___

# Extract the slope coefficient
slope <- ___

# Extract the intercept coefficient for 0 to 15
intercept_0_15 <- ___

# Extract the intercept coefficient for 15 to 30
intercept_15_30 <- ___

# Extract the intercept coefficient for 30 to 45
intercept_30_45 <- ___
Modifica ed esegui il codice