DETERMINANTS OF CONSUMER EGG PRICES IN TURKIYE USING K-NEAREST NEIGHBORS REGRESSION ANALYSIS
M. B. Çevrimli1* , B. Mat1, M. Polat2 ,M. S. Arikan3, A. Cu. Akin4, M. A. Tekindal5 and A. Günlü1
1Department of Animal Health Economics and Management, Faculty of Veterinary Medicine, Selçuk University, Konya, Turkiye
2Department of Animal Health Economics and Management, Faculty of Veterinary Medicine, Kastamonu University., Turkiye
3Department of Animal Health Economics and Management, Faculty of Veterinary Medicine, Fırat University, Elazıg, Turkiye
4Department of Animal Health Economics and Management, Faculty of Veterinary Medicine, Mehmet Akif Ersoy University, Burdur, Turkiye
5Department of Biostatistics, Faculty of Medicine, İzmir Katip Çelebi University, İzmir, Turkiye
*Corresponding Author’s email: cevrimli@selcuk.edu.tr
Assoc. Prof. Mustafa Bahadır ÇEVRİMLİ: https://orcid.org/0000-0001-5888-242X,
ABSTRACT
Examining the factors impacting egg consumer prices in Turkiye holds significant importance. This research contributes to a deeper understanding of how specific variables influence market prices and illuminates cause-and-effect relationships in price fluctuations. The study analyzed 131 datasets from Turkiye, covering the period from January 2010 to November 2020, including various factors. The primary aim was to predict the relationships and impacts on egg consumer prices by considering variables such as laying hens feed price, the exchange rate of the US dollar, producer price indices, agricultural producer price indices, feed prices for broilers, corn, barley, and soybeans, utilizing K-nearest neighbors (KNN) regression analysis. Within the model, the consumer price of eggs showed the weakest correlation with the corn variable (r = 0.832). In contrast, the consumer price of eggs displayed the highest correlation with the US dollar exchange rate and soybean variables (r = 0.892). Therefore, it is evident that egg consumer prices are significantly influenced by the costs of raw materials for feed and currency exchange rates. Unlike other studies, this study found that the price of broiler feed also affects consumer egg prices. Thus, it is imperative for Turkiye to implement policies promoting the local supply of imported inputs essential for egg production and adopt measures to manage and mitigate exchange rate fluctuations and production expenses.
Keywords: Egg, consumer price, laying hens feed price, Dollar exchange rate, Turkiye
INTRODUCTION
Poultry represents one of the fastest-growing livestock production sectors in the rural economies of developing countries (Osti et al., 2016). In Turkiye, the poultry sector stands out as one of the most rapidly growing and suitable production models for meeting societal needs in terms of breeding and feeding practices (Turhan, 2023). Predicting egg prices, even in developed economies, is a complex phenomenon primarily driven by market forces of supply and demand and existing factors. Several key factors affecting future egg prices may include the number of laying hens in the holding, egg production levels, feed costs, the number of hatching eggs placed for replacement pullets, climate, seasonality, and export levels (Ahmad et al., 2001; Bakhtavoryan et al., 2021).
When it comes to Turkiye, studies generally approach this subject from a technical perspective, with limited economic-econometric research. The market price of a product is determined by supply and demand, as well as various factors like the prices of related goods, changes in production technology, and the prices of production inputs. Among the most influential variables affecting production input prices are the dollar exchange rate and the producer price index (Mat et al., 2020). Fluctuations in production costs can lead to supply and demand imbalances, resulting in producers selling below their production costs and consumers facing higher prices for the product. Consequently, supply shocks may occur in egg production (Gürer, 2021). Despite eggs being one of the most affordable animal food products, there are significant fluctuations in egg prices on an annual, monthly, and even daily basis (Ahmad et al., 2001; Yuhuan and Fu, 2018).
The high inflation experienced in Turkiye in recent years, along with increases in foreign exchange rates and economic fluctuations, directly impacts egg prices. This is because a substantial portion of the primary raw materials used in feed, breeding, and other aspects of egg production, such as medicines and vaccines, are imported from abroad. These negative factors contribute significantly to the overall increase in product prices. Consequently, fluctuations in both prices and production quantities have effects on both producers and consumers (Yuhuan and Fu, 2018; Sarıözkan et al., 2021).
Econometric models serve as valuable decision support tools for phased production planning in animal production within the livestock sector (Cicek et al., 2009). Over the past decade, various estimation and modeling studies, including ARIMA, MLP, SVM, VEC models, and others, have been carried out in relation to egg prices (Li et al., 2013; Chen 2019;Ihsanet al., 2022). In Li et al.’s 2013 study, chaotic neural network technology was applied for short-term egg price prediction, while Chen’s 2019 study attempted to predict factors influencing egg price fluctuations using machine learning (ARIMA). İhsan et al.(2022)sought to predict egg prices using the multi-layer perceptron (MLP) method. Additionally, it is worth noting that there is a general consensus among these studies that there is a need for more research on egg prices.
Given that KNN analysis can model non-linear relationships and is suitable for reliable forecasts even with limited observations, it is well-suited for determining egg consumer prices, which have a complex structure influenced by numerous factors. This research aims to delineate the strong and weak relationships among the factors and variables affecting egg consumer prices in Turkiye between 2010 and 2020 using KNN regression analysis.
MATERIALS AND METHODS
Dataset: In this research, a dataset comprising 131 data units was collected monthly over the period from January 2010 to November 2020. The dataset included the consumer price of eggs (TEPA, 2021) as the independent variable and the following dependent variables that may affect it: dollar exchange rate (CBRT, 2021), producer price index, agricultural PPI (TÜİK, 2021), laying hens feed price, broiler feed price, corn, barley, and soybean (TFMA, 2019). TurkStat (TUİK, 2021), the official statistical institution of Turkiye, compiles data from individuals, households, and businesses, converting it into statistical information. This information serves as a reliable basis for decision-making across various societal segments. The Turkish Egg Producers Association (TEPA), established in 2006, has been consistently monitoring and publishing egg prices since its inception. The Turkish Feed Manufacturers Association (TFMA) engages in professional, social, technical, and economic aspects, serving organizations involved in the production of all types of compound feed, and regularly publishes statistical data in these fields.
The records maintained by these institutions were utilized. Notably, broiler feed is used during the initial developmental period of laying hens. Additionally, barley is incorporated into the feed rations of laying hens to maintain body condition without body weight gain following the developmental period. Therefore, these factors were considered as independent variables potentially influencing the consumer price of eggs in Turkiye.
The dataset consists of 131 units. Employing the hold-out sampling method, 20% (26 units) of the dataset was designated as the test dataset, and these units were used to test the algorithm. Of the remaining 105 units, 20% (21 units) were allocated for validation, while the rest (84 units) were used for training.
Model of the study
Purpose of Analysis: The objective of this analysis was to elucidate the consumer price of eggs and the interrelations among various variables influencing this price. It focused on identifying both strong and weak connections between the dependent variable (egg consumer price) and independent variables, exploring interactions among these variables, and elucidating the roles of these variables.
Data Analysis Tool: The JASP Team program, an open-source statistical software known for its efficacy in data analysis and visualization, was employed.
K-Nearest Neighbors (KNN): KNN, a machine learning algorithm applicable for both classification and regression tasks, was used here for regression analysis. It identifies the closest neighbors in the training dataset for the variables under study and utilizes their values to predict the output variable (Sökün et al., 2012). The Euclidean distance metric is predominantly used for calculating distances between instances.
Distance Calculation: The Euclidean distance, a method for computing the distance between two points based on their straight-line distance in a multi-dimensional space, was utilized. Although not detailed here, this method is a fundamental concept in KNN. In KNN regression, the algorithm calculates the distance between a data point and its k-nearest neighbors (where k is a user-defined parameter), then estimates the output variable based on these neighbors.
The findings from this analysis likely offered insights into the dynamics and factors influencing egg consumer prices during the specified period. The Euclidean distance metric and KNN regression were instrumental in generating these predictions and understanding the influence of various variables on egg prices.

