The Predictive Power of K-Nearest Neighbor (KNN): The Effect of Corporate Governance Mechanisms on Earnings Management

This study investigates the long-run effect of corporate governance mechanisms on earnings management of listed companies in Nigeria and Ghana. The study uses Ant Colony Optimization (ACO) and K-Nearest Neighbor (KNN) in establishing a long-run effect of good corporate mechanisms in reducing earnings management practice by corporate managers. ACO selected four major corporate governance mechanisms: Board Procedure Index, Board Disclosure Index, Ownership Structure Index, and Shareholders’ Rights Index; these were the key corporate governance mechanisms that influence the reduction in earnings management activities. KNN produced a strong significant longitudinal effect of implementing good corporate governance mechanisms in decreasing the manipulating behavior of managers. Quality corporate governance mechanisms’ implementation reduces the opportunistic behavior of corporate managers in manipulating earnings. Therefore, the study alert policymakers the urgency in setting up appropriate policies to enhance the reduction in earnings management practices to provide accurate financial information for stakeholders’ financial decision-making. The use of ACO and KNN in the study is a great novelty, which presents a calibration and prediction of the impact of corporate governance mechanisms on earnings management showing the rate of reduction.


Introduction
The implementation of Sarbanes-Oxly (SOX) Act of 2002 in the United States has led to other countries to realize the significance of quality corporate governance mechanisms implementation in lowering agency cost and maximizing shareholders' wealth. This realization has ignited several studies in emerging economies to investigate the impact of corporate governance on firm value (Sajid & Afza, 2018). To fully achieve the stated objectives of corporate enterprises as promoted by agency theory, there is a separation of controls through the avoidance of CEO duality; separating the role of CEO from board chairman role to perform their functions as strategic decision-makers and monitor the implementation of those decisions (Jensen, 1986). The board of directors (BOD) has the responsibility of setting policies for every aspect of an organization of which earnings management is not an exception. A firm with an effective corporate governance system can enhance its value by reducing the conflict of interest between minority shareholders and empowered managers of firms as well as by reducing information asymmetry, increase managerial efficiency (Audousset-Coulier et al., 2016), and enhance firm value (Johl et al., 2016).
The African continent has come a long way of institutionalizing corporate governance in organizations through economic globalization for better resource utilization and goal achievement. Although to some extent corporate governance has helped in shaping the structure and procedures of organizations, there is still more to be done to improve on corporate governance mechanisms as it is still at the infancy stage. For every investor to channel resources into any developing economy, there should be well-established corporate governance mechanisms and sound firm performance. In the study of Ruparelia (2016) as confirmed by the World Bank, poor governance is one of the main factors contributing to declining economic performance in most developing countries of which a greater portion of less performing organizations is seen in Africa. Despite reforms in corporate governance over 949537S GOXXX10.1177/2158244020949537SAGE OpenWu et al. research-article20202020 1 Jiangsu University, Zhenjiang, China 2 Takoradi Technical University, Ghana 3 Kumasi Technical University, Ghana the past years, Nigeria and Ghana had experienced turbulent times concerning its corporate governance practices, resulting in generally lower corporate profits across the economy. Arising from high profile firm failures and distresses, coupled with generally poor performance, across the banking and non-banking sectors, the credibility of the existing corporate governance mechanism has been put into question (Amidu, 2007). The numerous corporate governance scandals in the past decade in Nigeria and Ghana limited the success of regulatory reforms hindering the effectiveness of implementing quality corporate governance mechanisms. According to Atuahene (2016), cases of corporate failures are an indictment of the effectiveness of the existing corporate governance structures coupled with numerous corruption in these countries. Both public and private sector corporate managers manipulate and adjust financial reports to lure investors. A clear example is the situation that occurred in Nigeria at the beginning of 2008 stated in African Corporate Governance Network [AGCN] (2016): By the beginning of 2008 Nigeria stock market had become significantly overvalued with a price-earnings ratio of 57 (4th highest in the world at that time). More than 70%of the stock market capitalization was accounted for by the banks that had used margin loans to artificially inflate their share prices, a situation that wound up in a banking crisis in 2008-2009 following a stock market slump, and subsequent reform and reregulation of the banking sector. Hence, the relationship between managerial financial choices and institutional governance is value creation. One of the financial decision areas that managers are struggling to strike the balance between actual performance and stakeholder accepted performance is Earnings Management. Although generally accepted accounting principles (GAAP) offer an opportunity to managers in adjusting income figures either upward or downward (L. Li, 2019), the intentional alteration of financial figures reduces the reliability and relevance of disclosed accounting information which affect the decision-making of stakeholders (Sajid & Afza, 2018). Corporate managers can alter the accounting figures through the use of various accounting methods in recording financial transactions taking into account financing, investment, and operational transactions to manipulate the performance of companies (L. Li, 2019) and tends increasing information asymmetry at the expense of future cash flow (Pappas et al., 2019).
Various studies have focused on dimensions of earnings management on firm value like Sajid and Afza (2018), L. Li (2019), Yang et al. (2015), and Zhang et al. (2018) for corporate governance and earnings management research like Chen et al. (2019) and Hedwigis et al. (2016), but limited studies have been conducted in West African region. Base on the above, the study aims at assessing the impact of corporate governance mechanisms on both Accrual-Based Transaction Earnings Management (AM) and Real Transaction Earnings Management (RM) in the two main leading economies in West Africa, Nigeria, and Ghana, using Ant Colony Optimization (ACO) and K-Nearest Neighbor (KNN). The study contributes extensively to literature in three major ways. First, the study provides the extent to which corporate governance mechanisms can reduce earnings manipulation by corporate managers to lure potential investors. African countries are noted for a high level of corruption rate in their institutions; therefore, this study throws more light on the tendency of quality corporate governance implementation as a means of reducing corruption by corporate managers. Second, the use of ACO and KNN in the area of corporate governance and earnings management is a great novelty. The application of KNN to the selected variables produced a significant calibration and prediction figures for both accruals based and RM. Finally, Nigeria and Ghana are the fast-growing economies in West Africa; hence, undertaking this study will enable policy makers in formulating quality corporate governance mechanisms which will influence other countries in the same region in implementing quality corporate governance promoting reduction in the level of corruption in both public and private sector and increasing Foreign Direct Investment (FDI).
The rest of the study is organized as follows. The second section ("Literature Review") presents related literature on the study, the third section ("Method") looks at the methodology employed for the study, fourth section ("Analysis and Discussion") presents the results of the empirical analysis, and finally, fifth section (Conclusion) provides a conclusion to the study.

