始める無料で始める

手計算で予測値を求める

単回帰と同様に、モデル係数から予測値を手計算できます。並行傾き(parallel slopes)の場合に変わるのは、切片がカテゴリカルな説明変数の各カテゴリごとに異なる点だけです。つまり、各カテゴリがそれぞれ起こるケースを個別に考える必要があります。

taiwan_real_estatemdl_price_vs_bothexplanatory_data が利用可能で、dplyr は読み込まれています。

この演習はコースの一部です

Rで学ぶ中級回帰分析

コースを見る

実践的なインタラクティブ演習

このサンプルコードを完成させて、この演習に挑戦してみましょう。

# 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 <- ___
コードを編集して実行