~/ learn/ afm-112/ cards/ Sign, size, range, decision — and a pivot is a model too
1 of 9

In R, type the aggregate() call that gives the mean sales per channel from the stores frame.

In R, type the aggregate() call that gives the mean sales per channel from the stores frame.

Answer

aggregate(sales ~ channel, data = stores, FUN = mean)

Mall 30.33333, Street 37.66667 — a model with a categorical predictor: one fitted value per level. lm(sales ~ channel) reports 30.33 and the difference 7.33.

space flip · ← → navigate · esc to exit
NORMAL ~/memra/library/0b1f3149-b3dd-4e1e-9a90-9421bc9c55cf/flashcard utf-8 LF