Earnings Management
Financial decisions taken by corporate governance bodies go a long way hampering the continuity of these firms in the African continent; one such decision is "Earnings management." According to the agency theory, separation of ownership and control gives rise to the manager's incentives to select and apply accounting estimates and techniques that can increase their wealth (Kazemian & Mohd, 2015). Accounting discretions entrenched in GAAP gives corporate managers the opportunities to adjust income figures. Applying diverse accounting methods in recording accounting figures, corporate managers can adopt a real earnings management strategy to transform the structure of operation, investment, or financing transaction to alter their companies' performance outcomes (L. Li, 2019). Real earnings management masks firm's true performance and boost the information asymmetry which may affect stakeholders' financial decision-making (Wu et al., 2016). The change in liberalization policies in emerging countries has exposed firms to manipulate financial information. Although buildup of competition among market players, because of liberalization and government deregulation, brings new opportunities for economic prosperity, corporate managers are now manipulating and adjusting the firm's performance. In this case, firms report untrue earnings to attract investors (Wu et al., 2016).
Earnings management practices generally can affect earnings quality and reduce the credibility of the firm's financial statements. Based on its intention, earnings management may bring about diverse implications on the share price of firms and their continuity. Earnings management is always associated with earnings adjustment and deceptive financial reporting practices. However, earnings management is a two-sided coin (good and bad); earnings are managed at the organizational level, to promote their credibility, boost stock prices, decrease political and social costs, and so on, while corporate managers manipulate earnings to alter their compensation plans, raise stock options values, and enhance reputation (Omar et al., 2014). The perception of earnings management being unethical by stakeholders goes a long way in affecting firms' reputation and reduces the goodwill. There are other negative effects: high litigation costs, decrease in stock prices, heightened regulatory scrutiny, and so on, and realization of these effect at some point should have deter managers from manipulating earnings (Siddharth, 2011) but has been seen as managers practice to hype firm performance in the market arena to attract investors. The study of Yang et al. (2015) discovered that financial constraints and financial distress risk can compel firms to report abnormal earnings in the period of seasoned equity offerings (SEOs) but in the long run report different performance. Therefore, auditors should watch out for firms with defective reporting intentions and helps longrun investors choose the right targets. Also, the study of Al-Shattarat et al. (2018) revealed that the manipulation of operating activities like sales, discretionary expenditures, and production costs to meet earnings target has significantly positive implications on firms' later operating performance and damages firms' good future performance, which declines operational performance in the subsequent periods. Bukit and Nasution (2015) disclose that firms that do not have effective monitoring systems in place experience earnings manipulation by managers in the period when there is the existence of employee differences and excess cash.
According to Xue and Hong (2016), cost and expense stickiness is an issue of concern and cannot be separated from managers' motivations. Their study revealed that good corporate governance can further lower cost stickiness, but has a significant effect on earnings management. Malikov et al. (2017) suggest a new approach to classification shifting whereby firms misclassify income from non-operating activities as operating revenues. The results revealed that firms that employ classification shifting of non-operating revenues increase operating revenues. They further established that firms in the period following mandatory International Financial Reporting Standards (IFRS) adoption are coupled with raise in this practice, consistent with IFRS offering wider scope for manipulation. Therefore, reduction in earnings management becomes one of the key areas of concern of which implementation of quality corporate governance mechanism is seen as one of the means to reduce opportunistic behavior of management to maximize shareholders' wealth.

