Explore historical trend and correlation between GDP and unemployment rate in NZ

Muhammad Haziq Che Rose
6 min readJul 16, 2024

--

Photo by The New York Public Library on Unsplash

Introduction

Understanding the unemployment rate and GDP trend are important because they indicate economy health. Our Analysis reveals a strong negative correlation between the unemployment rate and GDP growth. Lower unemployment rates often coincide with higher GDP growth. This article explores their relationship, focusing on historical trends and implications for policy maker.

Data Collection and Methodology

For our analysis, we collected data from multiple reputable sources:

  • Unemployment Rate: Data from the World Bank
  • GDP Growth Rate: Data for New Zealand from the International Monetary Fund (IMF)
  • Unemployment Rate by Age Group: Data from ILOSTAT Data Explorer

Data transformation

We organize this data into a readable format using Python by creating data frames for easier analysis.

import pandas ad pd

# New Zealand Unemployment rate data (imported from my github)
url = 'https://raw.githubusercontent.com/HAZCHEM234/My_data/main/Unemployment_rate_countries.csv'

# Filter the DataFrame to show only rows where the country is New Zealand
nz_rows = df[df['Country Name'] == 'New Zealand']

# Display the filtered rows
nz_rows

# Select the year columns from 2017 to 2023 and transpose the DataFrame
unemployment_rate = nz_rows.loc[:, '2017':'2023'].T

# Reset the index to make the years a column
unemployment_rate = unemployment_rate.reset_index()

# Rename the columns
unemployment_rate.columns = ['date', 'unemployment rate']

# Sort by date in descending order
unemployment_rate = unemployment_rate.sort_values(by='date', ascending=False).reset_index(drop=True)

# Display the reshaped DataFrame
unemployment_rate
New Zealand unemployment rate

IMF New Zealand Data

IMF data is only available in Excel Format. The code below reads and collects the essential data for the analysis.

pip install openpyxl
# Path to the Excel file
file_path = 'GDP_and_Components.xlsx'

# Read the Excel file into a DataFrame
df = pd.read_excel(file_path, sheet_name='Sheet1')

# Select rows 3 and 11 (Note: pandas uses zero-based indexing)
selected_rows = df.iloc[[1, 9]]

# Display the selected rows
selected_rows

After collecting the data we needed for analysis, we sorted the table from the most recent to the oldest and in the appropriate format

# Select rows 1 and 9
gdp_nominal_row = df.iloc[1]
gdp_real_row = df.iloc[9]

# Filter out rows with NaN values
gdp_nominal_filtered = gdp_nominal_row.dropna()
gdp_real_filtered = gdp_real_row.dropna()

# Align indices to ensure they match after filtering NaNs
gdp_nominal_filtered = gdp_nominal_filtered[gdp_nominal_filtered.index.isin(gdp_real_filtered.index)]
gdp_real_filtered = gdp_real_filtered[gdp_real_filtered.index.isin(gdp_nominal_filtered.index)]

# Create a new DataFrame with the desired structure
data = {
'date': gdp_nominal_filtered.index[4:][::-1], # Reverse the order of years
'GDP Nominal (in millions)': gdp_nominal_filtered.values[4:][::-1], # Reverse the order of values
'GDP Real (in millions)': gdp_real_filtered.values[4:][::-1] # Reverse the order of values
}

# Create the final DataFrame
final_df = pd.DataFrame(data)

final_df
New Zealand GDP trends

Merged data frame

After creating the unemployment rate and GDP table, we will merge the table into one data frame and save it to a CSV file.

# Merge final_df and unemployment_rate table on 'Date'
merged_df = pd.merge(final_df, unemployment_rate, on='date')

# Display the Merged df
merged_df

Merged data frame can be found on my raw GitHub page:

raw.githubusercontent.com/HAZCHEM234/My_data/main/merged_unemployment_and_gdp.csv

Hypothesis testing

We employ hypothesis testing to determine if there is a significant relationship between GDP (Real) and the unemployment rate. We can define two hypotheses

  1. Null Hypothesis — There is no significant relationship between GDP and the unemployment rate
  2. Alternative Hypothesis — There is a significant correlation between GDP and unemployment rate
import pandas as pd
from scipy.stats import pearsonr

# Load the data from the provided URL
file_path = "https://raw.githubusercontent.com/HAZCHEM234/My_data/main/merged_unemployment_and_gdp.csv"
df = pd.read_csv(file_path)


# Calculate Pearson correlation coefficient and p-value
corr_coef, p_value = pearsonr(df['GDP Real (in millions)'], df['unemployment rate'])

print(f"Pearson Correlation Coefficient: {corr_coef}")
print(f"P-value: {p_value}")

# Determine if correlation is significant
alpha = 0.05
if p_value < alpha:
print("There is a significant correlation between GDP Real and the unemployment rate.")
else:
print("There is no significant correlation between GDP Real and the unemployment rate.")
Pearson Correlation and Probability value (P-value) shows that there is a significant correlation between GDP and the unemployment rate

Hypothesis testing ididcate that job losses have a signifcant impact on the country GDP. The Pearson Correlation of 0.01917 indicates a strong negative correlation between GDP and the Unemployment rate. The Probability Value is less than 0.05, providing strong evidence to reject the null hypothesis. This means an increase in the unemployment rate can lead to a decrease in the country’s GDP

Results

Our results show a clear correlation between GDP and the unemployment rate. The chart displays the country’s GDP performance and unemployment rate from 2017–2023.

New Zealand Unemployment rate overtime
New Zealand Unemployment Rate Over Time

The impact of COVID-19 on the unemployment rate and the country’s GDP is evident. In 2020, there was a notable increase in the unemployment rate and a slight drop in the GDP. The pandemic resulted in higher unemployment and a decrease in GDP. However, post-2020, efforts to recover the economy helped lower the unemployment rate and increase the GDP.

Various factors such as the working-age population, wage trends, and employment trends can affect the unemployment rate. According to Stats NZ, the report highlights significant trends in the working-age population, employment rates, and wage increases throughout 2023, which contributed to a rise in unemployment and a slowdown in the economy.

Recommendation

“The education and training of a country workforce is a major factor in determining how well the country’s economic performance”— Investopedia.

To reduce unemployment and boost the economy, we suggest:

  • Investing in workforce education and training, including vocational training and re-skilling programs.
  • Focusing on high-demand sectors like technology, healthcare, and renewable energy.
  • Promoting entrepreneurship and innovation among young people.
Youth and adults under 24 are facing higher unemployment rates compared to other age groups

“To address youth unemployment, we need to shift youth’s effort from seeking jobs to creating marketable opportunities for themselves. Integrating entrepreneurship and innovation into education is key. Business incubation centers and government support can drive market creation and innovation” — Lindiwe Matlali , World Economic Forum.

Discussion

Our study shows a strong link between unemployment and GDP: when unemployment rises, GDP tends to fall. This is important for policymakers and economists, but it doesn’t prove causation. Future research could focus on specific sectors to identify which are most affected by changes in employment and develop targeted policies.

Conclusion

Our analysis explores the significant relationship relation between GDP and the unemployment rate. Key findings include:

  • The COVID-19 pandemic has influenced the unemployment rate and the decline of the GDP.
  • Substantial economic recovery helps reduce unemployment and boost the GDP
  • Working-age population growth, employment trends, and wage trends can influence the unemployment rate

Addressing unemployment through education, vocational training, and promoting innovation is crucial to reduce the unemployment rate, economic growth, and enhancing social well-being.

References

References

GitHub Links for Data Used for Analysis

--

--