IDEAS home Printed from https://ideas.repec.org/a/vrs/ecocul/v22y2025i1p70-80n1006.html

The Technological Bridge: R Programming’s Utility in Converting Social Media Data for Quantitative Financial Analysis

Author

Listed:
  • Litvinenko Alexey

    (University of Tartu, School of Economics and Business Administration, Tartu, Estonia)

  • Samuli Saarinen

    (Estonian Business School, Tallinn, Estonia)

  • Litvinenko Anna

    (Tallinn University of Technology, Department of Business Administration, Tallinn, Estonia)

Abstract

Research purpose. This study explores whether R programming can transform unstructured qualitative social media data into a quantitative format suitable for econometric modelling. It specifically examines how elements such as text, emojis, and sentiment from Reddit and X (formerly Twitter) can be converted into variables for regression analysis. With the aim to enhance the predictive power of traditional financial models using alternative data sources, the paper outlines comprehensive guidelines with specific technical steps, from scripting an API to extracting data from Reddit and X, through cleaning and tokenising to incorporating the data into regression models using R programming. The study addresses the growing need in financial economics to incorporate alternative data streams by offering a structured, replicable process for transforming high-volume, unstructured online content into statistically valid variables, thereby bridging the gap between qualitative market sentiment and quantitative modelling. Design / Methodology / Approach. Focusing on the methodology and R scripts, this research adopts a quantitative approach, transforming qualitative social media data into a format suitable for multiple linear and instrumental variable regression models to assess the effect of social media signals on asset prices, with GameStop (GME) and Best Buy (BBY) as case studies. The process ensures reproducibility and includes open-source code, enhancing transparency and applicability for both academic and professional financial data analysis contexts. Findings. The findings demonstrate that qualitative social media data can be quantified for financial analysis. It was effectively extracted, cleaned, and used for regression analysis. Results show that traditional market indicators fail to explain GME’s price shifts, while the frequency of rocket emojis (interpreted as speculative sentiment) was statistically significant. BBY’s returns, however, aligned more closely with market and industry indices, suggesting a lower influence of private sentiment. Originality / Value / Practical implications. The research provides a replicable method for integrating social media data into econometric models, contributing new tools for analysing market sentiment. By adapting classical financial models to modern data sources, the paper opens new directions for asset pricing research. The paper provides technical tools created in R for use in econometric analysis, useful both for academics and practitioners.

