Database Reference
In-Depth Information
3.6
The F -test statistic in ANOVA can be thought of as a measure of how different the
means are relative to the variability within each group. The larger the observed
F -test statistic, the greater the likelihood that the differences between the means
are due to something other than chance alone. The F -test statistic is used to test
the hypothesis that the observed effects are not due to chance—that is, if the means
are significantly different from one another.
Consider an example that every customer who visits a retail website gets one of
two promotional offers or gets no promotion at all. The goal is to see if making
the promotional offers makes a difference. ANOVA could be used, and the null
hypothesis is that neither promotion makes a difference. The code that follows
randomly generates a total of 500 observations of purchase sizes on three different
offer options.
offers <- sample(c("offer1", "offer2", "nopromo"),
size=500, replace=T)
# Simulated 500 observations of purchase sizes on the 3
offer options
purchasesize <- ifelse(offers=="offer1", rnorm(500,
mean=80, sd=30),
ifelse(offers=="offer2", rnorm(500, mean=85, sd=30),
rnorm(500, mean=40, sd=30)))
# create a data frame of offer option and purchase size
offertest <- data.frame(offer=as.factor(offers),
purchase_amt=purchasesize)
The summary of the offertest data frame shows that 170 offer1 , 161 offer2 ,
and 169 nopromo (no promotion) offers have been made. It also shows the range
of purchase size ( purchase_amt ) for each of the three offer options.
bla # display a summary of offertest where offer="offer1"
summary(offertest[offertest$offer=="offer1",])
offer purchase_amt
nopromo: 0 Min. : 4.521
offer1 :170 1st Qu.: 58.158
offer2 : 0 Median : 76.944
Search WWH ::




Custom Search