A simple application of KNN regression involves calculating the average of the numerical target of its nearest neighbor. KNN regression uses the same distance measurements as KNN classification (Soucy and Mineau, 2001).
Mean squared error (MSE) represents the standard deviation of the estimation errors (residues). In other words, residuals measure how far the regression line is from the data points, while root mean squared error (RMSE) indicates how spread out these residues are around the best-fitting line. RMSE values can range from 0 to ∞, with lower values indicating better performance. An RMSE value of zero signifies that the model has made no errors (Prayudani et al., 2019).
Mean absolute percentage error (MAPE) below 10% is considered “very good,” while models between 10% and 20% are classified as “good,” and models between 20% and 50% are deemed “acceptable” (Prayudani et al., 2019).
RESULTS
In this study, the K-Nearest Neighbors regression algorithm was employed, and the relationships between the variables are depicted in Figure 1.


Figure1:Regression results regarding variables
The lowest correlation was observed between the Consumer Price of Egg (dependent variable) and the Corn (independent variable) (r = 0.832). Conversely, the highest correlation was found between the Dollar Exchange Rate and Soybean variables and the dependent variable (Consumer Price Of Egg) (r = 0.892).
Nearest neighbors were identified by dividing the K-Nearest Neighbors regression algorithm datasets into three parts. The MSE verification value obtained for the test and verification performances of the model in defining the nearest neighbor was found to be 0.093 and 0.202, respectively. Since the MSE results are very close to zero, our model demonstrates excellent performance.
Table 1:Values of the most efficient model.
Method
|
Accuracy MSE
|
Test MSE
|
KNN
|
0.093
|
0.202
|
Based on the findings, when examining the R2 value, it becomes evident that the independent variables account for 85% of the change in the dependent variable. Therefore, it can be concluded that the independent variables have a high level of explanatory power for the dependent variable.
Table 2 K-Nearest Neighbors Evaluation Metrics.
Regression Algorithm
|
MSE
|
RMSE
|
MAE
|
MAPE
|