Earnings Management and Corporate Governance
Corporate governance is seen as the engine of every organization. For businesses to experience growth and continuity, governance must be strongly established and enforced. Strategic decisions position the firm is attracting investors and enhances resource management. The financial decision as part of strategic decisions taken by management enables firm utilization of resources and has a long-run effect of attracting investors, maximizing firm value and continuity in the firm's operation. Therefore, presenting financial reports has consequences on managers securing their jobs and attracting or repelling investors. Unproductive managers imply unprofitable firms (Bolt et al., 2012;Wu et al., 2016); therefore, firms may report greater earnings compared to other competitors to attract investors. The works of Healy and Wahlen (1999) in the study of Wu et al. (2016) conclude that "the evidence is consistent with firms managing earnings to window-dress financial statements before public securities' offerings, to increase corporate managers' compensation and job security, to avoid violating lending contracts, or to reduce regulatory costs or to increase regulatory benefits" (p. 368). Past research has proved that pressurized firms with a high chance of bankruptcy are more prone to manipulating earnings (Beneish et al., 2012;Wu et al., 2016). Based on its intention, earnings management practices can have several consequences on the firm's share price and survivability. The implications are sometimes good for the firms, while other companies experience the bad and very ugly as it leads to total winding-up. Therefore, corporate governance mechanisms are instituted to prevent earnings manipulation by selfish managers to position the entity to meet the expectations of all stakeholders. In the study of Andreou et al. (2014), corporate governance mechanisms like independent directors, the size of the board, governance committee, and percentage of inside ownership have a significant relationship with financial management decisions and corporate performance. This aids in mitigating agency problems and improving financial management decisions in which earnings management is part of such an important decision affecting the long-run performance of the firm. Shan (2015) concluded that companies with good corporate governance practices are more likely to restrain from earnings management than those without and that there is a greater negative impact of value relevance for companies engaged in earnings management than those that do not engage in earnings management engagement. Confirmed by the study of Kazemian and Mohd (2015) using discretionary accruals as a proxy for earnings discovered that both managerial ownership and ownership concentration inhibit earnings management. Mansor et al. (2013) study supported the claim that corporate governance mechanisms are capable of reducing earnings management practice. They went on further to say that only the number of board meetings held, independence of directors, audit committee, non-duality, audit committee size, in-house internal audit function, and quality-differentiated auditors are the corporate governance mechanisms that are found to be able to assist in decreasing the earnings management activities. Also in the study of Surya and Anwar (2015), using discretionary accrual-based earnings management (AM) as a proxy discovered that there is a significant impact of corporate governance on earnings management and tax management (Mansor et al., 2013). Corporate governance mechanisms may lessen the managers' opportunistic behavior of adjusting the reported earnings. The results further reported that this behavior of managers in manipulating earnings disrupts current and subsequent firm performance.
Emerging economies studies have discovered that there is a significant influence of corporate governance on earnings management; for instance, the study of Wang and Campbell (2012) revealed that state ownership and BOD affect earnings management. However, the implementation of IFRS does not deter earnings management. Also, the number of independent directors on the board influences the reduction in earning management practice. In otherwise, the greater number on the board the more likely there would be a reduction in earnings management activities. In a recent study, Rosey and Lewellyn (2017) incorporating firm ownership predictors together with institutional dimensions explored that the diversity in firm decision-makers differs in earnings management behavior. They discovered that controlling ownership has a significant positive relation with earnings management. This relation varies-the level of minority shareholding protection weakens the relationship, while regulatory quality strengthens the negative relationship between institutional ownership and earnings management activities. Based on the above, we hypothesize the following:

