Description Usage Format Examples
A synthetic dataset on weekly ice cream sales in two locations in Amsterdam, along with air temperature. The idea is that the ice cream salesman first sold icecream in 'Oosterpark', and decided to move shop to the 'Dappermarkt' the year after. Did sales improve? This dataset can be used to show that naive conclusions from simple linear model fits can be misleading, and that the use of covariates (here, air temperature) can change conclusions about effects.
1 |
A data frame with 40 rows and 3 variables:
temperature
double Air temperature (C)
sales
double Icecream sales per week (in local currency)
location
factor Either 'Dappermarkt' or 'Oosterpark'
1 2 3 4 5 6 7 8 9 10 11 | data(icecream)
# Linear model, temperature as covariate
fit_ice <- lm(sales ~ temperature*location, data=icecream)
# Try to guess from coefficients where the sales were higher:
summary(fit_ice)
# What about now?
with(icecream, plot(temperature, sales, pch=19, col=location))
legend("topleft", levels(icecream$location), fill=palette())
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.