A probit model for beer demand
You heard other data scientists prefer using the probit response function for modeling purchase decisions. The probit treats purchases decisions as latent propensities. That sounds fancy and makes you nervous, so you try out the probit, too.
You can again use the function glm() to describe the relation HOPPINESS ~ price.ratio. You only need to augment the family argument by binomial(link = probit). As usual, the estimated coefficients are obtained by using the function coef().
แบบฝึกหัดนี้เป็นส่วนหนึ่งของหลักสูตร
Building Response Models in R
คำแนะนำการฝึกหัด
- Explain
HOPPINESSbyprice.ratiousing the functionglm()and the argumentfamily = binomial(link = probit). Assign the result to an object namedprobit.model. - Obtain the coefficients of the
probit.modelby using the functioncoef().
แบบฝึกหัดเชิงโต้ตอบแบบลงมือทำ
ลองทำแบบฝึกหัดนี้โดยเติมโค้ดตัวอย่างนี้ให้สมบูรณ์
# Explain HOPPINESS by price.ratio
probit.model <- ___(___, family = ___, data = choice.data)
# Obtain the coefficients