Method
This research used data of nonfinancial firms listed on Nigeria and Ghana stock exchange from 2012 to 2016. This is the period of economic crises for these countries; therefore, the study assesses the influence of corporate governance mechanisms in reducing earnings management practices by opportunistic corporate managers. Data were extracted from the annual financial reports of 102 firms with total observation of 510, and firms with missing annual financial data were not added. To assess the effect of corporate governance mechanisms on earnings management of various listed firms in Nigeria and Ghana, the estimated residuals of both AM and RM were used as a proxy.

Dependent Variables
We measure our AM measure using the following modified model following the study of Zhang et al. (2018). The residuals from yearly firm estimations of Model in Equation 1 represent abnormal accrual levels and represent our AM measure: , , where the following variable is defined at the time t for the firm i: TACC is total accruals computed as earnings less cash flow from operations; TA is the total assets of the firm; GPPE is gross property, plant, and equipment; and ΔREV is a change in revenue, and ROA is the return on assets.
We measure real transactions-based earnings management (RM) by following the study of Chen et al. (2019). The residuals from yearly firm estimations of Model in Equation 2 represent abnormal expenditure level which represents our RM measure: where the following variable is defined at the time t for the firm i: DIEXP is the discretionary expenditure in the year t that is the summation of selling, distribution, administration, general, and research and development expenditure. TA is the total assets of the firm and REV is the revenue in the year t.

Independent Variables
Corporate governance mechanisms developed by Ararat et al. (2016) and Munisi and Randøy (2013) were used as the independent variables for the study. These authors investigated the corporate governance mechanisms implemented by Sub-Sahara Africa firms. Also, the study took into consideration principals of good corporate governance. Therefore, the study used five (5)  , and Shareholders' Right Index). Each index comprises of elements which are coded "1" if applicable to a firm and "0" otherwise, this is outlined in Table 2. Table 1 presents the various elements that make up each of the five (5) corporate governance mechanisms. Explanation to the five (5) corporate governance mechanisms used in the study are as follows: BSI (eight elements): elements in this index comprise the composition of BOD. One of the elements look at the key factor in developing quality corporate governance mechanisms, which is board independence (e.g., Black & Kim, 2012;Dahya et al., 2008). The ratio of independent directors on the board determines quality decision-making of the board. Also, the above index took into consideration CEO duality. CEO duality happens when CEO performs the function of CEO as well as board chairman. This brings about conflict of interest preventing the disclosure of some vital information which will enhance better decision-making of the board and stakeholders (Cornett et al., 2007).
BPI (five elements): this index took into consideration board proceedings policies, code of ethics and conduct and corporate governance policy. It also looked at the formation of sub-committees that help in undertaking the duties of the board and promote good institutional governance. One of such committees is the audit committee. It is seen as separate independent committee responsible for financial reports preparation and its compliance to reporting standards.
Disclosure Index (23 elements): disclosure of financial and non-financial information enhances good corporate governance. On the aspect of financial disclosure, one of the key elements in this index is the disclosure of firms complying IFRS in the preparation of financial report. For non-financial disclosure, the study took into consideration the disclosure of internal control information which is key for decision-making (Crawford, 2017).
OSI (five elements): The OWS consists of the percentage of ownership of controlling group; the existence of special nominating right for various classes of the share; the existences of one share one vote policy; the existence special cash flow rights for the holder of founder certificates. Difference in control group voting and cash flow rights drives self-dealing which may lead to low firm performance (Ararat et al., 2016;Claessens et al., 2002).
Shareholders' right Index (four elements): Shareholders' right is concerned with the shareholders' ability to take action. Shareholders can exercise their rights by voting (Bebchuk & Weisbach, 2009;Munisi & Randøy, 2013). Minority shareholder rights are the pivot elements in corporate governance (OECD, 2004). This index comprises four major elements: election of directors annually, the existence of trading policy, loan disbursement to directors, and the existence of investor relations officer.

