Beneish's M-Score and Altman's Z-Score for analyzing stock returns of the companies listed in the S&P500
This article was written by the winner of 2021 Q2 Refinitiv Academic Competition. It is aimed at Academics from Undergraduate level up.
This article aims to study the stock returns of companies that are likely to have manipulated their earnings and that are in a difficult financial situation (higher probability of bankruptcy). To that aim, the Beneish M-Score and the Altman Z-Score models are employed for the companies listed in the S&P500 using the data obtained from LSEG Data Library for Python (Data Library version 2, aka LSEG Data Library) from 2010 to 2025.
Using the original cut-offs defined by the creators of the respective ratios, the results show that those companies that are more likely to have manipulated their earnings obtain an average of 207 basis points (BPS) less every year, while those that have a higher chance of bankruptcy obtain an average of 132 less BPS each year. However, when combining the two models the results obtained are an average of 862 BPS each.
In addition, by using the quintiles across each sector every year, the results obtained show that those companies in the fifth quintile of their sector’s m-score and in the first quintile of their sector’s z-score produce an average of 308 BPS less each year. Thus the z-score and the m-score can be useful for selecting better performing stocks.
- LSEG Workspace Desktop application with access to Data Library.
- Python.
- Access to internet for PyPI (or your local Python packages repository).
Please contact your LSEG Account Manager or Representative to help you get the Workspace account and services.
The Data Library for Python provides a set of ease-of-use interfaces offering coders uniform access to the breadth and depth of financial data and services available on the Workspace, RDP, and Real-Time Platforms. The API is designed to provide consistent access through multiple access channels and target both Professional Developers and Financial Coders. Developers can choose to access content from the desktop, through their deployed streaming services, or directly to the cloud. With the Data Library, the same Python code can be used to retrieve data regardless of which access point you choose to connect to the platform.
The Data Library are available in the following programming languages:
For more deep detail regarding the Data Library for Python, please refer to the following articles and tutorials:
This project is based on Data Library Python versions 2.1.1.
-
Open a Command Prompt and go to project's folder
-
Run the following command in a Command Prompt to create a Python virtual environment named venv for the project.
$>python -m venv venv
-
Once the environment is created, activate a virtual environment named
venv
with this command in a Command Prompt$>venv\Scripts\activate
Or
$>source ./venv/bin/activate
-
Go to project's notebook folder and update a content in
lseg-data.config.json
file with the your App-Key{ "logs": { "level": "debug", "transports": { "console": { "enabled": false }, "file": { "enabled": false, "name": "lseg-data-lib.log" } } }, "sessions": { "default": "desktop.workspace", "desktop": { "workspace": { "app-key": "YOUR APP KEY GOES HERE!" } } } }
-
Run the following command in a Command Prompt to install the project dependencies
$>(venv) pip install -r requirements.txt
-
In the current Command Prompt, go to project's notebook folder. Run the following command to start Jupyter Lab in the notebook folder.
$>(venv)>jupyter lab
-
Open ArticleMartinZornoza_3.1_LD.ipynb Notebook file, then follow through each notebook cell.
Note: If you are using AnaConda/MiniConda, please refer to this Conda - Managing environments document for more detail about how create and activate environment with Conda.
You can find more detail regarding the Data Library and related technologies for this Notebook from the following resources:
- LSEG Data Library for Python on the LSEG Developer Community
- Data Library for Python - Reference Guide
- The Data Library for Python - Quick Reference Guide (Access layer) article.
- Essential Guide to the Data Libraries - Generations of Python library (EDAPI, RDP, RD, LD) article.
- Upgrade from using Eikon Data API to the Data library article.
- Data Library for Python Examples on GitHub repository.
For any question related to this example or Data Library, please use the Developers Community Q&A Forum.