|
K-Nearest Neighbors
|
0.202
|
0.449
|
0.284
|
34.46%
|
0.85
|
Table 1 indicates that the model’s MSE is 0.202, and the RMSE is 0.449, representing the model’s spread or variance.
For significantly low forecast values, the percentage error cannot exceed 100%. However, for very high forecast values, there is no upper limit for the same error. With a MAPE value of 34.46% for our model, it can be considered to have an acceptable fit.
Finally, Figure 2 presents the relationship between the model’s estimation and the actual values, depicting the performance chart of the model’s estimation.

Figure2:Performance Chart According to Actual and Observed Values
The chart depicted in Figure 2 illustrates the distribution of error terms. The clustering of gray dots along the red line suggests that the error between actual and estimated observation values is minimal. Given this alignment of gray dots on the red line within our model, it can be concluded that our model operates with high performance.
In conclusion, our dependent variable, the Consumer price of egg, was determined and explained with an explanatory rate of 81.8%, a standard error of 0.226, and a variance of 0.475. This explanation was achieved using the following variables: laying hens feed price, dollar exchange rate, producer price index, agricultural producer price index, broiler feed price, corn, barley, and soybean, through the utilization of the Nearest Neighbors Regression method.
DISCUSSION
The estimation of egg prices is a complex undertaking. Despite being established with timely and extensive data, these models struggle to elucidate most fluctuations in egg market prices (Ahmad and Mariano, 2006). In a study examining factors such as egg price, the number of hens, and egg storage capacity for price estimation, it was found that only 37% of the egg price variation could be explained (Ahmad and Mariano, 2006).
In a study investigating the impact of long-term vacations on basic necessities’ prices in Indonesia, an analysis employing the MLP method to predict egg prices revealed that egg prices can be predicted with moderate accuracy (Ihsan et al., 2022).
A novel approach involving neural networks, a branch of artificial intelligence, was employed to predict egg prices. While the backpropagation neural network (BPNN)yielded an R2of 0.27, the general regression neural network (GRNN)produced a higher R2 of 0.73. Neural networks offer a more efficient alternative to traditional forecasting techniques, without requiring additional time and resource investments in collecting supporting data for egg price estimates (Ahmad et al., 2001). In a study conducted with the Artificial Neural Networks (ANN) method to discern the factors influencing egg price fluctuations in China, influential factors were identified as pullet price, feed price, consumer price index, and weather conditions (Chen, 2019). The factors affecting egg prices are considered to be feed prices, mortality rates, and natural gas prices, with only natural gas price showing a statistically significant effect on egg prices (Muhammad et al., 2023).
A study in Pakistan identified a positive and significant impact of crude oil prices on most food prices. A one percentage point increase in oil price led to a 0.15 and 0.25 percentage point increase in chicken meat and egg prices, respectively. The study also emphasized that increased local production significantly reduced food product prices in the long run (Zehra and Sohail, 2022). An analysis of the impact of macroeconomic variables on global food prices revealed that the oil price index has the most significant effect, especially in rapidly growing countries. Consequently, crude oil prices indirectly influence egg consumer prices (Esmaeili and Shokoohi, 2011). Another study highlighted that the most indicative factor in egg prices is the cost of feed, which fluctuates based on the proportions of corn and soybean. Additionally, foreign dependencies in feed, feed raw materials, and related products such as vaccines and antibiotics significantly impact egg prices (Osti et al., 2016). These findings align with the factors considered influential in our study.
In an econometric study, the impact of all independent variables analyzed on profit per kg of egg (Y) was found to be statistically significant (p<0.05). It was concluded that an increase of 1 TL in pullet, feed, labor, veterinary health, and other expenses, as well as a 1 unit increase in feed conversion ratio (FCR) and mortality rates, reduced profit per kg of egg in companies. Conversely, a 1 TL increase in egg sales price and a 1 unit increase in egg yield increased profit per unit (Cicek et al., 2009). In an Iranian study examining the transmission mechanism between egg prices and corn prices, it was revealed that price shocks in corn prices affected egg consumer prices in the long run between 2006 and 2017. The recent surge in corn prices in Iran has led to dissatisfaction among both consumers and producers, with higher production costs leading to increased egg prices and reduced overall consumption (Aghabeygi et al., 2021).
Although Turkiye’s poultry industry exhibits a robust production structure, it relies heavily on imported raw materials (Arıkan et al., 2019). The primary among these materials are soy and corn (BESD-BİR 2014). Turkiye falls short of meeting its consumption needs for these two inputs. Approximately 30% of corn and nearly 90% of soybean requirements are fulfilled through imports (Eşidir and Pirim, 2013). This dependency tightly correlates egg consumer prices with the costs of feed raw materials. In general, intervening in egg consumer prices becomes challenging due to the reliance on imports for essential production inputs. Consequently, Turkish egg producers are highly susceptible to price fluctuations in both domestic and export markets (Çınar and Keskin, 2018). When combined with market inefficiencies and traditional production methods, this situation may negatively impact sectoral progress, export objectives, and jeopardize food safety and national self-sufficiency (Aghabeygi et al., 2021).
A study has revealed that the amount of credit allocated to the agricultural sector, per capita income, and corn and chicken meat production levels positively influence egg production in both the short and long term. Conversely, the consumer price index exhibits a negative correlation with egg production in both time frames (Akpan and Nkanta, 2022). Examining developed countries, it is evident that they focus on demand-driven research rather than studying input-output relationships. For example, research has indicated that egg retail prices in the United States surged by 141% due to increased demand for table eggs during the Covid-19 pandemic (Malone et al., 2021). In this study, economic data were obtained from various institutions and organizations. However, limitations arise from factors such as seasonality, egg foreign trade, and the profitability of egg production enterprises due to the limited data variety and type.
Conclusion: Understanding inter-factor price spillover effects is essential for policymakers to craft effective price control policies in livestock and agricultural product markets. In this updated model for Turkiye, the main variables influencing egg prices are Corn, Soybean, and the Dollar Exchange Rate. Corn and Soybean represent the primary inputs in laying hen diets, with most of the demand being met through imports. Given that these two primary inputs are influenced by the exchange rate, the strong positive relationship between these variables and egg consumer prices becomes clearer. Policymakers should prioritize reducing production costs by subsidizing producers' input costs. For example, by increasing the production of corn and soybeans in Turkiye, foreign dependency in this regard could be reduced. Turkiye should implement incentive and production policies to stabilize egg consumer prices, secure domestic access to imported inputs, and manage or control exchange rate fluctuations.
REFERENCES
- Aghabeygi, M., F. Antonioli and F. Arfini (2021). Assessing symmetric price transmission by using threshold cointegration in Iranian egg market. Food J. 123(6): 2278-2288. https://doi.org/10.1108/BFJ-11-2018-0745.
- Ahmad, H. A. and M. Mariano (2006). Comparison of forecasting methodologies using egg price as a test case. Poul. Sci. 85(4): 798-807. https://doi.org/10.1093/ps/85.4.789.
- Ahmad, H. A., G. V. Dozier and D. A. Roland Sr (2001). Egg price forecasting using neural networks. J. Appl. Poult. Res. 10(2): 162-171. https://doi.org/10.1093/japr/10.2.162.
- Akpan, S. and V. S. Nkanta (2022). Trend analysis and macroeconomic variable determinants of egg production in Nigeria. J. Agri. Pro. 3(2): 100-109. https://doi.org/10.56430/japro.1174674.
- Arıkan, M. S., M. B. Çevrimli, A. C. Akın, B. Mat and M. A. Tekindal (2019). Cointegrationanalysis of broiler meat and broiler feed prices in Turkiye. Eurasian J Vet Sci. 35(4): 210-216. https://doi.org/10.15312/EurasianJVetSci.2019.247.
- Bakhtavoryan, R., V. Hovhannisyan, S. Devadoss and J. Lopez (2021). An empirical evaluation of egg demand in the United States. J. Agric. Amp; Appl. Econ. 53(2): 280-300. https://doi.org/10.1017/aae.2021.9.
- BESD-BİR, (2014). Tavuk Eti Sektör Raporu Beyaz Et Sanayicileri ve Damızlıkçıları Birliği Derneği. https://besd-bir.org/tr/statistikler Accessed: Jan. 11, 2022.
- CBRT, (2021). Indicative Exchange Rates, Central Bank of the Republic ofTurkiye [online]. https://www.tcmb.gov.tr/wps/wcm/connect/EN/TCMB+EN/Main+Menu/Statistics/Exchange+Rates/Indicative+Exchange+Rates Accessed: Jan. 11, 2022.
- Chen, S. (2019). Research and forecast of egg price fluctuation in China. Asian Agric. Res. 11(9): 12-16. https://doi.org/10.22004/ag.econ.300051.
- Cicek, H., A. Günlü and M. Tandoğan (2009). A study on determination of factors affecting profits with quantitative models in commercial egg production. Ankara. Univ. Vet. Fak. Derg. 56(4): 313-316. https://doi.org/10.1501/Vetfak_0000002300.
- G. and B. Keskin (2018). The spillover effect of imported inputs on broiler prices in Turkiye. New medit. 17(1): 37-47. https://doi.org/10.30682/nm1801d.
- Esmaeili, A. and Z. Shokoohi (2011). Assessing the effect of oil price on world food prices: Application of principal component analysis. Energy Policy, 39(2): 1022-1025. https://doi.org/10.1016/j.enpol.2010.11.004.
- Eşidir, A. and L. Pirim (2013). Kanatlı hayvancılık sektör raporu. Fırat Kalkınma Ajansı. Accesed: [http://www.fka.org.tr/ContentDownload/Kanatl%C4%B1%20Hayvanc%C4%B1l%C4%B1k%20Sekt%C3%B6r%20Raporu.pdf], Accessed on: 11.12.2021.
- Gürer, B. (2021). Evaluation of the supply and demand for animal products in terms of sufficient and balanced nutrition in Turkiye. Gıda. 46(6): 1450-1466. https://doi.org/10.15237/gida.GD21083.
- Ihsan, R. N., S. Saadah and G. S. Wulandari (2022). Prediction of basic material prices on major holidays using multi-layer perceptron. J. Med. Info. Budidarma. 6(1): 443-452. https://doi.org/10.30865/mib.v6i1.3508.
- JASP Team 2020. JASP (Version 0.14.1.0)[Computer software].
- Kurtaslan, T. and A. Çiçek (2001). Çorum ilinde yumurta tavukçuluğu işletmelerinin ekonomik yapısı ve yumurta üretiminin ekonometrik analizi. JAFAG. 18(1): 39-49.
- Li, Z. M., L. G. Cui, S. W. Xu, L. Y. Weng, X. X. Dong, G. Q. Li and H. P. Yu (2013). Prediction model of weekly retail price for eggs based on chaotic neural network. J. Integr. Agric. 12(12): 2292–2299.https://doi.org/10.1016/S2095-3119(13)60610-3.
- Malone, T., K. A. Schaefer and J. L. Lusk (2021). Unscrambling US egg supply chains amid COVID-19. Food Policy. 101, 102046. https://doi.org/10.1016/j.foodpol.2021.102046.
- Mat, B., M. S. Arikan, M. B. Çevrimli, A. C. Akin and M. A. Tekindal (2020). Causality analysis of the factors affecting the consumer price of veal: The case of Turkiye. Sustainability. 12(15): 6257. https://doi.org/10.3390/su12156257.
- Muhammad, A., C. Martinez and A. Lawani (2023). Why are eggs so expensive? Understanding the recent spike in egg prices. Choices, 38(2):1-8.
- Osti, R., D. Zhou, V. Singh, D. Bhattarai and H. Chaudhary (2016). An economic analysis of poultry egg production in Nepal. Pak. J. Nutr. 15(8):715-724. DOI: 10.3923/pjn.2016.715.724.
- Prayudani, S., A. Hizriadi, Y. Y. Lase and Y. Fatmi (2019). Analysis accuracy of forecasting measurement technique on random K-nearest neighbor (RKNN) using MAPE and MSE. In Journal of Physics: Conference Series (Vol. 1361, No. 1, p. 012089). IOP Publishing.
- Sarıözkan, S., A. Akçay, M. Küçükoflaz and G. Güngör (2021). The short-term impact of the Covid-19 pandemic on livestock products and feed prices in Turkiye. Ankara. Univ. Vet. Fak. Derg. 68:337–342. https://doi.org/10.33988/auvfd.774657.
- Soucy, P. and G. W. Mineau (2001). A simple KNN algorithm for text categorization. In Proceedings 2001 IEEE international conference on data mining (pp. 647-648). IEEE.
- Sökün, H., H. Kalkan and B. Cetişli (2012). Classification of physical activities using accelerometer signals. In 2012 20th Signal Processing and Communications Applications Conference (SIU) (pp. 1-4). IEEE.
- TEPA, (2021). Turkish Egg Producers Association. https://www.yum-bir.org/Yumurta/FiyatListele.aspx. Accessed: Nov. 28, 2021
- TFMA, (2019). Turkish feed manufacturers association mixed feed industry report. http://www.yem.org.tr/DosyaMerkezi/karma%20yem%20sanayii%20raporu%202019.pdf. Accessed: Nov.28,2021.
- Turhan Ş. (2023). Organic poultry in the worldand in Türkiye. Pioneer And Contemporary Studies In Agriculture, Forest And Water Issues, 131-150. ISBN: 978-625-6945-91-3.
- TÜİK, (2021). Annual industrial product statistics. https://biruni.tuik.gov.tr/medas/?kn=210&locale=tr. Accessed:Dec. 12, 2021.
- Yuhuan, W. and Q. Fu (2018). Analysis of egg price fluctuation and cause. J. Agric. Sci. 10(11): 581-587. https://doi.org/10.5539/JAS.V10N11P581.
- Zehra, N. and Sohail, F. (2022). Dynamics of food prices in major cities of Pakistan. Pakistan Institute of Development Economics: Islamabad, Pakistan.
|