Research Question
Avocado sales are a key performance indicator for businesses in the avocado industry (Fairhurst, 2023). Understanding the relationship between avocado sales and the various factors that can affect them is essential for making good business decisions. Specifically, understanding how these factors affect sales volume can be useful for forecasting avocado demand, pricing avocados, and understanding customer behavior. This analysis can help businesses comprehend how price variations, whether avocados are organic, and other factors can affect the number of bags sold. With this information, businesses can create more effective marketing campaigns, make more informed policy decisions, and forecast the inventory levels necessary to satisfy market demands (Adams, 2023). Using multiple linear regression, this research will investigate the effects of the average avocado price and avocado type (organic or conventional) on the number of small bags of avocados sold. This research is designed to answer the following research question: Is there a statistically significant interaction between the average price, and type of avocado on the number of small bags sold in the US? To determine if the relationship is statistically significant, we will use hypothesis testing. The hypotheses are given below:
Null Hypothesis: There is no statistically significant relationship between the average price and type of avocado, and the number of bags sold.
Alternative Hypothesis: There is a statistically significant relationship between the average price and type of avocado, and the number of bags sold.
The statistical significance will be determined using the F-statistic. The F-statistic is defined as the ratio of the explained variance to the unexplained variance. For this analysis, we will assume that if the F-statistic is greater than the F-critical value of 2.6316, we will reject the null hypothesis and conclude the relationship between the independent variables and the number of small avocado bags sold is statistically significant (Kissell, 2017). The calculation for the F-critical will be given in the analysis section of this report. Additionally, the p-value and t-statistic associated with each regression coefficient will be used to determine which coefficients are statistically significant. Here, the null hypothesis states that the coefficient has no effect on the dependent variable. If the p-value associated with a coefficient is less than 0.05, the null hypothesis will be rejected, and it is concluded that the relationship between the explanatory variable and the response variable is statistically significant (Zach, 2021).
Method Justification
Statistical Technique
Multiple linear regression is a statistical technique that uses two or more independent variables to predict the outcome of a dependent variable. Similar to simple linear regression, multiple linear regression is used to model the linear relationship between the independent variables and the dependent variable (Keita, 2022). In this case, since the independent variables consist of one continuous and one categorical variable, this model will use a special type of multiple regression known as Parallel Slopes Regression (Baumer, 2021). This machine learning
technique can be used to determine if there is a statistically significant interaction between the average price, and type of avocado on the number of small bags sold. In order to correctly use this technique and obtain meaningful information from the model, there are several assumptions of multiple regression that must be considered.
The first assumption is that there is a linear relationship between the dependent and the independent variables. The general equation for a multiple linear regression is given by
$$ π= π½_0 + π½_1 π_1 + π½_2 π_2 +β―+ π½_i π_i $$
where Y is a quantitative measurement outcome, $π½_0$ is the intercept, and $π½_i$ is the πth coefficient associated with the πth variable $π_i$ (LaMorte, 2021). The second assumption is that the independent variables are not too highly correlated with each other. If the variables are highly correlated, it causes multicollinearity which can affect the estimations for the coefficients and can make the model difficult to fit and interpret (Frost, 2023). Additionally, it is assumed that the residuals are normally distributed with a mean of zero. Finally, it is assumed that the observations are selected independently and randomly. If the observations are not taken randomly, this could lead to bias and a model that is not well-fitted for the given data (Sewell, 2023).
Data Collection
The first step in the analysis was to collect the necessary data. For this analysis, the dataset must contain information about the daily average price of organic and conventional avocados and the number of small bags of each sold that day. Additionally, the dataset must be sufficiently large to train an accurate model and address the research question. The data required for this analysis is already compiled into a single dataset. This dataset, titled βAvocado Pricesβ was published by Justin Kiggins on Kaggle under an Open Data Commons Open Database License and contains all the required data and will be used for the project. According to Kiggins, the data was originally obtained from the Hass Avocado Board. A link to the Hass Avocado Board website can be found here: Since the dataset is under the
Open Data Commons Open Database License, the data is available to anyone to use, reuse, or redistribute, and requires only that the original creator is credited for it (Open Data, n.d.). Therefore, I am permitted to use the data for the Capstone Project since the appropriate citation is included.
The data was first downloaded as a .csv file from the Kaggle website. Next, the data was imported from the .csv file into a Pandas DataFrame for use in the analysis. Since no additional data is necessary, no further data-gathering steps are required. This method for obtaining data is ideal because the data is already in a comma-separated value (CSV) format, which makes it simple to import into a Pandas DataFrame. However, one disadvantage is that data obtained from Kaggle can be biased and not representative of the population (Twine, 2022). One challenge that was overcome during the data collection step was finding a dataset that contained information about the number of bags sold, the total price, and the data for which the avocados were sold.