Modellen voor individuele vraag

Responsmodellen bouwen in R

Kathrin Gruber

Assistant Professor of Econometrics Erasmus University Rotterdam

Aankopen van klanten

str(choice.data)
'data.frame':    2798 obs. of  15 variables:
 $ OBS          : int  1 2 3 4 5 6 7 8 9 10 ...
 $ HOUSEHOLDID  : int  1 1 1 1 1 1 1 1 1 1 ...
 $ LASTPURCHASE : int  0 0 0 0 0 0 0 0 0 0 ...
 $ BUD          : int  1 1 1 1 1 1 1 1 1 1 ...
 $ HOPPINESS    : int  0 0 0 0 0 0 0 0 0 0 ...
 $ PRICE.BUD    : num  0.052 0.052 0.046 0.052 0.046 ...
 ...
  • Week van OBS-ervatie.
  • HOUSEHOLDID van de aankopen.
  • LASTPURCHASE geregistreerd voor het huishouden.
Responsmodellen bouwen in R

Kopen of niet kopen?

  • Lineair-kansmodel $$\textsf{Pr}(\textsf{Purchase}=1) = f(\textsf{Advertising, Promotion})$$
Responsmodellen bouwen in R

Concurrentie

price.ratio <- log(choice.data$PRICE.HOP/choice.data$PRICE.BUD)

head(cbind(price.ratio, choice.data$PRICE.BUD, choice.data$PRICE.HOP))
     price.ratio            
[1,] -0.42488315 0.052 0.034
[2,] -0.16705410 0.052 0.044
[3,]  0.04255961 0.046 0.048
[4,] -0.42488315 0.052 0.034
[5,]  0.04255961 0.046 0.048
[6,] -0.44895021 0.047 0.030
Responsmodellen bouwen in R

Een lineair kansmodel voor biervraag

probability.model <- lm(HOPPINESS ~ price.ratio, data = choice.data)

plot(HOPPINESS ~ price.ratio, data = choice.data)
abline(probability.model)

Responsmodellen bouwen in R

Laten we oefenen!

Responsmodellen bouwen in R

Preparing Video For Download...