Regression Analysis of Country Pair Data

Introduction

This report presents a regression analysis examining the relationship for country pairs.

# Load necessary libraries
library(readxl)
library(dplyr)
library(stats)

# Load the dataset
file_path <- "2017_2023.xlsx"
data <- read_excel(file_path, sheet = "Sheet1")

# Rename columns to ensure compatibility
colnames(data) <- make.names(colnames(data))

# Select relevant variables
data <- data %>% select(Country_Pair, Religion, Language, Disclosure, GDP, Tax, 
                       Currency, R.D, High_Tech_Exports, Z.score)

# Convert necessary variables to numeric
data <- data %>% mutate(across(everything(), as.numeric))# Load necessary libraries
library(readxl)
library(dplyr)
library(stats)

# Load the dataset
file_path <- "2017_2023.xlsx"
data <- read_excel(file_path, sheet = "Sheet1")

# Rename columns to ensure compatibility
colnames(data) <- make.names(colnames(data))

# Select relevant variables
data <- data %>% select(Country_Pair, Religion, Language, Disclosure, GDP, Tax, 
                       Currency, R.D, High_Tech_Exports, Z.score)

# Convert necessary variables to numeric
data <- data %>% mutate(across(everything(), as.numeric))

Regression Model

We run a linear regression model with Country_Pair as the dependent variable and the following independent variables:

  • Z.score
  • Religion
  • Language
  • Disclosure
  • Tax
  • Currency
  • GDP
  • R.D
  • High_Tech_Exports
# Run the regression model
model <- lm(Country_Pair ~ Z.score + Religion + Language + Disclosure + 
            Tax + Currency + GDP + R.D + High_Tech_Exports, 
            data = data, na.action = na.exclude)

# Display model summary
summary(model)
# Create a clean results table
results <- broom::tidy(model)
knitr::kable(results, digits = 4, caption = "Regression Coefficients")
par(mfrow = c(2, 2))
plot(model)par(mfrow = c(2, 2))
plot(model)