Model respons logistik

Membangun Model Respons di R

Kathrin Gruber

Assistant Professor of Econometrics Erasmus University Rotterdam

Fungsi respons logistik

  • Membatasi prediksi model antara 0 dan 1.
  • Mengasumsikan hubungan yang melengkung.

Membangun Model Respons di R

Model logistik untuk permintaan bir

logistic.model <- glm(HOPPINESS ~ price.ratio, family = binomial, 
                      data = choice.data)
coef(logistic.model)
(Intercept)  price.ratio 
  -3.572678   -6.738768 
Membangun Model Respons di R

Prediksi terbatas

plot(HOPPINESS ~ price.ratio, data = choice.data)
curve(predict(logistic.model, data.frame(price.ratio = x), 
              type = "response"), add = TRUE)

Membangun Model Respons di R

Efek marginal rata-rata

  • Model logistik nonlinier:
margins(logistic.model)
price.ratio
    -0.4585
  • Model probabilitas linear
coef(probability.model)
(Intercept)  price.ratio 
 0.09700236  -0.29594939 
Membangun Model Respons di R

Plot efek

x <- seq(-1.25, 1.25, by = 0.25)
cplot(logistic.model, "price.ratio", xvals = x)

Membangun Model Respons di R

Ayo berlatih!

Membangun Model Respons di R

Preparing Video For Download...