| oranges | R Documentation |
This example dataset on sales of oranges has two factors, two covariates, and two responses. There is one observation per factor combination.
oranges
A data frame with 36 observations and 6 variables:
storea factor with levels 1 2 3
4 5 6. The store that was observed.
daya factor with levels 1 2 3
4 5 6. The day the observation was taken (same for
each store).
price1a numeric vector. Price of variety 1.
price2a numeric vector. Price of variety 2.
sales1a numeric vector. Sales (per customer) of variety 1.
sales2a numeric vector. Sales (per customer) of variety 2.
This is (or once was) available as a SAS sample dataset.
Littell, R., Stroup W., Freund, R. (2002) SAS For Linear Models (4th edition). SAS Institute. ISBN 1-59047-023-0.
# Example on p.244 of Littell et al.
oranges.lm <- lm(sales1 ~ price1*day, data = oranges)
emmeans(oranges.lm, "day")
# Example on p.246 of Littell et al.
emmeans(oranges.lm, "day", at = list(price1 = 0))
# A more sensible model to consider, IMHO (see vignette("interactions"))
org.mlm <- lm(cbind(sales1, sales2) ~ price1 * price2 + day + store,
data = oranges)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.