Suggested Citation

  • Litvinenko Alexey & Samuli Saarinen & Litvinenko Anna, 2025. "The Technological Bridge: R Programming’s Utility in Converting Social Media Data for Quantitative Financial Analysis," Economics and Culture, Sciendo, vol. 22(1), pages 70-80.
  • Handle: RePEc:vrs:ecocul:v:22:y:2025:i:1:p:70-80:n:1006
    DOI: 10.2478/jec-2025-0006
    as

    Download full text from publisher

    File URL: https://doi.org/10.2478/jec-2025-0006
    Download Restriction: no

    File URL: https://libkey.io/10.2478/jec-2025-0006?utm_source=ideas
    LibKey link: if access is restricted and if your library uses this service, LibKey will redirect you to where you can use your library subscription to access this item
    ---><---

    References listed on IDEAS

    as
    1. William F. Sharpe, 1964. "Capital Asset Prices: A Theory Of Market Equilibrium Under Conditions Of Risk," Journal of Finance, American Finance Association, vol. 19(3), pages 425-442, September.
    2. Carhart, Mark M, 1997. "On Persistence in Mutual Fund Performance," Journal of Finance, American Finance Association, vol. 52(1), pages 57-82, March.
    3. Pastor, Lubos & Stambaugh, Robert F., 2003. "Liquidity Risk and Expected Stock Returns," Journal of Political Economy, University of Chicago Press, vol. 111(3), pages 642-685, June.
    4. Acharya, Viral V. & Pedersen, Lasse Heje, 2005. "Asset pricing with liquidity risk," Journal of Financial Economics, Elsevier, vol. 77(2), pages 375-410, August.
    Full references (including those not matched with items on IDEAS)

    Most related items

    These are the items that most often cite the same works as this one and are cited by the same works as this one.
    1. Shafiqur Rahman & Matthew J. Schneider, 2019. "Tests of Alternative Asset Pricing Models Using Individual Security Returns and a New Multivariate F-Test," Review of Pacific Basin Financial Markets and Policies (RPBFMP), World Scientific Publishing Co. Pte. Ltd., vol. 22(01), pages 1-34, March.
    2. De Moor, Lieven & Sercu, Piet, 2013. "The smallest firm effect: An international study," Journal of International Money and Finance, Elsevier, vol. 32(C), pages 129-155.
    3. Cynthia M. Gong & Di Luo & Huainan Zhao, 2021. "Liquidity risk and the beta premium," Journal of Financial Research, Southern Finance Association;Southwestern Finance Association, vol. 44(4), pages 789-814, December.
    4. Zura Kakushadze & Willie Yu, 2016. "Multifactor Risk Models and Heterotic CAPM," Papers 1602.04902, arXiv.org, revised Mar 2016.
    5. Anton Astakhov & Tomas Havranek & Jiri Novak, 2019. "Firm Size And Stock Returns: A Quantitative Survey," Journal of Economic Surveys, Wiley Blackwell, vol. 33(5), pages 1463-1492, December.
    6. Amit Goyal, 2012. "Empirical cross-sectional asset pricing: a survey," Financial Markets and Portfolio Management, Springer;Swiss Society for Financial Market Research, vol. 26(1), pages 3-38, March.
    7. Sun, Chuanping, 2024. "Factor correlation and the cross section of asset returns: A correlation-robust machine learning approach," Journal of Empirical Finance, Elsevier, vol. 77(C).
    8. Chabi-Yo, Fousseni & Ruenzi, Stefan & Weigert, Florian, 2018. "Crash Sensitivity and the Cross Section of Expected Stock Returns," Journal of Financial and Quantitative Analysis, Cambridge University Press, vol. 53(3), pages 1059-1100, June.
    9. Rocciolo, Francesco & Gheno, Andrea & Brooks, Chris, 2022. "Explaining abnormal returns in stock markets: An alpha-neutral version of the CAPM," International Review of Financial Analysis, Elsevier, vol. 82(C).
    10. Ruenzi, Stefan & Ungeheuer, Michael & Weigert, Florian, 2020. "Joint Extreme events in equity returns and liquidity and their cross-sectional pricing implications," Journal of Banking & Finance, Elsevier, vol. 115(C).
    11. Kim, Soonho & Na, Haejung, 2018. "Higher-moment liquidity risks and the cross-section of stock returns," Journal of Financial Markets, Elsevier, vol. 38(C), pages 39-59.
    12. Skočir, Matevž & Lončarski, Igor, 2018. "Multi-factor asset pricing models: Factor construction choices and the revisit of pricing factors," Journal of International Financial Markets, Institutions and Money, Elsevier, vol. 55(C), pages 65-80.
    13. Chollete, Loran & Ning, Cathy, 2010. "Asymmetric Dependence in US Financial Risk Factors?," UiS Working Papers in Economics and Finance 2011/2, University of Stavanger.
    14. Masset, Philippe & Weisskopf, Jean-Philippe & Cardebat, Jean-Marie & Faye, Benoît & Le Fur, Eric, 2021. "Analyzing the risks of an illiquid and global asset: The case of fine wine," The Quarterly Review of Economics and Finance, Elsevier, vol. 82(C), pages 1-25.
    15. Mohammadreza Tavakoli Baghdadabad & Girijasankar Mallik & Sriram Shankar, 2026. "Market-News Co-Moments and the Cross Section of Stock Returns," Asia-Pacific Financial Markets, Springer;Japanese Association of Financial Economics and Engineering, vol. 33(1), pages 413-504, March.
    16. Mohsin Sadaqat & Hilal Anwar Butt, 2017. "Role of Liquidity in Explaining Anomalous Returns: Evidence from Emerging Market," Business & Economic Review, Institute of Management Sciences, Peshawar, Pakistan, vol. 9(3), pages 1-35, September.
    17. Sean A. Anthonisz & Tālis J. Putniņš, 2017. "Asset Pricing with Downside Liquidity Risks," Management Science, INFORMS, vol. 63(8), pages 2549-2572, August.
    18. Şahin, Baki Cem & Danışoğlu, Seza, 2022. "Ambiguity and asset pricing: An empirical investigation for an emerging market," International Review of Financial Analysis, Elsevier, vol. 84(C).
    19. Nobel Prize Committee, 2013. "Understanding Asset Prices," Nobel Prize in Economics documents 2013-1, Nobel Prize Committee.
    20. Virk, Nader Shahzad & Butt, Hilal Anwar, 2022. "Asset pricing anomalies: Liquidity risk hedgers or liquidity risk spreaders?," International Review of Financial Analysis, Elsevier, vol. 81(C).

    More about this item

    Keywords

    ;
    ;
    ;
    ;
    ;

    JEL classification:

    • C58 - Mathematical and Quantitative Methods - - Econometric Modeling - - - Financial Econometrics
    • C87 - Mathematical and Quantitative Methods - - Data Collection and Data Estimation Methodology; Computer Programs - - - Econometric Software
    • G14 - Financial Economics - - General Financial Markets - - - Information and Market Efficiency; Event Studies; Insider Trading

    Statistics

    Access and download statistics

    Corrections

    All material on this site has been provided by the respective publishers and authors. You can help correct errors and omissions. When requesting a correction, please mention this item's handle: RePEc:vrs:ecocul:v:22:y:2025:i:1:p:70-80:n:1006. See general information about how to correct material in RePEc.

    If you have authored this item and are not yet registered with RePEc, we encourage you to do it here. This allows to link your profile to this item. It also allows you to accept potential citations to this item that we are uncertain about.

    If CitEc recognized a bibliographic reference but did not link an item in RePEc to it, you can help with this form .

    If you know of missing items citing this one, you can help us creating those links by adding the relevant references in the same way as above, for each refering item. If you are a registered author of this item, you may also want to check the "citations" tab in your RePEc Author Service profile, as there may be some citations waiting for confirmation.

    For technical questions regarding this item, or to correct its authors, title, abstract, bibliographic or download information, contact: Peter Golla (email available below). General contact details of provider: https://reference-global.com .

    Please note that corrections may take a couple of weeks to filter through the various RePEc services.

    IDEAS is a RePEc service. RePEc uses bibliographic data supplied by the respective publishers.