# Estimate the impact of in-store product placement

I have six variables: sales (weekly), product category, customer segment, store location, week and product placement (aisle, entrance, ...). For each category, segment and location, I observe sales for different product placements. For the first three weeks, I observe "aisle", for weeks 4-6, I observe entrance and so on.

I am trying to estimate whether product placement has an impact on sales and what placement is maximizing sales. Here is a generated sample of my data in R for illustration:

library(dplyr)
library(lme4)

product_category <- c("catA", "catB", "catC", "catD", "catE")
customer_segment <- c("custA", "custB", "custC")
store_location <- c("locA", "locB", "locC", "locD")
placement <- c("aisle", "window", "wherever")

df1 <- expand.grid(product_category = product_category,
customer_segment = customer_segment,
store_location = store_location, placement = placement)

weeks <- rep(1:3, each = 15, times = 4)

df2 <- bind_cols(df1, sales = runif(dim(df1)[1], 10, 100)) %>%
arrange(store_location) %>%
mutate(weeks = as.factor(weeks))


My first idea was to use linear regression and test the significance of product placement. However, my observations are most likely not independent (in terms of time and spatially) and I decided to use a mixed effect model, in which I treat placement as fixed effect and for all the other variables I add a random intercept. I use the lme4 package in R and my code looks as follows:

df2 <- df2 %>% mutate_if(is.character, as.factor)

lme4::lmer(sales ~ placement + (1|weeks) + (1|product_category) +  (1|customer_segment) + (1|store_location), data = df2, REML = F)


I am new to mixed effect models. Is this an appropriate way of estimating the impact of product placement? Are there alternatives?

• Please edit the question to include the details of your data, and the model you are proposing. Aug 11 at 19:39
• @Rober Long, I adjusted my question. Thanks for the input! Aug 12 at 7:08

lmer(sales ~ placement + (1|weeks) + (1|product_category) +  (1|customer_segment) + (1|store_location), data = df2, REML = F)

seems to be a reasonable approach to this problem, provided that you have more categories, locations and segments than shown in your simulation. A good rule of thumb is 10. 20 is better. 6 is on the cusp of being too few. For the weeks variable, it would be better to code this as 1 through however many weeks there are in total, rather than 1-3 repeated (since 3 levels is too few to fit random intercepts).
The model will estimate fixed effects for placement which, by default, will provide 2 estimates: each one being the estimated difference in sales between each of these estimates and the reference level for placement, along with a global intercept which will contain the reference level for placement.
• If you have specific interest in the estimate for an interaction involving product_category then you would need to fit this as a fixed effect, not random. For example: sales ~ placement*product_category + (1|weeks) + (1|customer_segment) + (1|store_location) Sep 3 at 18:26