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.
Diese Übung ist Teil des Kurses
Building Response Models in R
Anleitung zur Übung
- Get the mean of the
HOPPINESSandBUDpurchases, as well as the average ofPRICE.HOPandPRICE.BUDlevels by using the functioncolMeans().
Interaktive Übung
Vervollständige den Beispielcode, um diese Übung erfolgreich abzuschließen.
# Get the mean of HOPPINESS, BUD, PRICE.HOP and PRICE.BUD
___(choice.data[c(___,___,___,___)])