개별 수요 모델

R로 만드는 반응 모형

Kathrin Gruber

Assistant Professor of Econometrics Erasmus University Rotterdam

고객 구매

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 ...
 ...
  • OBS: 관측 주.
  • HOUSEHOLDID: 구매 기록의 가구 ID.
  • LASTPURCHASE: 해당 가구의 마지막 구매 여부.
R로 만드는 반응 모형

구매 여부 결정

  • 선형 확률 모형 $$\textsf{Pr}(\textsf{Purchase}=1) = f(\textsf{Advertising, Promotion})$$
R로 만드는 반응 모형

경쟁

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
R로 만드는 반응 모형

맥주 수요의 선형 확률 모형

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

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

R로 만드는 반응 모형

연습해 봅시다!

R로 만드는 반응 모형

Preparing Video For Download...