The University of Warwick is a campus university on the edge of the city of Coventry, in the West Midlands of England, UK. As of 2017, it had around 26,000 students (of which around 15,000 were undergraduates) . The Rootes grocery store (a branch of Costcutter) is the only on-campus grocery store and stocks a wide range of food. Over the study period, it had mean term time weekly takings of £142,177. There are other outlets on campus which sell ready-to-eat meals and snacks.
A change to store layout (Intervention A) was made for January 2015, providing an in-the-field opportunity to investigate the effect of proximity and ease of access on what was purchased in store. In particular this made fruit and vegetables more prominent in the store. Fruit and vegetables were moved from the back of the store, furthest from the entrance, to the aisle closest to the entrance and also an entrance-facing display. A further change (Intervention B) was made in April 2016, replacing the entrance-facing display of fruit and vegetables with a chiller cabinet containing drinks (juices, smoothies and sugar sweetened beverages). The first change (Intervention A) was made at the same time as a store renovation including changes to the store decoration and branding. The second change (Intervention B) was the only one made at this timepoint (Additional file 3).
A database of daily sales data from January 2012 to July 2017 was obtained from Rootes grocery store. The data contained the daily total quantity sold for each product, along with the product description, price, profit, barcode, unit size and the food category. These files were imported to R software (protecting the original files). Fields in the database of interest were selected: Sale Date, Category, Product Description, Price, and Quantity sold. Other variables were added to the data frame, indicating whether the day was a day of term time or outside of term time, the number of days from the beginning of the time period being studied, and which intervention period the date fell in (as two binary variables).
Code was written into which a category vector could be entered and R would return a data frame with quantity of sales made by a particular category aggregated by day. Although the store categorised sales into 72 categories, this study focused on fruit and vegetables, which fell over two till categories: ‘Fruit and Veg’ (fruit and vegetables purchased in packaging and sold at fixed prices) and ‘Fruit & Veg Weighed’ (fruit and vegetables purchased loose and sold by weight).
The data were then aggregated by week. Analysing and modelling using weekly data produced models that were both simpler to interpret and better according to the Ljung-Box test than models using daily data. In addition, long term effects, rather than day-to-day fluctuations, were of primary interest.
As would be expected, and from visually inspecting the data and discussions with store management, university term time and holiday periods were understood to have a major effect on sales across the store. For our analyses we included only weeks that fell wholly within term time. In addition it was noted that the final week of every 10 week term had lower sales of fruit and vegetables, which is likely due to students who plan to return home for the holiday periods reducing their purchases of perishable food items. For this reason we created a dummy variable indicating the last week of every term.
The study was conducted as a retrospective interrupted time series analysis using dynamic regression. Interrupted time series analysis is a method for evaluating interventions that take place at a well-defined time point; it is particularly useful for evaluating interventions for which a randomised controlled trial is difficult or impossible, such as interventions which work at the level of a population, and for evaluating interventions retrospectively . This study analyses the effect of an intervention on a population (the customers of a university grocery store) and was conceived and carried out after the intervention had taken place (i.e. was retrospective).
Initially, a table of summary statistics was produced. One-way Analysis of Variance (ANOVA) tests were undertaken to determine whether to reject the null hypothesis of no difference in mean total sales, mean fruit and vegetable sales and proportional fruit and vegetable sales between the intervention periods.
The data frame was converted into a time series object in R using the xts package . Scatterplots of total daily sales over time, daily sales of fruit and vegetables and sales of fruit and vegetables were made using the R package ggplot2 . At this point data were interpreted visually.
A dynamic regression model was used to model the total sales and the sales of fruit and vegetables. The intervention periods were entered into the model using binary (‘dummy’) variables. Specifically, the model used was a multiple regression model with an Auto Regressive Integrated Moving Average (ARIMA) model for the errors. The regression component captures trends and dependence on other variables (the ‘external regressors’). It was observed that sales data periods close together in time had sales more similar than would be expected at random (i.e. autocorrelation). To capture this autocorrelation, an ARIMA model was used for the errors. ARIMA models are commonly used for time series data (e.g. econometric data) which show autocorrelation. A subtlety here is the inclusion of time as a regressor. ARIMA errors can capture some types of trend over time (i.e. those due to drift). However, time was also included as a regressor as beyond an effect of drift over time it might be expected that there is some underlying effect of time (e.g. due to national trends in fruit and vegetable consumption). We also included the dummy variable indicating the last week of term as a regressor. To assess the appropriateness of the model used, another analysis was performed by producing a linear model with no ARIMA component. R2 calculations indicated that these models were not preferable to the dynamic regression models used.
It was then decided to model the proportion of total sales that were fruit and vegetables, also using dynamic regression. This was to deal with the observation that the overall total quantity of items bought fluctuated greatly within the period of study, and this may mask a differential effect on fruit and vegetables. In particular, in discussion with store management, there was concern that building works on the plaza area outside the store, which led to changes in bus routes and bus stop positions, affected total sales at several points in time during the study period. Using a linear model, rather than a generalised linear model, is often considered inappropriate when the outcome variable is a proportion, as proportions are limited to between 0 and 1. However, the relationship may be close to linear away from 0 and 1. In particular, a linear form was considered to give an appropriate approximation here as all values fell within a relatively narrow range of 0.035 to 0.08 (and all but one between 0.045 and 0.08) and we are not seeking to extrapolate beyond the data. Therefore, it was felt that the distorting effects of the boundaries at 0 and at 1 could be safely ignored.
The R package forecast was used . In particular, the auto.arima function was used to select the best model, with the noted external regressors specified. When external regressors are included, auto.arima uses regression first to take into account the external regressors, then models the errors using an ARIMA model i.e. produces a dynamic regression model. The package automatically tests for seasonality, and would in this case return a seasonal model. This was considered sufficient, and although seasonality can be forced, as auto.arima tests sometimes fail to pick up on genuine seasonality, this was not considered necessary (once aggregated by week, the data did not show any great seasonality from visual inspection).
A Ljung-Box test was used to test the residuals from the dynamic regression model (this is a portmanteau test that has as null hypothesis that the autocorrelations of a time series are zero). The variance inflation factor was also calculated to check for problematic multicollinearity requiring caution in interpreting the model.
All analyses were carried out both for sales-by-quantity and for sales-by-money. Both metrics have disadvantages: Sales-by-quantity, is of interest from a public health perspective. However, there is some risk of masking or pronouncing an effect, if average pack size bought, for example, changes over the study period; Sales-by-money avoids this but may introduce problems if the price or relative price of fruit and vegetables compared with other items on sale changes over the study period. By examining the patterns in both models and checking for consistency, we can be more confident that there is a genuine underlying result.