Control Variables
For control variables, size, growth, firm's age, financial leverage, capital expenditure, management efficiency, and cash flow were used for the study. Prior studies have found associations between these control variables and earnings management (e.g., Larcker et al., 2007;Li, 2019).

Analysis and Discussion
Descriptive Statistics Table 4 presents the descriptive statistics of all variables. Accrued earnings management (AM) and real earnings management were the independent variables ranging from −0.62003 to 2.883044 and −5.61603 to 1.36673 all with a mean value less than 0.00, respectively. The minimum and maximum values of independent variables; ranges from BSI 3 to 8 with a mean value of 6.9, BPI 1 to 5 with a mean value of 4.2, BDI 5 to 23 with a mean value of 18.7, OWS 2 to 5 with a mean value of 3.4, and Shareholders' Rights (SHRIT) 1 to 4 having a mean value of 3.3. This clearly shows that West Africa listed firms have embraced corporate governance, it could be said that Ghana and Nigeria are still at the infant stage of corporate governance implementation. Most of the firms were not fully implementing corporate governance mechanisms as outlined by OECD (2015); this confirms the report of AGCN (2016).
The maximum and minimum (mean) values of control variables were GRTH ranges from 3.25 to 9.18 (6.66), CAPEX ranges from 0.00013 to 1.69 (0.42), FAGE ranges from I to 51 (23.3), MAEFF ranges from 0 to 2.4 (1.0), CFO ranges from −0.72 to 0.88 (0.09), SIZE ranges from 3.6 to 9.2 (6.7), and LEV ranges from −0.47 to 6.977 (0.66); this shows that more than 50% of the firms are highly leverage, which indicates that African countries rely heavily on debt in financing their business operation. Table 5 presents the Pearson correlation coefficient among independent variable-corporate governance mechanisms (BSI, BPI, BDI, OWS, and SHRIT). All coefficient values of the independent variables were less than 0.5, which shows that there was no existence of multicollinearity; therefore, further empirical analysis can be carried out.

