BaşlayınÜcretsiz Başlayın

A linear probability model for beer demand

To see how much of an effect changes in the price ratio have on the purchases probabilities of Hoppiness, you describe the relation HOPPINESS ~ price.ratio by using the function lm(). This time, you also directly graph the estimated model by using the functions plot() and abline().

Bu egzersiz

Building Response Models in R

kursunun bir parçasıdır
Kursu Görüntüle

Egzersiz talimatları

  • Use the function lm() to explain the purchase probabilities for HOPPINESS by price.ratio. Assign the result to an object named probability.model.
  • Display the relation between HOPPINESS and price.ratio by using the function plot().
  • Add the model predictions by applying the function abline() to the probability.model object.

Uygulamalı interaktif egzersiz

Bu örnek kodu tamamlayarak bu egzersizi bitirin.

# Explain HOPPINESS by price.ratio
probability.model <- lm(___, data = choice.data)

# Plot HOPPINESS against price.ratio
___(___, data = choice.data)

# Add the model predictions
___(___)
Kodu Düzenle ve Çalıştır