JUSIKOM PRIMA (Jurnal Sistem Informasi dan Ilmu Komputer Prim. Vol. 6 No. Agustus 2022 E-ISSN : 2580-2879 ANALYSIS OF LINEAR REGRESSION AND TREND MOMENT METHODS IN PREDICTING SALES USING MAPE Adam Suhaidi Batubara*1. Haida Dafitri2. Ilham Faisal3 Informatics Engineering Study Program Universitas Harapan Medan Indonesia adamsuhaidi10@gmail. ABSTRACK-Sales transaction data stored in the database stores a large number of transaction records, causing the amount of data to continue to increase every day. To explore sales transaction data, data mining techniques are used. One of the goals of data mining is prediction. Prediction is basically an assumption or estimate about the occurrence of an event or event in the future. Through prediction, it is expected to minimize the influence of uncertainty from the future, so that getting results that have the least prediction error is the goal of This shows that prediction is a very important tool in planning effectively and efficiently. The discussion method used to predict sales is the time series method by using a comparison of two types of prediction methods, namely the Linear Regression method and the Trend Moment method. The use of these two methods will be a better basis for making decisions to determine which method is suitable for predicting future sales. The result of a prediction cannot always be verified in absolute 100%. Therefore, the parameters used to determine the better method are based on the smallest error accuracy rate calculated using MAPE. Based on the results of the comparative prediction analysis of the Linear Regression method and the Trend Moment method, the recommended prediction result is to use the Trend Momnet method because the resulting MAPE error value is smaller, namely 0. Meanwhile, the MAPE error value with the Linear Regression method is 1. Keywords: Prediction Accuracy. Sale. Linear Regression. Trend Moment. MAPE PRELIMINARY Sales transaction data stored in the database stores a large number of transaction records, causing the amount of data to continue to increase every day. To explore the sales transaction data used data mining Data mining uses data analysis to find patterns and relationships in the data, so that so much data can be used to predict sales in the future. The discussion method used to predict sales is the time series method by using a comparison of two types of prediction methods, namely the Linear Regression method and the Trend Moment method. The use of these two methods will be a better basis for making decisions to find out which method is suitable for predicting future sales. The results of a prediction can not always be ascertained the truth in a matter of 100% absolute. Therefore, the parameter used to determine the better method is based on the smallest error accuracy rate calculated using MAPE. Related research on sales predictions is used as supporting data in this study. Several studies related to using the Linear Regression method have been carried out, such as that conducted by. , this research produces an application that is able to display prediction results based on the input trend data. , the results obtained in this study are that the use of the Linear Regression method can be considered because the number of errors obtained in the prediction results of new student admissions for the next 1 year is not too large, namely 0. Another research conducted by. , the application of the Linear Regression method can assist business owners in predicting the amount of raw material for the production of tofu that must be produced to meet consumer demand in order to avoid excess or shortage of stock. Many studies related to using the Trend Moment method have also been carried out, such as that done by. , prediction using the Trend Moment method gives an error value of 0. 47% while the prediction of the Trend Moment method with the influence of the season index produces an error value Thus, the influence of the season index value can reduce the error value in the prediction by . This research produces a system using the Trend Moment method that can produce fertilizer sales predictions with a success rate of above 75%. Another research conducted by. , the error rate of the application system from the results of this study using the comparison value of predicted results with real data results has an accuracy rate of 98. Based on the background of the research problem that has been described, this research was conducted to compare the Linear Regression method with the Trend Moment method in determining the most appropriate method used to predict sales. The parameter used to determine the better method is based on the smallest error accuracy rate calculated using MAPE. From this description, the authors are interested in conducting research with the title "Analysis of Linear Regression and Trend Moment Methods in Predicting Sales Using MAPE". JUSIKOM PRIMA (Jurnal Sistem Informasi dan Ilmu Komputer Prim. Vol. 6 No. Agustus 2022 RESEARCH CONTENT The discussion method used to predict sales is the time series method by using a comparison of two types of prediction methods, namely the Linear Regression method and the Trend Moment method. The use of these two methods will be a better basis for making decisions to find out which method is suitable for predicting future sales. The results of a prediction can not always be ascertained the truth in a matter of 100% absolute. Therefore, the parameter used to determine the better method is based on the smallest error accuracy rate calculated using MAPE. Prediction . is an attempt to guess or predict something that will happen in the future by utilizing various relevant information at previous times . through a scientific method. Through prediction, it is expected to minimize the influence of uncertainty from the future, so that getting a result that has the minimum prediction error is the goal of prediction. This shows that prediction is a very important tool in effective and efficient predictive usefulness is seen at the time of decision making. A good decision is a decision based on considerations that will occur when the decision is implemented. Predictions can be classified based on the future time horizon they cover. In relation to the time horizon, predictions are divided into several categories, namely short-range forecasts, mediumrange forecasts, and long-range forecasts. The Linear Regression method is based on the pattern of relevant data relationships in the past. In general, the predicted variable, such as inventory, is expressed as the variable sought. This variable is influenced by the magnitude of the independent The relationship that occurs between the independent variable and the variable sought is a function . Simple Linear Regression Notation which is a straight line pattern is expressed by using equation . Where: : is the predicted variable . : is the independent variable aand b : is a parameter or regression coefficient To get valueaand b, then equation . and equation . are used. Where is the valueais the slope, b is the intercept and n is the number of data used in the calculation. MethodTrendMomentor often called Secular Trend is a Time-Series prediction method that adjusts E-ISSN : 2580-2879 the trend line on a set of past data and then is projected in a line to predict the future for short-term or longterm predictions. If the thing being studied shows symptoms of an increase, the trend that is owned shows an average increase, often called a positive trend, but if it shows symptoms that are decreasing, the trend that is owned shows an average decline or is also called a negative trend. The advantage of the Trend Moment method compared to other methods lies in the use of the X parameter that is used, so there is no difference whether the data used is an even or odd number of historical data, because the value in the X parameter always starts with a value of 0 as the first order. Trend Moment is calculated by equation . Where: Y: value trend a : constant number slopeor skew coefficient X: time index To calculate the values of a and b, equation . and equation . are used. Where: : average demand per time period : the sum of the time periods n: number of data After the predicted value that has been obtained from the prediction results with the methodTrending Momentwill be corrected for seasonal effects using the seasonal index. Season index calculation. in equation . To get the final prediction result after being influenced by the season index, equation . Where: Y*: prediction results using the method Trending Momentinfluenced by the season Y: prediction result using Trending Moment In general, the error is calculated based on the difference between the actual . value and the value generated by the prediction method. Mean Absolute Percentge Error (MAPE) is the percentage calculated from the absolute value of the error in each period and divided by the actual amount JUSIKOM PRIMA (Jurnal Sistem Informasi dan Ilmu Komputer Prim. Vol. 6 No. Agustus 2022 of data for the period then find the average error. MAPE value can be calculated using equation . Where : : data in period t : forecast for period t n: total number of periods || : absolute value 1 Results and Discussion There is research on sales data, which is data that must be available to carry out the prediction process, therefore this prediction system will use actual sales data for the last 1 year starting from the period of January 2019 to the period of December The following is a representation of actual sales data drinks for a period of 1 year from January 2019 to December 2019 as shown in table 1. Table 1. Beverage Sales Data for 2019 Beverage Type Cof Dalgo fee Coffe Cinna Spice Month Mil Coffe Coffe Avoc Mocha Coffee January Februar March April May June July August Septem Octobe Novem Decem Predictive analysis in this study uses a comparison of the Linear Regression method and the Trend Moment method. The prediction results will then calculate the error accuracy level using MAPE (Mean Absolute Percentage Erro. , this is done to determine the most appropriate method used to predict sales. The parameter used to determine the better method is based on the smallest error accuracy rate calculated using MAPE. E-ISSN : 2580-2879 2 Prediction Analysis of Linear Regression Method Completion methodLinear Regressionstarting with inputting sales data and month period as input data to be processed. Next, the constant a and the regression coefficient b are calculated to get the regression equation. From the results of the regression equation is used to obtain the results of sales predictions in the next period. The prediction results will also calculate the error value using the MAPE method to determine the level of accuracy of the prediction results. In the calculation of the results of this sales prediction, the results of manual calculations will be exemplified by taking one of the types of food and beverage data in table 2 Table 2. Beverage Sales Data Pieces for the Year 3 3 3 4 4 4 4 3 3 3 4 4 0 1 9 0 2 1 1 5 7 7 1 2 4 5 4 8 0 7 0 6 8 5 0 1 From table 2 you can find the values for XA. YA. XY and the total of each value in table 3. Table 3. Calculation Results of X2. Y2 and XY Values of Dalgona Coffee Amoun Perio Month Sales (X) (Y) January February 9 15523 1182 March 16 16646 1632 April 25 17640 2100 May 36 17388 2502 June July August Septemb October Novemb Decemb JUSIKOM PRIMA (Jurnal Sistem Informasi dan Ilmu Komputer Prim. Vol. 6 No. Agustus 2022 Total E-ISSN : 2580-2879 The last step is to calculate the accuracy valueerrorMAPE by using equation . After obtaining the total value of X2. Y2 and XY, then the next step is to calculate the value of the regression coefficient . using equation . Based on the results of calculations using the Linear Regression method, the prediction error value based on MAPE is 1. Then calculate the value of constant . using equation . Create a linear regression equation model using equation . , so that it becomes: After the linear regression equation model is obtained, the next step is to make predictions. The following is the result of the prediction calculation using the Linear Regression method. Do the same thing until x=24 Table 4. Prediction Results of Dalgona Coffee Beverage Sales Using Linear Regression Method Moon Actual Predicti Results Period Data Rounded (X) (A. January 421,727 February March April 439,139 May June July August Septembe 468,160 October 473,965 Novembe 479,769 December Total () 5443,80 3 Prediction Analysis of Trend Moment Method In the analysis of the process, the use of the Trend Moment prediction method requires input of past sales data . istorical dat. After obtaining these data, predictions are then calculated based on the Trend Moment method. In the calculation of the results of this sales prediction, the results of manual calculations will be exemplified by taking one of the drink type data in table 5. Table 5. Amount and Average Sales of Dalgona Coffee Tim Total Yea Month Sales Inde (Y) (X) Januar Februa 2019 March April May June July August 2019 Septem 2019 Octobe 2019 Novem 2019 Decem 2019 Quantity (O. Average Based on the data that has been obtained previously in table 5,then the sales prediction results will be calculated using the Trend Moment method with equation . To find the values of a and b in the Trend Moment formula, equations . are used. JUSIKOM PRIMA (Jurnal Sistem Informasi dan Ilmu Komputer Prim. Vol. 6 No. Agustus 2022 After the values of a and b are known, the next step is to enter the process of determining the value of Y or Trend with equation . It is known that the value of a = 352. 0769 and b = 5. 804196 and the value of x = 12 which is a time index calculated from January 2019 to December 2019. rounded to 428 x=24 After that the prediction results obtained from the trend values above will be calculated using the season index. Based on the season index formula in equation . the calculation results will be To get the final prediction results after being influenced by the season index, equation . is used, the calculation results will be obtained as follows: Table 6. Dalgona Coffee Beverage Sales Prediction Results Using the Trend Moment Method Moon Actua Predictio Results Period l Data Rounded (X) (A. January 304 338,4264 February March April May June July August Septembe 378 375,2224 October 375 379,8174 Novembe 410 384,4124 Decembe 421 389,0074 Total () After the prediction results are obtained, the error accuracy level is calculated using MAPE using equation . so that the following results are obtained: The error value of the prediction accuracy with MAPE is: Based on the results of calculations using the Trend Moment method, the error value of the prediction results based on the MAPE method is E-ISSN : 2580-2879 After calculating the predictions using the Linear Regression method and the Trend Moment method and calculating the error value of the prediction results using MAPE, then a comparison of values is carried out to determine the recommended method in determining the sales prediction results for the coming period. Table 7. Prediction Result Comparison Predictio Trend n of Moment Moon Actual Linear No. Method Period Data Regressi Predictio n Results Method January 304 421,7273 338,4264 February March April 408 439,1398 352. May June July August September 378 468,1608 375,2224 October 473,965 379,8174 November 410 479,7692 384,4124 December 5734 389,0074 MAPE Error Value 1. Based on table 7, it can be concluded that the best recommended method for predicting sales is the Trend Moment method based on the smallest MAPE error value. System implementation is the execution stage of the system design that has been made into program code . ource cod. so that a sales prediction system application can be produced using a comparison of the Linear Regression method with the Trend Moment method which is ready to be used in accordance with the functions that have been set at the system analysis and design stage. Image 1. Linear Regression Method Prediction Results Display Figure 1 is a display of sales prediction results using the Linear Regression method. The results of sales predictions for the following year period are obtained with a MAPE error value of JUSIKOM PRIMA (Jurnal Sistem Informasi dan Ilmu Komputer Prim. Vol. 6 No. Agustus 2022 While the prediction results using the Trend Moment method can be presented in Figure 2. Figure 2. Trend Moment Method Prediction Results Display Figure 2 is a display of sales prediction results using the Trend Moment method. The results of sales predictions for the following year period are obtained with a MAPE error value of 0. After the prediction results have been obtained for each of the Linear Regression and Trend Moment methods, the next step is to compare the results of the two methods with the aim of finding out which prediction results are more effective to apply based on the smallest MAPE error value. Figure 3. Comparison Result Analysis Display Based on Figure 3, it can be explained the results of the comparison of the sales prediction method, where the results of the recommendation for the best method to make predictions use the Trend Moment method because the resulting MAPE error value is smaller than the Linear Regression method. System testing in this study was conducted to determine the comparison of the results of sales predictions using the Linear Regression method and the Trend Moment method, so that it can be seen which prediction method will be used as a reference in making decisions to determine the results of sales predictions in the coming period. No. Table 8. System Test Results MAPE MAPE Best Menu Linear Trendin Method Type Regress Results Moment Dalgona 511 % 0. Trending Coffee Moment Fried Enoki Mushroo French Coffee Milk Boba E-ISSN : 2580-2879 Trending Moment Trending Moment Trending Moment Based on the results of the system test in table 8 using the four types of menus tested, the conclusion is that the best method that will be used as a reference for predicting the level of sales in the coming period is by using the Trend Moment method. This is based on the MAPE error value of the Trend Moment method which is smaller than the MAPE error value of the Linear Regression method. CONCLUSION Based on the analysis of sales predictions with a comparison of the Linear Regression method and the Trend Moment method, the following conclusions can be drawn: The accuracy of sales predictions can be measured by the standard error of prediction, from which the prediction method will be chosen which has a value of errorthe smallest between the Linear Regression method and the Trend Moment method used. The parameter used to determine the better method is based on the smallest error accuracy rate calculated using MAPE. Based on the results of the prediction analysis method comparison Linear Regressionand the Trend Moment method, the recommended prediction result is to use the Trend Momnet method because the resulting MAPE error value is smaller, namely 0. While the MAPE error value with the Linear Regression method is The study resulted in a prediction system application with a comparison of the Linear Regression method and the Trend Moment method that can be used to predict the number of sales for the next one year period, so that the recommendations for improvements made by management and as a means of determine future business strategy CLOSING Based on the research that has been done as a closing some suggestions for further application development include the following. This application needs to be developed by adding other prediction methods so that it can get the best prediction results JUSIKOM PRIMA (Jurnal Sistem Informasi dan Ilmu Komputer Prim. Vol. 6 No. Agustus 2022 E-ISSN : 2580-2879 The calculation of the level of error accuracy in the application only uses MAPE, so it is expected to use other methods such as MSE or MAD. BIBLIOGRAPHY