Applying ACO in Variable Selection for Both AM and RM
AM. For variable selection using ACO, the data set was divided into five: 3 were used for training and 2 for testing. ACO was run 6 times for selecting the best variables that influence AM and RM out of the total number of 12 variables as presented in Table 3. Seven (7) variables (BDI, OWS,  (2013)   SHRIT, SIZE, FAGE, CFO, and GRTH) had a significant influence on the estimated residuals of AM as shown in Figure  1 with it various degree of influence. Out of the five (5) main corporate governance mechanisms, three (3)-BDI, OWS, and SHRIT, significantly influence AM. This means that, proper board disclosure by firms reduces AM practices. With AM, management can alter reported earnings without affecting underlying transactions as well as the related cash flows (Jie et al., 2017), which intend negatively affect firm value (Sajid & Afza, 2018). Studies have shown that effective board disclosure prevents top management from engaging in alteration of earnings (Omar et al., 2014). Therefore, adhering to proper disclosure by board prevent any fraudulent activities which corporate managers may engage in. Providing owners and other stakeholders the right financial information will help in determining the strength of earnings for better assessment of risk on investment and credit (Omar et al., 2014).  Also, ownership structure (OWS) and SHRIT of corporate governance mechanisms if well administered and implemented discourage top management from manipulating earnings to serve their best interest. The study of Djankov et al. (2008) in the works of Rosey and Lewellyn (2017) attests to the fact that to protect minority shareholders, disclosure of the required information reduces information asymmetries. The detection of private control benefits of controlling shareholders can lead to disciplinary action taken by minority shareholders against controlling shareholders; therefore, controlling shareholders may adjust earnings to avoid diversion activities (Shleifer & Vishny, 1997). Strong disclosure requirements and enforcements initiated by minority shareholder protection (Djankov et al., 2008) protect provide these investors the opportunity to discipline managers (e.g., to replace managers), putting these control systems in place can effectively reduce manipulation of true earnings by controlling owners. Age, size, growth, and cash flow of the firm determine the extent to which managers can adjust earnings. Job security and incentive payment may be among the few factors which managers use as a yardstick to manipulate earnings. Figure 2 presents independent and control variables that strongly influence real transaction earnings management (RM). For the independent variables, board procedure (BPI) and ownership structure (OWS) indexes influenced the reduction of RM practices. The BPI takes into consideration the existence of corporate governance policy, code of ethics, and the setup of the audit committee. This implies that firms that have implemented good corporate governance policy with a well-functioning audit committee tend reducing the alteration of expenditures by corporate managers. Real transaction earnings management is known to be the easiest way  to alter financial figures because it is less scrutinized by external auditors (C. Li et al., 2016); hence, corporate managers engage in to meet short-term performance targets (Ding et al., 2018). This is because detection is difficult by investors and regulators (Braam et al., 2015). The study of Al-Shattarat et al. (2018) revealed that adjustment of operating activities by managers to meet targeted earnings has a positive impact on firms' operating performance and damages firms' good future performance which declines operational performance in the subsequent periods. Therefore, audit committee functions and frequency of meeting mitigate managers the behavior of earnings manipulation. The extent to which firms use international auditing firm encourages sound financial reporting which provides stakeholders information for a financing decision. Bukit and Nasution (2015) disclose that firms that have weak monitoring systems experience earnings manipulation by managers especially in a period where there is excess cash. Although West African listed firms are still at the infant stage of corporate governance adoption and implementation, the establishment of good corporate governance policy and audit committee functions safeguard the interest of shareholders.

Application of KNN for Calibration and Prediction of Selected Variables
As ACO work based on the value of the fitness function, ACO was combined with KNN (KNN) for the classification of the variables. In this study, KNN was applied to know the extent to which the selected variables can predict their influence on AM and RM. From Table 6, the selected variables for AM had a calibration and prediction of 0.8529 and 0.7537, respectively, while selected variables for RM had 0.8137 and 0.6863, respectively. This is depicted in Figures 3 and 4. From the training set to test set, the distance is estimated and the short distance is referred to as the nearest neighbor. The optimum value of K which has the lowest error rate is used for the calibration process. The K values of KNN impact the classification rate of the final constructed model. The K parameter was evaluated from 1 to 6 and varying PC ranging from 1 to 6 was also investigated in the study. The optimum results were achieved with a    calibration rate of 81.37%, while the prediction rate was 68.63% for RM while AM produced calibration and prediction of 85.29% and 75.37%, respectively. This implies that corporate managers' activity in manipulating earnings has a shortand long-run effect on firm performance and survival. It is believed that real transaction and AM severely influence both the long-and short-run firm performance with its subsequent negative effect on the economy (Jie et al., 2017). A domestic company in West Africa is unable to survive beyond two decades; either it runs into bankruptcy or outright sale to a foreign investor. The management of resources by African nationals has been unachieved. Earnings adjustment/manipulation by managers for personal interest is the order of the day and has resulted in an unprecedented rise in corruption rate. According to the World Economic Forum 2015-2016 on global competitiveness index, for Ghana, it was discovered that the main factors hindering doing business in the country were inflation, access to finance, foreign currency, tax rate, and corruption. For Nigeria, it were inadequate supply of infrastructure, corruption, access to finance, policy instability, inefficient government, and bureaucracy. This confirms the study of Jie et al. (2017) that earnings management practices are higher for firms having weak corporate governance.
Therefore, proper and strict implementation of corporate governance mechanisms as established by OECD (2015) will position firms in these countries for quality firm operational activities and attraction of prospective investors. Prior research has shown that corporate governance mechanisms may mitigate the managers' opportunistic behavior of manipulating the reported earnings (Sajid & Afza, 2018); the positive role played by corporate governance policies restrict earnings management behavior of managers (Garva, 2015); institutional block holding and audit structure help restrict the discretionary accounting reporting by managers (Al-Najjar, 2018;Liu et al., 2017); and corporate governance mechanisms enhance financial management decisions and corporate performance (Andreou et al., 2014). For the firm to truly disclose financial reports without manipulating earnings, quality corporate governance mechanisms must be implemented and adhered to.
Furthermore, it should be noted that the economic performance of any country depends on firm performance. The discovered that only BPI, BDI, OWS, and SHRIT reduce the alteration of earnings by corporate managers. This implies that not all corporate governance mechanisms have a significant influence on reduction in earnings management activities, showing that Nigeria and Ghana are still in the infant stage in corporate governance implementation. Lack of quality corporate governance has contributed to numerous firm failures in West Africa countries and a reduction in Foreign Direct Investment (FDI) as stated by AGCN (2016). Therefore, a more comprehensive corporate governance mechanism needs to be instituted by both the public and private sectors to reposition firms to win investors' interest and reduce corruption rate.

