Type: Package
Title: Environmental Phillips Curve Analysis with Multiple Instrumental Variables and Networks
Version: 0.1.1
Date: 2025-06-07
Description: Comprehensive toolkit for Environmental Phillips Curve analysis featuring multidimensional instrumental variable creation, transfer entropy causal discovery, network analysis, and state-of-the-art econometric methods. Implements geographic, technological, migration, geopolitical, financial, and natural risk instruments with robust diagnostics and visualization. Provides 24 different instrumental variable approaches with empirical validation. Methods based on Phillips (1958) <doi:10.1111/j.1468-0335.1958.tb00003.x>, transfer entropy by Schreiber (2000) <doi:10.1103/PhysRevLett.85.461>, and weak instrument tests by Stock and Yogo (2005) <doi:10.1017/CBO9780511614491.006>.
License: MIT + file LICENSE
URL: https://github.com/avishekb9/ManyIVsNets, https://avishekb9.github.io/ManyIVsNets/
BugReports: https://github.com/avishekb9/ManyIVsNets/issues
Encoding: UTF-8
LazyData: true
RoxygenNote: 7.3.2
Depends: R (≥ 4.0.0)
Imports: dplyr, readr, igraph, ggplot2, ggraph, AER, lmtest, sandwich, magrittr
Suggests: testthat (≥ 3.0.0), rmarkdown, pkgdown, knitr, RTransferEntropy, tidyr, viridis, countrycode, spelling
VignetteBuilder: knitr
Config/testthat/edition: 3
Language: en-US
NeedsCompilation: no
Packaged: 2025-06-19 18:07:52 UTC; avisek
Author: Avishek Bhandari [aut, cre, cph]
Maintainer: Avishek Bhandari <bavisek@gmail.com>
Repository: CRAN
Date/Publication: 2025-06-23 11:20:02 UTC

ManyIVsNets: Environmental Phillips Curve Analysis with Multiple Instrumental Variables and Networks

Description

Comprehensive toolkit for Environmental Phillips Curve analysis featuring multidimensional instrumental variable creation, transfer entropy causal discovery, network analysis, and state-of-the-art econometric methods. Implements geographic, technological, migration, geopolitical, financial, and natural risk instruments with robust diagnostics and visualization. Provides 24 different instrumental variable approaches with empirical validation. Methods based on Phillips (1958) doi:10.1111/j.1468-0335.1958.tb00003.x, transfer entropy by Schreiber (2000) doi:10.1103/PhysRevLett.85.461, and weak instrument tests by Stock and Yogo (2005) doi:10.1017/CBO9780511614491.006.

Author(s)

Maintainer: Avishek Bhandari bavisek@gmail.com [copyright holder]

See Also

Useful links:


Calculate Instrument Strength

Description

Calculate Instrument Strength

Usage

calculate_instrument_strength(data)

Arguments

data

Enhanced EPC data

Value

Data frame with instrument strength results


Conduct Transfer Entropy Analysis for Causal Discovery

Description

Conduct Transfer Entropy Analysis for Causal Discovery

Usage

conduct_transfer_entropy_analysis(data)

Arguments

data

Enhanced EPC data with instruments

Value

List containing transfer entropy matrix, network, and metadata

Examples


# Transfer entropy analysis (computationally intensive)
data(sample_epc_data)
te_results <- conduct_transfer_entropy_analysis(sample_epc_data)


Create Alternative State-of-the-Art Instruments

Description

Create Alternative State-of-the-Art Instruments

Usage

create_alternative_sota_instruments(data)

Arguments

data

Enhanced EPC data

Value

Data frame with alternative SOTA instruments


Create Composite Instruments using Factor Analysis

Description

Create Composite Instruments using Factor Analysis

Usage

create_composite_instruments(instruments)

Arguments

instruments

Data frame with individual instruments

Value

Enhanced data frame with composite instruments


Create Comprehensive Network Plots

Description

Create Comprehensive Network Plots

Usage

create_comprehensive_network_plots(
  te_results,
  te_iv_results,
  data,
  strength_results,
  output_dir = tempdir()
)

Arguments

te_results

Transfer entropy results

te_iv_results

Transfer entropy IV results

data

Enhanced EPC data

strength_results

Instrument strength results

output_dir

Directory to save plots (optional)

Value

List of plot objects


Create Comprehensive Results Table

Description

Create Comprehensive Results Table

Create Comprehensive Results Table

Usage

create_comprehensive_results_table(models, diagnostics)

create_comprehensive_results_table(models, diagnostics)

Arguments

models

List of fitted models

diagnostics

List of diagnostic results

Value

Data frame with comprehensive results

Data frame with comprehensive results


Create enhanced test data with all required variables

Description

Create enhanced test data with all required variables

Usage

create_enhanced_test_data()

Value

Data frame with enhanced test data


Create Publication Summary

Description

Create Publication Summary

Usage

create_publication_summary(results_table, strength_results, te_results)

Arguments

results_table

Main results table

strength_results

Instrument strength results

te_results

Transfer entropy results

Value

Character vector with summary text


Create Real Multidimensional Instruments from Economic Data

Description

Create Real Multidimensional Instruments from Economic Data

Usage

create_real_instruments_from_data(epc_data)

Arguments

epc_data

Data frame containing EPC data with country and year columns

Value

Data frame with created instruments

Examples

# Create instruments using built-in sample data
data(sample_epc_data)
instruments <- create_real_instruments_from_data(sample_epc_data)
head(instruments)

Create Transfer Entropy-Based Instruments

Description

Create Transfer Entropy-Based Instruments

Usage

create_te_based_instruments(data, te_results)

Arguments

data

EPC data

te_results

Transfer entropy analysis results

Value

