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

Summarizing the data

You start by summarizing the purchases and prices for HOPPINESS and BUD. You calculate the average purchases of HOPPINESS and BUD as well as the average PRICE.HOP and PRICE.BUD levels by using the function colMeans(). The function colMeans() calculates the means across all specified data vectors simultaneously.

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

Building Response Models in R

ดูคอร์ส

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

  • Get the mean of the HOPPINESS and BUD purchases, as well as the average of PRICE.HOP and PRICE.BUD levels by using the function colMeans().

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

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

# Get the mean of HOPPINESS, BUD, PRICE.HOP and PRICE.BUD
___(choice.data[c(___,___,___,___)]) 
แก้ไขและรันโค้ด