Conclusion
This study looked at the influence of corporate governance mechanisms with other control variables on accrual-based and real transaction earnings management of firms listed in Nigeria and Ghana. Most studies used econometric models to establish the relationship between earnings management and firm value like Sajid and Afza (2018), Li (2018), and Zhang et al. (2018) for corporate governance and earnings management research like the study of Chen et al. (2019) and Hedwigis et al. (2016), but our study uses ACO and KNN chemometrics to determining the calibration and prediction of corporate governance mechanisms in reducing earnings management activities by managers. The study revealed three major corporate governance sub-indexes such as board disclosure (BDI), ownership structure (OWS), and SHRIT with other control variables such as size, age, cash flow, and growth influencing AM. For the real transaction earnings management, board procedure (BPI) and ownership structure (OWS) were the key corporate governance mechanisms that have an impact on other control variables: management efficiency, cash flow, leverage, and capital expenditure. The adherence to corporate governance policy and code of ethics as well as establishing a proper audit committee with the control of independent directors reduces the behavior of managers for manipulating earnings for their selfish interest. Corporate governance policy has not been fully adhering to by institutions in West Africa countries which may give managers the opportunity of adjusting earnings for job security and other performance incentives gain. The study also discovered that corporate governance mechanisms have a longitudinal impact on reducing the opportunistic behavior of managers in manipulating earnings. As earnings management is seen as an opportunistic activity on the side of managers, corporate governance in West Africa countries especially Nigeria and Ghana need to be well implemented to reduce the negative behavior of corporate managers. Board procedure and disclosure serve as a mechanism for establishing quality internal control to prevent managers from adjusting earnings.
Based on the above discoveries, we recommend that all West African countries should institute corporate governance rating for listed firms. Although some nations have instituted corporate governance ratings, like Nigeria, other West African countries especially Ghana, must adopt corporate governance ratings for all public and private firms to monitor their activities. For listed firms in Nigeria and Ghana to experience growth, survivability, and expansion, good corporate governance mechanisms and sound accounting principles must be implemented with periodic review. A well-structured internal audit function and audit committee, having a greater percentage of its membership as independent directors, will help scrutinize the activities enhancing reduction in earnings management practices. Furthermore, all corporate institutions in West Africa must adhere to the corporate governance principles outline by OECD (2015). To achieve this, there must be the establishment of international bodies that will see to the formulation and implementation of quality corporate governance mechanisms by West African firms. Furthermore, there are limited studies on the impact of financial manager characteristics on earnings management practices; therefore, we recommend further study in this area.

Declaration of Conflicting Interests
The author(s) declared no potential conflicts of interest with respect to the research, authorship, and/or publication of this article.

Funding
The author(s) received no financial support for the research, authorship, and/or publication of this article.