## wpiea2024165-print-pdf

## Source details

**Canonical URL:** [wpiea2024165-print-pdf](https://www.imf.org/-/media/files/publications/wp/2024/english/wpiea2024165-print-pdf.pdf)

## Other formats

- [Markdown version](/-/media/files/publications/wp/2024/english/wpiea2024165-print-pdf.pdf.md)
- [Structured JSON version](/-/media/files/publications/wp/2024/english/wpiea2024165-print-pdf.pdf.json)

---

### Background and objective
- Canada’s muted productivity growth has raised concerns that the Canadian investment climate is weakening relative to comparator countries.
- Project aims:
  - assess how public perception of Canada’s investment climate encourages or discourages private investment;
  - assess how perceptions have evolved over time;
  - compare perceptions to international comparators.
- Focus: public perceptions as a determinant of private investment decisions; perception indices do not necessarily reflect actual policy changes.

### Novel NLP-based indicator: purpose and advantages
- Uses sentiment analysis of Twitter replies to official institutional tweets (e.g., Bank of Canada, Natural Resources Canada).
- Keyword search strategy based on a glossary containing keywords of survey-based indicators (see Annex II in source).
- Advantages over survey-based indicators:
  - Less sensitive to biases of expert and authority respondents.
  - Real-time indicator versus large update intervals for surveys (example: OECD PMR every five years).
  - Easily adjustable to cover additional and more nuanced dimensions.

### Data and methodology (preserved specifics)
- Twitter platform context:
  - "540 million users" globally.
  - Canada: one-quarter of Canadian internet users and "35.2%" of social network users use the platform regularly.
  - United States comparable figures in source: "19.5%" and "27.9%".
  - User growth predictions in 2023: "2.7% in Canada" and "1.9% in the United States".
- Model training and classification:
  - Sentiment model: Twitter-roBERTa-base (fine-tuned on more than "124 million tweets" from January 2018 to December 2021).
  - Model accuracy: "about 72%".
  - Reference to a state-of-the-art algorithm trained on "approximately 58 million tweets".
- Sample and extraction:
  - Final sample: "over 7500 official tweets" and "approximately 12500 replies or retweets".
  - Average replies per official tweet: "1-2 replies".
  - Time coverage: early 2017 to end of 2022.
  - Focused dimensions: competition, governance, and infrastructure.
- Four-stage methodology:
  - Stage 1: Data collection (verified official Twitter accounts; Full-Archive Search API).
  - Stage 2: Topic identification (keyword list from survey-based indicators; only tweets with at least one keyword retained).
  - Stage 3: Comment extraction (comments/quotes retrieved via API).
  - Stage 4: Sentiment analysis (Twitter-roBERTa-base model; labels: positive, negative, neutral; aggregated into annual series).

### Comparison with survey-based indicators
- Survey-based indicators used:
  - OECD Product Market Regulation (PMR).
  - Worldwide Governance Indicators (World Bank) and Corruption Perception Index (Transparency International).
  - International Country Risk Guide (ICRG).
  - Fraser Institute Annual Mining Survey.
- Key survey-based findings (preserved wording):
  - "Regulatory barriers appear to be above the OECD average," with weaknesses in public procurement, SOE governance, and licensing of new entrant businesses.
  - Licensing regime lacks a one-stop shop and "no 'silence is consent rule'".
  - Governance indicators are "strong, but there are signs of slippage in recent years."
  - Fraser Institute: Canada's median PPI decreased by "almost 8 percentage points" from 2021 to 2022 (rank fell from rank one in 2021 to rank four in 2022). Canada ranked second most attractive region in 2022 after Australia for investment attractiveness; Best Practices Mineral Potential Index ranked Canada first in 2022.

### Key empirical findings from the NLP indicator
- Competition
  - Total tweets related to competition increased "nearly five-fold from January 2017 to December in 2022".
  - The negativity ratio (negative comments over total comments) "has been on the rise and almost doubled over the same period".
  - Notable dip in negativity ratio in 2021 (likely Covid-19 temporal effects).
- Governance
  - Total number of tweets related to governance grew rapidly prior to 2021; number of comments "more than tripling since 2017".
  - Ratio of negative comments peaked during the pandemic; negative perceptions declined from a peak of "0.27 in 2020" to "0.06 in 2022".
- Infrastructure
  - Significant attention to infrastructure; total comments showed a "significant uptick until 2020".
  - The negativity ratio for infrastructure is "relatively stable" but tends to be above ratios for competition and governance.
  - Methodological caveat: replies are categorized by original tweet topic, which can misattribute sentiment.
- Indigenous policies and mining
  - "Indigenous" was the keyword with the most attention during the sample period.
  - Attention peaked in 2022 at "almost 1500 tweets" (about three times the maximum number for the next-most-attended keyword, infrastructure).
  - Unfavorable views of indigenous policies remained "relatively unchanged from 2017 to 2022"; negativity ratio similar to other categories.
  - Findings align with Fraser Institute concerns about policy uncertainty (disputed land claims, protected areas, environmental regulations) as deterrents to mining investment.

### Robustness checks and cross-country analysis (Canada vs United States)
- U.S. sample: "over 9000 tweets" from official institutions and "28772 responses".
- Competition: 2022 negativity ratios in Canada and the U.S. were "around 0.4".
- Governance:
  - U.S. negativity ratio trend: decreased from "0.65 to less than 0.3 in 2019" then rose to "0.6 in 2021".
  - Overall level of negativity ratio is "significantly larger in the United States", consistent with Worldwide Governance Indicators showing lower U.S. scores across six governance categories.
- Infrastructure: 2022 negativity ratios—United States "0.33" vs. Canada "0.42".

### Productivity and investment context (exact figures)
- Labor productivity growth:
  - Early 2000s: labor productivity averaged "1.17 percent" (third lowest among G7 countries).
  - From "2015–22": labor productivity growth dropped to "0.18 percent".
  - G7 average for "2015–22": "0.39 percent".
  - U.S. labor productivity growth in "2015–22": "0.68".
  - U.K. labor productivity growth in "2015–22": "1.13".
- Multifactor productivity (MFP) growth "lagged, and remained below the G7 average."
- Gross fixed capital formation:
  - Now in the "lowest quartile of OECD countries".
  - Labor productivity "deteriorated significantly compared to U.S. and G7 levels, and is now close to the OECD average."
- Potential drivers referenced:
  - Complete internal trade liberalization could increase GDP per capita by "4 percent" (Alvarez et al., 2019).
  - High inter-provincial non-tariff barriers (OECD, 2023).
  - Increase in the share of "zombie firms" (Amundsen et al., 2023).
  - Capital misallocation during house price booms (Liu, Lutz & Yang, forthcoming).
  - Other factors: financial frictions and high leverage; capital misallocation; suboptimal infrastructure; economic uncertainty; pandemic-related learning and productivity losses.

### Econometric analysis linking perceptions to investment flows (panel regressions)
- Purpose: examine impact of investment climate measures on Δ ln (GFCE) it (percentage change in gross fixed capital formation).
- Specification: standard economic controls (changes in real interest rates, real GDP growth, inflation, general government debt, etc.) and investment-climate variables (voice and accountability, political stability, government effectiveness, regulatory quality, rule of law, control of corruption, size of government, legal system and property rights, sound money, freedom to trade internationally, economic regulation).
- Causality caveat: results indicate correlation; lags used but endogeneity remains a concern.
- Summary baseline regression results (Appendix Table 4 referenced in source):
  - Observations: 668
  - R-squared: 0.1  0.348
  - Number of c: 32
  - Country FE: YES/NO across specifications
  - Year FE: YES/NO across specifications
  - Selected coefficient magnitudes (across Models 1–4): Short-term interest rate: 0.0; 0.0512; 0.815; 0.747. Real GDP: 1.3; 3.487; 5.233**; 7.305***. Consumer prices: -0.2; 0.0664; 0.102; 0.179. General government debt, % of GDP: -0.1; -0.0873; -0.147*; -0.125*. Total Terms of Trade: 0.3***; 0.302***; 0.194***; 0.236***. Real Exchange Rate: -0.0***; -0.0373***; -0.0367***; -0.0330***. VIX Index: -0.0***; -0.00460***; 0.00815***; 0.00998***. Federal Funds Rate: -0.0***; -0.0220***; -0.0513***; -0.0566***. Constant: 0.1***; 0.0995***; -0.236***; -0.295***.
- Role of global factors: tighter US monetary conditions and higher global risk aversion are major adverse correlates of investment; improved terms of trade tend to increase gross fixed capital formation; exchange rate depreciation has the opposite effect. Domestic factors generally of lower importance; real GDP and government debt significant mainly in later specifications.
- Adding third-party investment-climate indicators (text summary):
  - Economic policy uncertainty: negative and significant in some specifications; insignificant when country and year fixed effects included.
  - Worldwide Governance Indicators: government effectiveness and control of corruption associated with increases in capital formation; regulatory quality shows negative and significant coefficients in most specifications.
  - ICRG risk ratings: insignificant in all specifications.
  - Results broadly robust to alternative specifications excluding post-Covid episodes or focusing on G7 countries.

### Appendix Table 5: Regression results (sample: OECD countries, 2020-2022)
- Observations: 303
- R-squared: 0.4  0.240
- Number of c: 16 16 16 16
- Country FE: YES NO YES NO
- Year FE: YES NO NO YES
- Selected coefficient highlights (Models 1–4, coefficients with robust SE in parentheses):
  - Real GDP: Model 1: 0.0** (0.0); Model 2: 0.00689*** (0.00183); Model 4: 0.00875*** (0.00153).
  - Consumer prices: Model 2: -1.017*** (0.334); Model 3: -1.834*** (0.183).
  - General government debt, % of GDP: Model 1: -0.1** (0.0); Model 3: -0.120* (0.0644); Model 4: -0.0702*** (0.0259).
  - Total Terms of Trade: Model 2: 0.254*** (0.0959); Model 4: 0.178** (0.0800).
  - VIX Index: Model 1: 0.0*** (0.0); Model 3: 0.00568* (0.00315); Model 4: 0.0202*** (0.00521).
  - Economic Policy Uncertainty Index: Model 2: -0.181*** (0.0569); Model 3: -0.197*** (0.0578); Model 4: 0.0684 (0.0494).
  - Government Effectiveness (WWG): Model 1: 0.0** (0.0); Model 2: 0.00711* (0.00427); Model 3: 0.00903** (0.00365); Model 4: 0.0121** (0.00566).
  - Regulatory Quality (WWG): Model 1: -0.0* (0.0); Model 2: -0.000576* (0.000348); Model 4: -0.000492** (0.000234).
  - Control of Corruption (WWG): significant at * in several models (e.g., Model 2: 0.0126* (0.00734)).

### Machine-learning analysis: random forest
- Purpose: explore relative importance of many predictors and capture non-linear patterns and interactions.
- Dependent variable: binary = 1 in periods of positive real gross capital formation, 0 otherwise.
- Predictors: investment climate measures (WWG, ICRG, economic freedom index and decompositions) and standard economic controls (real interest rate, real GDP growth, inflation, general government debt, terms of trade, real exchange rate, current account, federal funds rate, VIX, economic policy uncertainty).
- Training/testing and evaluation:
  - Training set: 80%; test set: 20% reserved.
  - Tenfold cross-validation on training data.
  - Performance metrics: F1 score and ROC AUC.
  - All models (whole sample, OECD, non-OECD) achieve F1 scores ranging from 0.80 to 0.90.
  - Hyperparameter tuning performed to maximize AUC-ROC.

### Random forest: feature importance findings
- Variable importance scores (scale 0–100).
- Whole-sample (163 countries: 36 OECD, 127 non-OECD)
  - GDP growth is the single most important factor predicting investment flows.
  - VIX volatility index ranks second in whole sample and OECD sample.
  - For non-OECD countries, composite risk index (geopolitical risk) plays a major role.
  - High-importance investment climate factors: Size of government; Government effectiveness; Rule of law; Regulation; Political stability.
- Non-OECD specific:
  - Debt-to-GDP ratio important following composite risk and GDP growth.
- Decompositions of economic freedom:
  - First-tier decompositions include Size of government; Legal system and property rights; Sound money; Freedom to trade internationally; Regulation.
  - For OECD countries: inflation (particularly recent years) critical in explaining investment flows.
  - For non-OECD countries: transfers and subsidies, integrity of the legal system, and capital flows are key.
- Visualizations referenced: Appendix Figures 1–4 present variable importance scores and decompositions.

### Policy-relevant implications
- Convergence of survey evidence and NLP analysis indicates room for policy improvement in competition policy and some governance areas to help boost private investment.
- Targeted regulatory modernization actions noted in context:
  - Targeted Regulatory reviews since 2018.
  - Competition Bureau budget increase of "$96 million" over five years committed in 2021.
  - Targeted amendments to the Competition Act in June 2022 and competition act review launched in November 2022.
- Empirical link: public perceptions—as captured in high-frequency NLP indicators—matter for actual investment outcomes (annex regression and random forest results align with literature finding perceptions matter for investment).

### Limitations and directions for future research
- Measures of perception do not necessarily reflect actual policy changes; perceptions can move with revelations that may signal functioning checks (e.g., corruption cases).
- Twitter-specific caveats:
  - Influence of Twitter bots.
  - Representativeness of Twitter users uncertain; extreme views may be overrepresented.
  - Evolving user base and unavailable demographic detail.
  - No significant difference in overall negativity ratio between existing users and new users in sample: "28.2% vs. 25.3%".
- Methodological caveat: tagging replies by original tweet topic can misattribute sentiment to topics.
- Data/sample limitations: limited Twitter sample period "2017-2022"; some trends may reflect Covid-19 effects.
- Future research: use large language models (e.g., GPT) to capture fuller range of emotions and cultural nuances.

*Source: wpiea2024165-print-pdf - Introduction; Conclusions; Appendix Table 5*

### Introduction ...........................................................................................................

### Introduction

### Table of contents and major themes
- Introduction ......................................................................................................................................................... 3
- What Do Survey Based Indicators Tell Us? ........................................................................................................ 7
- Regulatory Barriers to Firms Entry and Competition ....................................................................................... 8
- Governance ..................................................................................................................................................... 9
- Canada’s Mining Sector ................................................................................................................................ 10
- An NLP-Based Approach to Evaluating Public Perceptions ........................................................................... 11
- Data .............................................................................................................................................................. 11
- Methodology ................................................................................................................................................ 12
- Results .......................................................................................................................................................... 14
  - Competition Policies .............................................................................................................................. 14
  - Governance ........................................................................................................................................... 15
  - Infrastructure ......................................................................................................................................... 17
  - Indigenous Communities and the Mining Sector ................................................................................... 18
  - Canada and the United States Compared ............................................................................................. 20
- Conclusions ........................................................................................................................................................ 23
- References .......................................................................................................................................................... 24

### Annexes and technical appendices
- Annex I. Survey Based Indicators ..................................................................................................................... 26
- Annex II. NLP-Based Indicator .......................................................................................................................... 27
- Annex III. Do Public Perceptions Matter for Investment Flows? ................................................................... 29
  - Regression Analysis ..................................................................................................................................... 29
  - Random Forest ............................................................................................................................................. 32

*IMF WORKING PAPERS Public Perceptions of Canada’s Investment Climate — INTERNATIONAL MONETARY FUND*

### Introduction

### Introduction

### Background and objective
- Canada’s muted productivity growth has raised concerns that the Canadian investment climate is weakening relative to comparator countries.
- Project aims:
  - assess how public perception of Canada’s investment climate encourages or discourages private investment;
  - assess how perceptions have evolved over time;
  - compare perceptions to international comparators.
- The study focuses on public perceptions as an important determinant of private investment decisions and notes that perception indices do not necessarily reflect actual policy changes.

### Novel NLP-based indicator (purpose and advantages)
- Introduces a natural language processing (NLP) based indicator using sentiment analysis of Twitter replies to official institutional tweets (e.g., Bank of Canada, Natural Resources Canada).
- Keyword search strategy based on a glossary containing keywords of survey-based indicators (see Annex II in source).
- Advantages over traditional survey-based indicators:
  - Less sensitive to biases of expert and authority respondents (broader, more diverse respondent base).
  - Provides a real-time indicator (tweets up to the most recent period) versus survey indicators updated in relatively large intervals (e.g., every five years for the OECD PMR).
  - Easily adjustable to cover additional and more nuanced dimensions of the investment climate.

### Data and methodology (preserved specifics)
- Twitter platform context:
  - "540 million users" globally (as stated in source).
  - One-quarter of Canadian internet users and 35.2% of social network users use the platform regularly; comparable U.S. figures in source: 19.5% and 27.9%.
  - User growth predictions in 2023: "2.7% in Canada" and "1.9% in the United States".
- Model training and classification:
  - Sentiment model: Twitter-roBERTa-base (fine-tuned on more than "124 million tweets" from January 2018 to December 2021).
  - Model accuracy: "about 72%".
  - A state-of-the-art machine learning algorithm trained on "approximately 58 million tweets" referenced for training in study context.
- Sample and extraction:
  - Final sample: "over 7500 official tweets" and "approximately 12500 replies or retweets".
  - Average replies per official tweet: "1-2 replies".
  - Time coverage: early 2017 to end of 2022.
  - Focused dimensions: competition, governance, and infrastructure.
- Four-stage methodology:
  - Stage 1: Data collection (verified official Twitter accounts; Full-Archive Search API).
  - Stage 2: Topic identification (keyword list from survey-based indicators; only tweets with at least one keyword retained).
  - Stage 3: Comment extraction (comments/quotes retrieved via API).
  - Stage 4: Sentiment analysis (Twitter-roBERTa-base model; labels: positive, negative, neutral; aggregated into annual series).

### Comparison with survey-based indicators (what existing indicators show)
- Survey-based indicators used for comparison:
  - OECD Product Market Regulation (PMR) indicators (de-jure questionnaire-based).
  - Worldwide Governance Indicators (World Bank) and Corruption Perception Index (Transparency International).
  - International Country Risk Guide (ICRG) monthly risk ratings.
  - Fraser Institute Annual Mining Survey (policy perception and investment attractiveness).
- Key survey-based findings (preserved wording and figures):
  - "Regulatory barriers appear to be above the OECD average," with weaknesses in public procurement, SOE governance, and licensing of new entrant businesses.
  - Licensing regime lacks a one-stop shop and "no 'silence is consent rule'".
  - Governance indicators are "strong, but there are signs of slippage in recent years."
  - Fraser Institute: Canada's median PPI decreased by "almost 8 percentage points" from 2021 to 2022 (rank fell from rank one in 2021 to rank four in 2022). Canada ranked second most attractive region in 2022 after Australia for investment attractiveness; Best Practices Mineral Potential Index ranked Canada first in 2022.

### Key empirical findings from the NLP indicator (preserved numeric values and phrasing)
- Competition:
  - Total tweets related to competition increased "nearly five-fold from January 2017 to December in 2022".
  - The negativity ratio (negative comments over total comments) "has been on the rise and almost doubled over the same period".
  - Notable dip in negativity ratio in 2021 (likely related to Covid-19 temporal effects).
  - Illustrative sentiment labeling examples show replies classified as Neutral and Negative for Competition Bureau tweets.
- Governance:
  - Total number of tweets related to governance grew rapidly prior to 2021; number of comments "more than tripling since 2017".
  - Ratio of negative comments peaked during the pandemic; negative perceptions of governance declined from a peak level of "0.27 in 2020" to "0.06 in 2022".
  - Illustrative examples demonstrate ML classification capturing subtle cues.
- Infrastructure:
  - Significant attention to infrastructure discussions; total number of comments showed a "significant uptick until 2020".
  - The negativity ratio for infrastructure is "relatively stable" but tends to be above ratios for competition and governance.
  - Illustrative examples indicate the model can label replies as Positive or Negative; note a methodological caveat that replies are categorized based on the original tweet topic which can misattribute sentiment.
- Indigenous policies and mining:
  - "Indigenous" was the keyword that obtained the most attention among analyzed keywords during the sample period.
  - Attention peaked in 2022 at "almost 1500 tweets" (about three times the maximum number for the next-most-attended keyword, infrastructure).
  - Unfavorable views of indigenous policies in Canada remained "relatively unchanged from 2017 to 2022"; negativity ratio similar to other categories.
  - Findings align with Fraser Institute concerns about policy uncertainty (disputed land claims, protected areas, environmental regulations) as a deterrent to mining investment.
- Robustness checks and cross-country analysis (Canada vs United States):
  - U.S. sample: "over 9000 tweets" from official institutions and "28772 responses".
  - Competition: 2022 negativity ratios in Canada and the U.S. were "around 0.4" (similar public perception of competition issues across the two economies).
  - Governance:
    - U.S. negativity ratio trend: decreased from "0.65 to less than 0.3 in 2019" then rose to "0.6 in 2021".
    - Overall level of negativity ratio is "significantly larger in the United States", consistent with Worldwide Governance Indicators showing lower U.S. scores across six governance categories.
  - Infrastructure: 2022 negativity ratios—United States "0.33" vs. Canada "0.42" (suggestive evidence of slightly weaker public perceptions of Canada’s infrastructure relative to the U.S. in 2022).

### Productivity and investment context (exact figures preserved)
- Labor productivity growth:
  - Early 2000s: labor productivity averaged "1.17 percent" (third lowest among G7 countries).
  - From "2015–22": labor productivity growth dropped to "0.18 percent".
  - G7 average for "2015–22": "0.39 percent".
  - U.S. labor productivity growth in "2015–22": "0.68".
  - U.K. labor productivity growth in "2015–22": "1.13".
- Multifactor productivity (MFP) growth "lagged, and remained below the G7 average."
- Gross fixed capital formation:
  - Now in the "lowest quartile of OECD countries".
  - Labor productivity "deteriorated significantly compared to U.S. and G7 levels, and is now close to the OECD average."
- Potential drivers of weak productivity and investment referenced (preserved references and phrasing):
  - Internal trade barriers: complete liberalization could increase GDP per capita by "4 percent" (Alvarez et al., 2019).
  - High inter-provincial non-tariff barriers (OECD, 2023).
  - Increase in the share of "zombie firms" (Amundsen et al., 2023).
  - Capital misallocation during house price booms (Liu, Lutz & Yang, forthcoming).
  - Other factors cited: financial frictions and high leverage; capital misallocation; suboptimal infrastructure; economic uncertainty; pandemic-related learning and productivity losses.
- Policy reform potential: reform pushes in governance, trade, labor, and product markets could deliver "sizeable output gains" (referenced IMF literature).

### Limitations and caveats (as stated)
- NLP index and many IFI indices measure public perceptions and do not necessarily reflect actual policy changes.
- Public perceptions can sometimes reflect improvements (e.g., revelation of corruption cases may lower perceptions while signaling functioning checks and balances).
- Twitter-specific caveats:
  - Influence of Twitter bots on political discussions.
  - Representativeness of Twitter users relative to the average Canadian is uncertain; individuals with extreme views may be more inclined to comment.
  - Evolving user base; demographic characteristics and posting histories not accessible due to data limitations.
  - No significant difference found in overall negativity ratio between existing users and new users in sample: "28.2% vs. 25.3%".
- Methodological caveat: tagging replies by the original tweet topic can lead to some misattribution of sentiment to topics (illustrated in infrastructure examples).

### Policy-relevant implications (synthesized from findings)
- Survey evidence and NLP analysis both indicate room for policy improvement in competition policy and some governance areas to help boost private investment.
- Targeted regulatory modernization actions (noted in background: Targeted Regulatory reviews since 2018; Competition Bureau budget increase of "$96 million" over five years as committed in 2021; targeted amendments to the Competition Act in June 2022 and competition act review launched in November 2022) are relevant context for addressing public concerns.
- Public perceptions—as captured in high-frequency NLP indicators—matter empirically for actual investment outcomes (annex regression and random forest results referenced in source align with literature finding perceptions matter for investment).

*Source: wpiea2024165-print-pdf - Introduction*

### Conclusions

### Conclusions

### Contribution and methodology
- Develops a new NLP-based measure of public perceptions of Canada’s investment climate by mining the richness of Twitter accounts.
- The NLP-based measure is characterized as:
  - Easier to update and adjustable to include additional countries or dimensions of the investment climate.
  - Less likely to be biased by views among a certain group of individuals compared to existing indicators.
- Sample and data scope mentioned:
  - Limited Twitter sample period: 2017-2022.
  - For cross-country econometric analysis, the paper states the sample includes all OECD countries and ranges from 2000-2022.
  - A note in Appendix Table 4: “The sample includes all OCED countries and ranges from 2020-2022.”

### Main findings (public perceptions and NLP insights)
- General assessment:
  - The Canadian investment climate appears to be generally favorable.
  - There are signs of slipping performance in some categories in recent periods.
  - These signs are confirmed by both survey-based and NLP-based indicators.
- Additional insights from the NLP-based indicator compared to survey-based indicators:
  - Large public engagement with respect to indigenous policies.
  - Heightened attention to competition policies in recent years.
  - Improvements in governance dimensions in 2022.
- Limitations of sentiment analysis noted:
  - Machine learning models processing Twitter data facilitate deeper understanding of user sentiments but can be limited in handling evolving language or context-specific meanings.
  - Sentiment analysis may categorize complex opinions into simplistic positive or negative labels, leading to overgeneralization and loss of nuanced understanding.

### Econometric and machine-learning analysis linking perceptions to investment flows
- Purpose:
  - To shed light on the impact of the investment climate on investment flows using survey-based indicators (e.g., worldwide governance indicators, ICRG).
  - Two modelling approaches applied: a standard panel regression and a machine learning algorithm (random forest).
- Model specification (panel regression):
  - Dependent variable: Δ ln (GFCE) it (percentage change in gross fixed capital formation).
  - X: standard economic factors (changes in real interest rates, real GDP growth, inflation, general government debt, etc.).
  - Y: variables related to the investment climate (voice and accountability, political stability, government effectiveness, regulatory quality, rule of law, control of corruption, size of government, legal system and property rights, sound money, freedom to trade internationally, economic regulation).
  - Results should be interpreted as indications of correlation rather than causation due to likely endogeneity; lags are used but an instrumental variable approach or event study would be required to fully address causality concerns.
- Summary of baseline regression results (Appendix Table 4; all variables are lagged by one period and represented percentage changes):
  - Observations: 668
  - R-squared: 0.1  0.348
  - Number of c: 32
  - Country FE: YES/NO across specifications
  - Year FE: YES/NO across specifications
  - Selected coefficient magnitudes reported in Appendix Table 4:
    - Short-term interest rate: 0.0; 0.0512; 0.815; 0.747 (across Models 1–4)
    - Real GDP: 1.3; 3.487; 5.233**; 7.305*** (across Models 1–4)
    - Consumer prices, period average: -0.2; 0.0664; 0.102; 0.179
    - General government debt, % of GDP: -0.1; -0.0873; -0.147*; -0.125*
    - Total Terms of Trade: 0.3***; 0.302***; 0.194***; 0.236***
    - Real Exchange Rate: -0.0***; -0.0373***; -0.0367***; -0.0330***
    - Current Account, % of GDP: 0.8; 0.482; 0.543; 0.322
    - VIX Index: -0.0***; -0.00460***; 0.00815***; 0.00998***
    - Federal Funds Rate: -0.0***; -0.0220***; -0.0513***; -0.0566***
    - Constant: 0.1***; 0.0995***; -0.236***; -0.295***
  - Note in the text: global factors (tighter US monetary conditions and higher global risk aversion) are major factors adversely correlated with investment; improvement in terms of trade tends to increase gross fixed capital formation while an exchange rate depreciation has the opposite effect. Domestic factors are generally of lower importance; real GDP and general government debt coefficients have expected signs but are significant only in later specifications.
- Adding third-party investment-climate indicators (summary of text discussion of Table 5):
  - Economic policy uncertainty: negative and significant in specifications (2) and (3), but insignificant if both country and year fixed effects are included.
  - Worldwide Governance Indicators:
    - Higher scores in government effectiveness and control of corruption tend to be associated with an increase in capital formation.
    - Regulatory quality shows a negative and significant coefficient in most specifications.
  - Risk ratings from the ICRG are insignificant in all specifications.
  - Results are broadly robust to alternative specifications excluding post-Covid episodes or focusing on G7 countries.

### Limitations and directions for future research
- Data and sample limitations:
  - Limited Twitter sample period: 2017-2022.
  - Some observed trends could be related to temporary developments driven by the Covid-19 pandemic.
- Methodological limitations:
  - NLP and sentiment analysis may oversimplify complex opinions and struggle with evolving language or context-specific meanings.
- Future research opportunities:
  - Draw on recently available large language models such as GPT to capture a fuller range of emotions and cultural nuances and enable more comprehensive insights into the investment climate in different countries.

*IMF WORKING PAPERS Public Perceptions of Canada’s Investment Climate — Conclusions*

### Appendix Table 5: Regression Results Including Survey-Based Indicators

### Appendix Table 5: Regression Results Including Survey-Based Indicators

### Regression results (summary of coefficients and robust standard errors)
- Sample: all OECD countries; ranges from 2020-2022.
- Note: All variables are lagged by one period and represented in percentage changes.
- Observations: 303
- R-squared: 0.4  0.240
- Number of c: 16 16 16 16
- Country FE: YES NO YES NO
- Year FE: YES NO NO YES
- Robust standard errors in parentheses
- Significance codes: *** p<0.01, ** p<0.05, * p<0.1

- Coefficients (with standard errors in parentheses) by model:
  - Short-term interest rate
    - Model 1: 0.4 (10.9)
    - Model 2: -3.105 (8.849)
    - Model 3: -4.160 (9.486)
    - Model 4: 0.978 (10.36)
  - Real GDP
    - Model 1: 0.0** (0.0)
    - Model 2: 0.00689*** (0.00183)
    - Model 3: 0.00356 (0.00266)
    - Model 4: 0.00875*** (0.00153)
  - Consumer prices, period average
    - Model 1: -0.8 (0.5)
    - Model 2: -1.017*** (0.334)
    - Model 3: -1.834*** (0.183)
    - Model 4: -0.238 (0.290)
  - General government debt, % of GDP
    - Model 1: -0.1** (0.0)
    - Model 2: -0.0523 (0.0424)
    - Model 3: -0.120* (0.0644)
    - Model 4: -0.0702*** (0.0259)
  - Total Terms of Trade
    - Model 1: 0.1 (0.1)
    - Model 2: 0.254*** (0.0959)
    - Model 3: 0.135 (0.0977)
    - Model 4: 0.178** (0.0800)
  - Real Exchange Rate
    - Model 1: 0.0 (0.0)
    - Model 2: 0.00557 (0.00659)
    - Model 3: 0.0100* (0.00492)
    - Model 4: 0.00351 (0.00703)
  - Current Account, % of GDP
    - Model 1: 2.9 (2.1)
    - Model 2: 1.969 (1.925)
    - Model 3: 2.207 (2.042)
    - Model 4: 2.506 (1.990)
  - VIX Index
    - Model 1: 0.0*** (0.0)
    - Model 2: 0.00416 (0.00308)
    - Model 3: 0.00568* (0.00315)
    - Model 4: 0.0202*** (0.00521)
  - Federal Funds Rate
    - Model 1: 0.0 (0.0)
    - Model 2: 0.0240 (0.0174)
    - Model 3: 0.0318* (0.0176)
    - Model 4: 0.0272 (0.0257)
  - Economic Policy Uncertainty Index
    - Model 1: 0.0 (0.0)
    - Model 2: -0.181*** (0.0569)
    - Model 3: -0.197*** (0.0578)
    - Model 4: 0.0684 (0.0494)
  - Voice and Accountability (WWG)
    - Model 1: -0.0 (0.0)
    - Model 2: -0.000279 (0.000204)
    - Model 3: -9.39e-05 (0.000243)
    - Model 4: -0.000202 (0.000175)
  - Political Stability and Absence of Violence (WWG)
    - Model 1: -0.0 (0.0)
    - Model 2: 0.000175 (0.00297)
    - Model 3: 3.91e-05 (0.00283)
    - Model 4: -0.00121 (0.00203)
  - Government Effectiveness (WWG)
    - Model 1: 0.0** (0.0)
    - Model 2: 0.00711* (0.00427)
    - Model 3: 0.00903** (0.00365)
    - Model 4: 0.0121** (0.00566)
  - Regulatory Quality (WWG)
    - Model 1: -0.0* (0.0)
    - Model 2: -0.000576* (0.000348)
    - Model 3: -0.000363 (0.000325)
    - Model 4: -0.000492** (0.000234)
  - Rule of Law (WWG)
    - Model 1: 0.0 (0.0)
    - Model 2: 0.0180 (0.0277)
    - Model 3: 0.0314 (0.0274)
    - Model 4: 0.0123 (0.0238)
  - Control of Corruption (WWG)
    - Model 1: 0.0* (0.0)
    - Model 2: 0.0126* (0.00734)
    - Model 3: 0.0125* (0.00668)
    - Model 4: 0.0128* (0.00746)
  - Economic Risk Rating (ICRG)
    - Model 1: 0.2 (0.2)
    - Model 2: -0.0984 (0.121)
    - Model 3: -0.0261 (0.127)
    - Model 4: 0.236 (0.194)
  - Financial Risk Rating (ICRG)
    - Model 1: -0.1 (0.1)
    - Model 2: 0.0793 (0.0846)
    - Model 3: 0.0219 (0.0812)
    - Model 4: -0.0464 (0.0854)
  - Political Risk Rating (ICRG)
    - Model 1: 0.3 (0.3)
    - Model 2: 0.274 (0.349)
    - Model 3: 0.263 (0.403)
    - Model 4: 0.242 (0.250)
  - Constant
    - Model 1: -0.4*** (0.1)
    - Model 2: -0.0443 (0.0510)
    - Model 3: -0.0473 (0.0521)
    - Model 4: -0.403*** (0.103)

### Random Forest: model purpose, specification, and evaluation
- Purpose:
  - Use machine-learning (random forest) to explore relative importance of many predictors and capture non-linear patterns and interactions.
  - Dependent variable: binary variable equal to one in periods of positive real gross capital formation and equal to zero otherwise.
- Model specification includes:
  - Investment climate measures: worldwide governance indicators, international country risk guide, economic freedom index (and later disaggregations).
  - Predictors: real interest rate, real GDP growth, inflation, general government debt, terms of trade, real exchange rate, current account, federal funds rate, VIX index, economic policy uncertainty index.
- Model evaluation:
  - Training set: 80% of data; test set: 20% reserved for out-of-sample performance.
  - Tenfold cross-validation applied on training data.
  - Performance metrics: F1 score and ROC AUC.
  - All models (whole sample, OECD, non-OECD) achieve F1 scores ranging from 0.80 to 0.90.
  - Hyperparameter tuning performed (number of trees, number of predictors sampled per split, minimum data points to split nodes, etc.) to maximize AUC-ROC.

### Random Forest: feature importance findings
- Method: variable importance scores from a fine-tuned random forest, scale 0 to 100.
- Whole-sample (163 countries: 36 OECD, 127 non-OECD)
  - GDP growth is the single most important factor predicting investment flows.
  - VIX volatility index ranks second in the whole sample and in the OECD sample.
  - For non-OECD countries, composite risk index (geopolitical risk) plays a major role.
  - Other high-importance investment climate factors include:
    - Size of government
    - Government effectiveness
    - Rule of law
    - Regulation
    - Political stability
- Non-OECD specific finding:
  - Debt-to-GDP ratio is an important predictor, following composite risk and GDP growth.
  - Literature links elevated debt levels to reduced investment through channels such as higher interest expenses, reduced pool for investment, difficulty securing new capital, and balance-sheet repair crowding out investment.
- Decomposition of economic freedom index (additional granular tests):
  - First tier decompositions:
    - Size of government → government consumption, transfers and subsidies, government investment, top marginal tax rate, state ownership of assets.
    - Legal system and property rights → judicial independence, impartial courts, protection of property rights, military interference in rule of law and politics, integrity of the legal system, legal enforcement of contracts, regulatory restriction on the sale of real property, reliability of police, gender legal rights adjustment.
    - Sound money → money growth, inflation, standard deviation of inflation, freedom to own foreign currency bank accounts.
    - Freedom to trade internationally → tariffs, regulatory trade barriers, black market exchange rates, controls of movement of capital and people.
    - Regulation → credit market regulations, labor market regulations, business regulations.
  - Results (high-level):
    - For OECD countries, inflation (particularly recent years) is critical in explaining investment flows.
    - For non-OECD countries, transfers and subsidies, integrity of the legal system, and capital flows are key factors.
- Visualization:
  - Appendix Figures 1–3 and Appendix Figure 4 present variable importance scores and decompositions (scale 0–100) for whole sample, OECD, non-OECD, and decomposed investment climate measurements.

*Source: wpiea2024165-print-pdf - Appendix Table 5*

---


_Source: https://www.imf.org/-/media/files/publications/wp/2024/english/wpiea2024165-print-pdf.pdf_
