knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.width = 12,
fig.height = 8,
warning = FALSE,
message = FALSE,
eval = FALSE
)
ManyIVsNets is a comprehensive R package for Environmental Phillips Curve (EPC) analysis that contributes to causal identification through multiple instrumental variable approaches and network analysis. This package represents the first systematic implementation of multidimensional instrument creation from economic and geographic data patterns.
The Environmental Phillips Curve examines the relationship between unemployment and environmental outcomes (particularly CO2 emissions), extending the traditional Phillips Curve concept to environmental economics. This relationship is crucial for understanding:
ManyIVsNets provides:
# Load the package
library(ManyIVsNets)
# Load sample data
data <- sample_epc_data
head(data)
# Run complete EPC analysis pipeline
results <- run_complete_epc_analysis()
# View results summary
summary(results)
# Create multidimensional instruments from your EPC data
instruments <- create_real_instruments_from_data(data)
# View created instruments
str(instruments)
# Create composite instruments using factor analysis
composite_instruments <- create_composite_instruments(instruments)
# Conduct transfer entropy causal discovery
te_results <- conduct_transfer_entropy_analysis(data)
# View causal relationships
print(te_results$te_matrix)
# Network properties
cat("Network density:", te_results$network_density)
cat("Causal links:", te_results$causal_links)
# Merge data with instruments
final_data <- merge_epc_with_created_instruments(data, instruments)
# Run comprehensive IV models
models <- run_comprehensive_epc_models(final_data)
# Calculate instrument strength
strength_results <- calculate_instrument_strength(final_data)
# View top performing instruments
head(strength_results[order(-strength_results$F_Statistic), ])
# Create all network visualizations
network_plots <- create_comprehensive_network_plots(final_data,
output_dir = tempdir())
# Plot instrument strength comparison
plot_instrument_strength_comparison(strength_results)
# Plot transfer entropy network
plot_transfer_entropy_network(te_results)
Traditional IV approaches often rely on a single instrument, raising concerns about validity. ManyIVsNets provides 24 different approaches, enabling: - Robustness testing across multiple identification strategies - Overidentification tests to validate instrument exogeneity - Sensitivity analysis to ensure result stability
Rather than searching for arbitrary external instruments, our approach: - Uses economic theory to identify relevant exogenous dimensions - Creates instruments from observable patterns in the data - Ensures policy relevance through institutional and historical variation
Our comprehensive validation shows good performance:
# Top 10 strongest instruments
top_instruments <- data.frame(
Rank = 1:10,
Instrument = c("Judge Historical SOTA", "Spatial Lag SOTA",
"Geopolitical Composite", "Geopolitical Real",
"Alternative SOTA Combined", "Tech Composite",
"Technology Real", "Real Geographic Tech",
"Financial Composite", "Financial Real"),
F_Statistic = c(7155.39, 569.90, 362.37, 259.44, 202.93,
188.47, 139.42, 125.71, 113.77, 94.12),
Strength = c(rep("Very Strong", 10))
)
print(top_instruments)
Main Analysis: - run_complete_epc_analysis()
: Complete analysis pipeline - run_comprehensive_epc_models()
: IV regression models - calculate_instrument_strength()
: F-statistic testing
Instrument Creation: - create_real_instruments_from_data()
: Multidimensional instruments - create_composite_instruments()
: Factor analysis combinations - create_alternative_sota_instruments()
: State-of-the-art approaches
Transfer Entropy: - conduct_transfer_entropy_analysis()
: Causal discovery - create_te_based_instruments()
: Network-based instruments
Visualization: - create_comprehensive_network_plots()
: All 7 network visualizations - plot_transfer_entropy_network()
: Causal relationship networks - plot_instrument_strength_comparison()
: Performance comparison
Sample Dataset: - sample_epc_data
: 5 countries, 1991-2021, 7 EPC variables - Ready-to-use for testing and demonstration
# Quick example with sample data
library(ManyIVsNets)
# Load sample data
data <- sample_epc_data
# Create instruments
instruments <- create_real_instruments_from_data(data)
# Run analysis
results <- run_complete_epc_analysis()
# View summary
print(results$summary)
# Load your EPC data (CSV format)
# Required columns: country, year, CO2_per_capita, UR, URF, URM, PCGDP, Trade, RES
my_data <- load_epc_data_corrected("path/to/your/data.csv")
# Run complete analysis
my_results <- run_complete_epc_analysis(
data_file = "path/to/your/data.csv",
output_dir = tempdir()
)
If you use ManyIVsNets in your research, please cite:
Bhandari, A. (2025). ManyIVsNets: Environmental Phillips Curve Analysis with Multiple Instrumental Variables and Networks [Computer software]. GitHub. https://github.com/avishekb9/ManyIVsNets
@misc{ManyIVsNets2025,
author = {Avishek Bhandari},
title = {ManyIVsNets: Environmental Phillips Curve Analysis with Multiple Instrumental Variables and Networks},
year = {2025},
publisher = {GitHub},
url = {https://github.com/avishekb9/ManyIVsNets}
}
We welcome contributions! Please see our GitHub repository for: - Bug reports and feature requests - Code contributions and improvements - Documentation enhancements
ManyIVsNets represents a contribution to macro-environmental economics methodology, providing:
The package is designed for researchers, policymakers, and students working on environmental economics, labor economics, and causal inference. With its combination of methodological innovation and practical applicability, ManyIVsNets opens new avenues for understanding the complex relationships between employment, economic growth, and environmental outcomes.
Ready to revolutionize your environmental economics research? Start with ManyIVsNets today! ```