เริ่มต้นใช้งานเริ่มต้นใช้งานได้ฟรี

Competition

Developing an effective pricing strategy for Hoppiness also requires considering the prices for Bud. The best way to do this is by price comparisons.

Therefore, you define a new variable price.ratio indicating the ratio of PRICE.HOP to PRICE.BUD. You also take the log() to ensure that the price ratio of Hoppiness to Bud has the same magnitude as the price ratio of Bud to Hoppiness. To better understand the new price.ratio variable, you compare its values to the original PRICE.HOP and PRICE.BUD values.

แบบฝึกหัดนี้เป็นส่วนหนึ่งของหลักสูตร

Building Response Models in R

ดูคอร์ส

คำแนะนำการฝึกหัด

  • Calculate the ratio of PRICE.HOP to PRICE.BUD. Assign the result to an object named price.ratio.
  • Compare the price.ratio values to the original PRICE.HOP and PRICE.BUD values by using the functions cbind() and head().

แบบฝึกหัดเชิงโต้ตอบแบบลงมือทำ

ลองทำแบบฝึกหัดนี้โดยเติมโค้ดตัวอย่างนี้ให้สมบูรณ์

# Calculate the price ratio of PRICE.HOP to PRICE.BUD
price.ratio <- ___(___/___)

# Compare price.ratio to PRICE.HOP and PRICE.BUD
___(___(price.ratio, choice.data$PRICE.BUD, choice.data$PRICE.HOP))
แก้ไขและรันโค้ด