List with enhanced data and network centralities


Create test EPC data for testing

Description

Create test EPC data for testing

Usage

create_test_epc_data()

Value

Data frame with test EPC data


Create test instruments for testing

Description

Create test instruments for testing

Usage

create_test_instruments()

Value

Data frame with test instruments


Export Comprehensive Results to CSV

Description

Export Comprehensive Results to CSV

Usage

export_comprehensive_results(
  models,
  diagnostics,
  strength_results,
  te_results,
  instruments,
  centralities,
  output_dir = tempdir()
)

Arguments

models

List of fitted models

diagnostics

List of diagnostic results

strength_results

Instrument strength results

te_results

Transfer entropy results

instruments

Created instruments data

centralities

Country network centralities

output_dir

Directory to save files

Value

No return value, called for side effects. Creates multiple CSV files and one text summary file in the specified output directory: Table_1_Complete_EPC_Results_From_Scratch.csv (main Environmental Phillips Curve analysis results), Table_2_Instrument_Strength_All_Types_From_Scratch.csv (instrument strength statistics), Table_3_Transfer_Entropy_Matrix.csv (transfer entropy matrix), Table_4_Created_Real_Instruments.csv (created instrumental variables), Table_5_Country_Network_Centralities.csv (network centrality measures), Table_6_IV_Diagnostics_Complete.csv (IV diagnostic tests), and Publication_Summary_Complete_From_Scratch.txt (comprehensive summary).


Load and Clean EPC Data

Description

Load and Clean EPC Data

Usage

load_epc_data_corrected(file_path = "epc_data_new_ar5_indicators.csv")

Arguments

file_path

Path to the EPC data CSV file

Value

Cleaned EPC data frame

Examples

# Load sample EPC data from package
sample_file <- system.file("extdata", "sample_epc_data.csv", package = "ManyIVsNets")
if (file.exists(sample_file)) {
  epc_data <- load_epc_data_corrected(sample_file)
  head(epc_data)
}


# Example with external file (only runs if file exists)
if (file.exists("your_epc_data.csv")) {
  epc_data <- load_epc_data_corrected("your_epc_data.csv")
}


Merge EPC Data with Created Instruments

Description

Merge EPC Data with Created Instruments

Usage

merge_epc_with_created_instruments(epc_data, instruments)

Arguments

epc_data

EPC data frame

instruments

Instruments data frame

Value

Enhanced data frame with merged instruments


Create Country Network Visualization by Income Classification

Description

Create Country Network Visualization by Income Classification

Usage

plot_country_income_network(country_network, output_dir = NULL)

Arguments

country_network

igraph network object

output_dir

Directory to save plots (optional)

Value

ggplot object


Create Cross-Income CO2 Growth Nexus Visualization

Description

Create Cross-Income CO2 Growth Nexus Visualization

Usage

plot_cross_income_co2_nexus(data, output_dir = NULL)

Arguments

data

Enhanced EPC data

output_dir

Directory to save plots (optional)

Value

ggplot object


Create Instrument Causal Pathways Network

Description

Create Instrument Causal Pathways Network

Usage

plot_instrument_causal_pathways(data, output_dir = NULL)

Arguments

data

Enhanced EPC data

output_dir

Directory to save plots (optional)

Value

ggplot object


Create Instrument Strength Comparison Visualization

Description

Create Instrument Strength Comparison Visualization

Usage

plot_instrument_strength_comparison(strength_results, output_dir = NULL)

Arguments

strength_results

Data frame with instrument strength results

output_dir

Directory to save plots (optional)

Value

ggplot object


Create Migration Impact Visualization

Description

Create Migration Impact Visualization

Usage

plot_migration_impact(data, output_dir = NULL)

Arguments

data

Enhanced EPC data

output_dir

Directory to save plots (optional)

Value

ggplot object


Create Regional Network Visualization

Description

Create Regional Network Visualization

Usage

plot_regional_network(data, output_dir = NULL)

Arguments

data

Enhanced EPC data

output_dir

Directory to save plots (optional)

Value

ggplot object


Create Transfer Entropy Network Visualization

Description

Create Transfer Entropy Network Visualization

Usage

plot_transfer_entropy_network(te_results, output_dir = NULL)

Arguments

te_results

Transfer entropy analysis results

output_dir

Directory to save plots (optional)

Value

ggplot object


Run Complete EPC Analysis Pipeline

Description

Run Complete EPC Analysis Pipeline

Usage

run_complete_epc_analysis(data_file = NULL, output_dir = tempdir())

Arguments

data_file

Path to EPC data file (optional)

output_dir

Directory for outputs

Value

List with all analysis results


Run Comprehensive EPC Models

Description

Run Comprehensive EPC Models

Usage

run_comprehensive_epc_models(data)

Arguments

data

Enhanced EPC data with all instruments

Value

List of fitted models


Run Comprehensive IV Diagnostics

Description

Run Comprehensive IV Diagnostics

Run Comprehensive IV Diagnostics

Usage

run_comprehensive_iv_diagnostics(models)

run_comprehensive_iv_diagnostics(models)

Arguments

models

List of fitted models

Value

List of diagnostic results

List of diagnostic results


Sample Environmental Phillips Curve Data

Description

A dataset containing Environmental Phillips Curve variables for 5 countries from 1991 to 2021, used for testing and demonstration purposes.

Usage

sample_epc_data

Format

A data frame with 155 rows and 9 variables:

country

Country name

year

Year (1991-2021)

CO2_per_capita

CO2 emissions per capita

UR

Total unemployment rate

URF

Female unemployment rate

URM

Male unemployment rate

PCGDP

Per capita GDP

Trade

Trade openness

RES

Renewable energy share

Source

Generated for package testing and demonstration