Logistische responsemodellen

Responsmodellen bouwen in R

Kathrin Gruber

Assistant Professor of Econometrics Erasmus University Rotterdam

Logistische responsefunctie

  • Begrenst voorspellingen tussen 0 en 1.
  • Veronderstelt een gebogen relatie.

Responsmodellen bouwen in R

Een logistisch model voor biervraag

logistic.model <- glm(HOPPINESS ~ price.ratio, family = binomial, 
                      data = choice.data)
coef(logistic.model)
(Intercept)  price.ratio 
  -3.572678   -6.738768 
Responsmodellen bouwen in R

Gebonden voorspellingen

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

Responsmodellen bouwen in R

Gemiddelde marginale effecten

  • Niet-lineair logistisch model:
margins(logistic.model)
price.ratio
    -0.4585
  • Lineair waarschijnlijkheidsmodel
coef(probability.model)
(Intercept)  price.ratio 
 0.09700236  -0.29594939 
Responsmodellen bouwen in R

Effectplots

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

Responsmodellen bouwen in R

Laten we oefenen!

Responsmodellen bouwen in R

Preparing Video For Download...