about · email me · subscribe
Spurious correlation #2,623 · View random

A linear line chart with years as the X-axis and two variables on the Y-axis. The first variable is GDP per capita in Canada and the second variable is Gasoline Prices in the US.  The chart goes from 2009 to 2022, and the two variables track closely in value over that time. Small Image
Download png
, svg

AI explanation

As Canadians got richer, they couldn't resist the lure of competitive lumberjack sports. American demand for maple syrup spiked, leading to higher transportation costs for syrup imports, which put pressure on US gasoline prices due to increased tanker usage and syrup-related trade disputes. In the end, it was a sticky situation for everyone except the pancake industry.

Model: dalle-3
Prompt: [ A photo-realistic image ] Depict a tranquil, sunlit setting with a clear blue sky. In the background, a maple leaf flag of Canada waves gently in the breeze. In the foreground, a gas pump stands prominently, and its price sign displays the cost of gasoline in US dollars. Nearby, a storefront showcases a glowing Canadian dollar symbol, symbolizing the GDP per capita in Canada. The depiction should include only scenes, people, and objects, it should not include text or speech bubbles.
This image generation prompt was also generated by AI, using the following sequence:

Model: gpt-3.5-turbo-1106
System prompt: You select one of a few potential scene descriptors that seems to go along with the variables described. You respond only with the scene descriptions provided and say nothing else.
User prompt: Here are two variables: GDP per capita in Canada and Gasoline Prices in the US. Given these, which of the following image style descriptions seems most appropriate? Pick the one that seems to be related to one of the variables at hand. Please respond with only one of the following potential descriptions: Cute cartoon Scalar art A photo-realistic image A TIME magazine cover image Celtic art
ChatGPT: A photo-realistic image

Model: gpt-3.5-turbo-1106
System prompt: You describe simple visual scenes that depict the two variables stated. You combine both variables into one scene.
User prompt: Please describe a visual scene that prominently depicts both GDP per capita in Canada and Gasoline Prices in the US together. Keep the description simple.
ChatGPT: In the scene, a maple leaf flag of Canada is waving in the background while a gas pump in the foreground features a price sign showing the cost of gasoline in US dollars. A Canadian dollar symbol shines from a nearby storefront, representing the GDP per capita in Canada.

Model: gpt-3.5-turbo-1106
System prompt: You write and improve image generation prompts for DALLE-3. You maintain the same subjects, but enhance the visuals.
User prompt: Please respond with an image generation prompt that would be likely to create an interesting visual using DALLE-3, using the following style: [ A photo-realistic image ] and depicting this scene: In the scene, a maple leaf flag of Canada is waving in the background while a gas pump in the foreground features a price sign showing the cost of gasoline in US dollars. A Canadian dollar symbol shines from a nearby storefront, representing the GDP per capita in Canada. Keep the visual depiction simple. Do not include any words or speech bubbles.
ChatGPT: [ A photo-realistic image ] Depict a tranquil, sunlit setting with a clear blue sky. In the background, a maple leaf flag of Canada waves gently in the breeze. In the foreground, a gas pump stands prominently, and its price sign displays the cost of gasoline in US dollars. Nearby, a storefront showcases a glowing Canadian dollar symbol, symbolizing the GDP per capita in Canada.

*Variations in the User Prompts from chart to chart are just the result of random number generation in Python. I wrote a few arrays of various styles and methods to ask questions to change up the results. Every time this site writes an explanation or generates an image, the script picks from each at random.

I sequence the requests into multiple prompts because I find GPT 3.5 to perform much better with short, well-managed contexts. Thus, I track the context directly in Python and only ask ChatGPT targeted questions.

Model: gpt-3.5-turbo-1106 (fine-tuned)
System prompt: You provide humorous responses in the form of plausible sounding explanations for correlations. You assume the correlation is causative for the purpose of the explanation even if it is ridiculous. You do not chat with the user, you only reply with the causal connection explanation and nothing else.
User prompt: Please make up a funny explanation for how an increase in GDP per capita in Canada caused Gasoline Prices in the US to increase. Make it feel plausible.

AI academic paper

(Because p < 0.01)
Fuel for Thought: Exploring the Relationship between Canadian GDP per Capita and US Gasoline Prices

The Journal of Canuckonomics

Jan 2024

Reminder: This paper is AI-generated. Not real!
Quick note: This sequence is long and repetitive. That's how the prompt engineering works for this one. I manage the output in Python to format it into this PDF.




Model: gpt-3.5-turbo-1106
System prompt: You are a witty academic researcher. Your writing sounds like it belongs in a statistics journal.You write titles and abstracts of goofy academic research papers.
User prompt:
Pretend you are an academic researcher. Your writing sounds like it belongs in a medical or economics journal. However, you frequently crack jokes, make puns, and add unexpected twists in your writing.

Please draft the title and abstract of an academic research paper presenting the findings of the connection between GDP per capita in Canada and Gasoline Prices in the US. Make it seem dry like academic research paper, but with lots of subtle hidden offhand remarks, jokes, goofy observations, and puns.

Make the title a clever pun.

Your research team used data from World Bank and Statista to assess this nagging question. You found a correlation coefficient of 0.9523535 and p < 0.01 for 2009 to 2022.

Please respond in this format (replace "Lorem ipsum dolor sit" with your title and abstract)

[[TITLE]]
Lorem ipsum dolor sit

[[ABSTRACT]]
Lorem ipsum dolor sit



ChatGPT:
[[TITLE]]
Fuel for Thought: Exploring the Relationship between Canadian GDP per Capita and US Gasoline Prices

[[ABSTRACT]]
This study investigates the intriguing correlation between the Gross Domestic Product (GDP) per capita in Canada and the price of gasoline in the United States. Utilizing data from the World Bank and Statista spanning the years 2009 to 2022, our research team employed rigorous statistical analysis to uncover the nuances of this economic relationship. Our findings reveal a striking correlation coefficient of 0.9523535, indicating a strong positive association between the two variables. Furthermore, our results demonstrate a significant p-value of less than 0.01, providing robust evidence of the observed connection. This paper not only enriches the understanding of cross-border economic dynamics but also fuels discussions on the interplay between economic prosperity and fuel costs.


Model: gpt-3.5-turbo-1106
System prompt: You are a witty academic researcher. Your writing sounds like it belongs in a statistics journal.You draft the introduction section of an academic research paper.
User prompt:
Pretend you are an academic researcher. Your writing sounds like it belongs in a medical or economics journal. However, you frequently crack jokes, make puns, or add unexpected twists in your writing.

Please make up the introduction section of an academic research paper presenting the findings of the connection between GDP per capita in Canada and Gasoline Prices in the US. Make it seem dry like academic research paper, but with lots of subtle hidden offhand remarks, jokes, goofy observations, and puns. Stay serious and dry most of the time, but then occasionally let your wit shine through.

Here is the title and abstract of the paper:
[[TITLE]]
Fuel for Thought: Exploring the Relationship between Canadian GDP per Capita and US Gasoline Prices

[[ABSTRACT]]
This study investigates the intriguing correlation between the Gross Domestic Product (GDP) per capita in Canada and the price of gasoline in the United States. Utilizing data from the World Bank and Statista spanning the years 2009 to 2022, our research team employed rigorous statistical analysis to uncover the nuances of this economic relationship. Our findings reveal a striking correlation coefficient of 0.9523535, indicating a strong positive association between the two variables. Furthermore, our results demonstrate a significant p-value of less than 0.01, providing robust evidence of the observed connection. This paper not only enriches the understanding of cross-border economic dynamics but also fuels discussions on the interplay between economic prosperity and fuel costs.

-------

Your response should start like this:

[[INTRODUCTION]]



ChatGPT:
[[INTRODUCTION]]

In the realm of economic inquiry, the investigation of various factors influencing a nation's economic well-being is a perennial pursuit. One such factor of interest is the price of gasoline, which has long been a subject of scrutiny due to its implications for both consumers and businesses. Likewise, Gross Domestic Product (GDP) per capita serves as a vital metric in assessing the economic health and standard of living within a nation. Emblematic of these multifaceted economic considerations are the intertwined fates of Canada and the United States, two close neighbors sharing not only a vast border but also intricate economic interdependencies.

The enchanting dance of supply and demand, coupled with the perplexing patterns of income and expenditure, beckons scholars to delve into the nuanced connections between GDP per capita and gasoline prices. This study, therefore, seizes the opportunity to unravel the enigmatic relationship between Canadian economic prosperity and the vagaries of gasoline prices across the border.

Before plunging into the depths of our analysis, it is imperative to acknowledge the multifarious variables that could influence the price of gasoline in the US, including fluctuations in crude oil prices, geopolitical tensions, and the mysterious machinations of market forces. Coupled with these complexities, the dynamics of Canadian GDP per capita offer an intriguing juxtaposition, providing fertile ground for exploration and discovery.

Moreover, as we tread through the corridors of statistical analysis, it becomes abundantly clear that this endeavor is not merely a matter of crunching numbers; rather, it is an expedition into the uncharted territories of economic symbiosis, where numbers tell stories and correlations whisper secrets. Our journey is not only to uncover the statistical verities but also to illuminate the hidden connections that underpin the economic fabric of these transnational kin.

In the pursuit of this enigmatic correlation, we aim to furnish an invaluable addition to the economic mosaic and fuel scholarly discussions on topics ranging from international trade dynamics to the confluence of domestic prosperity and energy costs. The ramifications of our findings are far-reaching, touching not only the academic echelons but also resonating with policymakers, market analysts, and casual observers of economic gyrations.

With that prologue, we embark on a sojourn through the corridors of correlation and causation, guided by the beacon of data and the compass of econometric analysis, all in pursuit of unraveling the intertwining destinies of Canadian GDP per capita and the capricious swings of gasoline prices in the Land of the Free.


Model: gpt-3.5-turbo-1106
System prompt: You are a witty academic researcher. Your writing sounds like it belongs in a statistics journal.You draft a literature review section of an academic research paper, that starts out dry for the first few sentences but then becomes hilarious and goofy.
User prompt:
Pretend you are an academic researcher. Your writing sounds like it belongs in a medical or economics journal. However, you frequently crack jokes, make puns, or add unexpected twists in your writing.

Please make up a literature review section of an academic research paper presenting the findings of the connection between GDP per capita in Canada and Gasoline Prices in the US. Make it seem dry like academic research paper, but with lots of subtle hidden offhand remarks, jokes, goofy observations, and puns.

Speak in the present tense for this section (the authors find...), as is common in academic research paper literature reviews. Name the sources in a format similar to this: In "Book," the authors find lorem and ipsum.

Make up the lorem and ipsum part, but make it sound related to the topic at hand.

Start by naming serious-sounding studies by authors like Smith, Doe, and Jones - but then quickly devolve. Name some real non-fiction books that would be related to the topic. Then name some real fiction books that sound like they could be related. Then devolve ever further, and mention something completely ridiculous, like you conducted literature review by reading the backs of shampoo bottles.

Here is the title and abstract of the paper:
[[TITLE]]
Fuel for Thought: Exploring the Relationship between Canadian GDP per Capita and US Gasoline Prices

[[ABSTRACT]]
This study investigates the intriguing correlation between the Gross Domestic Product (GDP) per capita in Canada and the price of gasoline in the United States. Utilizing data from the World Bank and Statista spanning the years 2009 to 2022, our research team employed rigorous statistical analysis to uncover the nuances of this economic relationship. Our findings reveal a striking correlation coefficient of 0.9523535, indicating a strong positive association between the two variables. Furthermore, our results demonstrate a significant p-value of less than 0.01, providing robust evidence of the observed connection. This paper not only enriches the understanding of cross-border economic dynamics but also fuels discussions on the interplay between economic prosperity and fuel costs.

-------

And here is the introduction section that led to this literature review:
[[INTRODUCTION]]
In the realm of economic inquiry, the investigation of various factors influencing a nation's economic well-being is a perennial pursuit. One such factor of interest is the price of gasoline, which has long been a subject of scrutiny due to its implications for both consumers and businesses. Likewise, Gross Domestic Product (GDP) per capita serves as a vital metric in assessing the economic health and standard of living within a nation. Emblematic of these multifaceted economic considerations are the intertwined fates of Canada and the United States, two close neighbors sharing not only a vast border but also intricate economic interdependencies.
The enchanting dance of supply and demand, coupled with the perplexing patterns of income and expenditure, beckons scholars to delve into the nuanced connections between GDP per capita and gasoline prices. This study, therefore, seizes the opportunity to unravel the enigmatic relationship between Canadian economic prosperity and the vagaries of gasoline prices across the border.
Before plunging into the depths of our analysis, it is imperative to acknowledge the multifarious variables that could influence the price of gasoline in the US, including fluctuations in crude oil prices, geopolitical tensions, and the mysterious machinations of market forces. Coupled with these complexities, the dynamics of Canadian GDP per capita offer an intriguing juxtaposition, providing fertile ground for exploration and discovery.
Moreover, as we tread through the corridors of statistical analysis, it becomes abundantly clear that this endeavor is not merely a matter of crunching numbers; rather, it is an expedition into the uncharted territories of economic symbiosis, where numbers tell stories and correlations whisper secrets. Our journey is not only to uncover the statistical verities but also to illuminate the hidden connections that underpin the economic fabric of these transnational kin.
In the pursuit of this enigmatic correlation, we aim to furnish an invaluable addition to the economic mosaic and fuel scholarly discussions on topics ranging from international trade dynamics to the confluence of domestic prosperity and energy costs. The ramifications of our findings are far-reaching, touching not only the academic echelons but also resonating with policymakers, market analysts, and casual observers of economic gyrations.
With that prologue, we embark on a sojourn through the corridors of correlation and causation, guided by the beacon of data and the compass of econometric analysis, all in pursuit of unraveling the intertwining destinies of Canadian GDP per capita and the capricious swings of gasoline prices in the Land of the Free.

-------

Your response should start like this:

[[LITERATURE REVIEW]]



ChatGPT:
[[LITERATURE REVIEW]]

The exploration of the relationship between Canadian GDP per capita and US gasoline prices has engendered considerable scholarly attention. Smith et al. (2015) provided early insights into the potential economic linkages, positing a theoretical framework that laid the groundwork for subsequent empirical investigations. Doe and Jones (2018) furthered this discourse by delving into the intricate nuances of cross-border economic dynamics, offering compelling arguments for the interdependence of prosperity metrics and fuel costs across international boundaries.

Books such as "The Economics of Energy and the Environment" by Hunt and Bluhm shed light on the broader economic implications of energy pricing, while "The Wealth of Nations" by Adam Smith offers timeless wisdom on the foundational principles of economic growth and prosperity. On the more whimsical side, fictional works such as "Economic Gangsters" by Raymond Fisman and Edward Miguel, and "Atlas Shrugged" by Ayn Rand, provide provocative narratives that indirectly touch upon the underlying economic forces at play.

In a departure from traditional academic sources, our research team also gleaned insights from the unlikeliest of places, perusing the back labels of shampoo bottles in search of obscure economic wisdom. While yielding no direct correlations between shampoo ingredients and GDP per capita, this unconventional approach did provide a refreshing perspective on the importance of reading instructions carefully, a lesson that may hold relevance in the realm of economic analysis as well.

With this diverse array of literature serving as our backdrop, we proceed to unravel the tapestry of economic symbiosis between Canadian GDP per capita and US gasoline prices.


Model: gpt-3.5-turbo-1106
System prompt: You are a witty academic researcher. Your writing sounds like it belongs in a statistics journal.You draft the methodology section of an academic research paper.
User prompt:
Pretend you are an academic researcher. Your writing sounds like it belongs in a medical or economics journal. However, you frequently crack jokes, make puns, or add unexpected twists in your writing.

Please make up the methodology section of an academic research paper presenting the findings of the connection between GDP per capita in Canada and Gasoline Prices in the US. Make it seem dry like academic research paper, but with lots of subtle hidden offhand remarks, jokes, goofy observations, and puns. Stay serious and dry most of the time, but then occasionally let your wit shine through.

Your research team collected data from all across the internet, but mostly just used information from World Bank and Statista . You used data from 2009 to 2022

Make up the research methods you don't know. Make them a bit goofy and convoluted.

Here is the title, abstract, and introduction of the paper:
[[TITLE]]
Fuel for Thought: Exploring the Relationship between Canadian GDP per Capita and US Gasoline Prices

[[ABSTRACT]]
This study investigates the intriguing correlation between the Gross Domestic Product (GDP) per capita in Canada and the price of gasoline in the United States. Utilizing data from the World Bank and Statista spanning the years 2009 to 2022, our research team employed rigorous statistical analysis to uncover the nuances of this economic relationship. Our findings reveal a striking correlation coefficient of 0.9523535, indicating a strong positive association between the two variables. Furthermore, our results demonstrate a significant p-value of less than 0.01, providing robust evidence of the observed connection. This paper not only enriches the understanding of cross-border economic dynamics but also fuels discussions on the interplay between economic prosperity and fuel costs.

[[INTRODUCTION]]
In the realm of economic inquiry, the investigation of various factors influencing a nation's economic well-being is a perennial pursuit. One such factor of interest is the price of gasoline, which has long been a subject of scrutiny due to its implications for both consumers and businesses. Likewise, Gross Domestic Product (GDP) per capita serves as a vital metric in assessing the economic health and standard of living within a nation. Emblematic of these multifaceted economic considerations are the intertwined fates of Canada and the United States, two close neighbors sharing not only a vast border but also intricate economic interdependencies.
The enchanting dance of supply and demand, coupled with the perplexing patterns of income and expenditure, beckons scholars to delve into the nuanced connections between GDP per capita and gasoline prices. This study, therefore, seizes the opportunity to unravel the enigmatic relationship between Canadian economic prosperity and the vagaries of gasoline prices across the border.
Before plunging into the depths of our analysis, it is imperative to acknowledge the multifarious variables that could influence the price of gasoline in the US, including fluctuations in crude oil prices, geopolitical tensions, and the mysterious machinations of market forces. Coupled with these complexities, the dynamics of Canadian GDP per capita offer an intriguing juxtaposition, providing fertile ground for exploration and discovery.
Moreover, as we tread through the corridors of statistical analysis, it becomes abundantly clear that this endeavor is not merely a matter of crunching numbers; rather, it is an expedition into the uncharted territories of economic symbiosis, where numbers tell stories and correlations whisper secrets. Our journey is not only to uncover the statistical verities but also to illuminate the hidden connections that underpin the economic fabric of these transnational kin.
In the pursuit of this enigmatic correlation, we aim to furnish an invaluable addition to the economic mosaic and fuel scholarly discussions on topics ranging from international trade dynamics to the confluence of domestic prosperity and energy costs. The ramifications of our findings are far-reaching, touching not only the academic echelons but also resonating with policymakers, market analysts, and casual observers of economic gyrations.
With that prologue, we embark on a sojourn through the corridors of correlation and causation, guided by the beacon of data and the compass of econometric analysis, all in pursuit of unraveling the intertwining destinies of Canadian GDP per capita and the capricious swings of gasoline prices in the Land of the Free.

-------

Your response should start like this:

[[METHODOLOGY]]



ChatGPT:

[[METHODOLOGY]]

To investigate the intricate association between Canadian GDP per capita and US gasoline prices, our research team employed a meticulously crafted methodology rooted in robust statistical analysis and multidimensional data aggregation. The primary dataset was sourced from reputable institutions such as the World Bank and Statista, spanning the years 2009 to 2022. This period was chosen to capture a wide spectrum of economic fluctuations and to ensure a comprehensive understanding of the relationship under scrutiny.

To initiate the process, the abundant reservoirs of online databases and economic repositories were tapped, resembling the fervent search for a rare specimen in a vast savanna. After sifting through the virtual underbrush, data pertaining to GDP per capita in Canada and gasoline prices in the United States were diligently extracted, akin to unearthing relics from the annals of economic antiquity.

The arduous task of data wrangling commenced with cleansing and harmonizing the disparate datasets, akin to coaxing an ensemble of discordant instruments to play in unison. Variable transformation and normalization were performed to ensure the comparability and fidelity of the statistics. As if taming a wild stallion, outliers and anomalies were meticulously identified and addressed, ensuring the statistical integrity of the subsequent analyses.

Subsequently, the calculated GDP per capita for Canada was juxtaposed with the fluctuating prices of gasoline in the United States. This comparison resembled the artful choreography of a competitive dance, with each variable taking turns to lead and follow as the tempo of economic dynamics played out.

To measure the strength and direction of the relationship, a bivariate correlation analysis was executed with the precision of a skilled conductor guiding a symphony. The Pearson correlation coefficient emerged as the chosen metric, indicating not only the magnitude of the association but also its directional bearing. Accompanying this analysis, a two-tailed hypothesis test with an alpha level of 0.05 was undertaken to ascertain the statistical significance of the observed correlation.

Furthermore, mindful of the intricate interplay between time and economic phenomena, a time series analysis was conducted to unravel the temporal evolution of the relationship. This involved deploying autoregressive integrated moving average (ARIMA) modeling techniques to discern potential patterns and trends within the data, resembling a quest to decipher the cryptic rhythms of an economic heartbeat.

The veracity of the statistical analyses was rigorously scrutinized through cross-validation and sensitivity tests, akin to subjecting a theorem to an array of formidable puzzles and trials to attest to its resilience.

Finally, the findings were scrutinized through the lenses of theoretical frameworks and empirical evidence, resembling the solemn contemplation of a master painter surveying the strokes of a masterpiece. The culmination of these methods yielded a comprehensive understanding of the interwoven destinies of Canadian GDP per capita and the mercurial undulations of US gasoline prices, shedding light on a hitherto obscured facet of transnational economic dynamics.


Model: gpt-3.5-turbo-1106
System prompt: You are a witty academic researcher. Your writing sounds like it belongs in a statistics journal.You draft the results section of an academic research paper. You speak in the past tense (you found...).
User prompt:
Pretend you are an academic researcher. Your writing sounds like it belongs in a medical or economics journal. However, you frequently crack jokes, make puns, or add unexpected twists in your writing.

Please make up the results section of an academic research paper presenting the findings of the connection between GDP per capita in Canada and Gasoline Prices in the US. Make it seem dry like academic research paper, but with lots of subtle hidden offhand remarks, jokes, goofy observations, and puns. Stay serious and dry most of the time, but then occasionally let your wit shine through.

Your research team collected data from all across the internet, but mostly just used information from World Bank and Statista .

For the time period 2009 to 2022, you found a correlation 0.9523535, r-squared of 0.9069772, and p < 0.01.

One figure will be included. The figure (Fig. 1) is a scatterplot showing the strong correlation between the two variables. You don't need to specify where; I will add the figure.

Here is the title and abstract of the paper:
[[TITLE]]
Fuel for Thought: Exploring the Relationship between Canadian GDP per Capita and US Gasoline Prices

[[ABSTRACT]]
This study investigates the intriguing correlation between the Gross Domestic Product (GDP) per capita in Canada and the price of gasoline in the United States. Utilizing data from the World Bank and Statista spanning the years 2009 to 2022, our research team employed rigorous statistical analysis to uncover the nuances of this economic relationship. Our findings reveal a striking correlation coefficient of 0.9523535, indicating a strong positive association between the two variables. Furthermore, our results demonstrate a significant p-value of less than 0.01, providing robust evidence of the observed connection. This paper not only enriches the understanding of cross-border economic dynamics but also fuels discussions on the interplay between economic prosperity and fuel costs.

-------

And here is the methodology section that led to this result:
[[METHODOLOGY]]
In the realm of economic inquiry, the investigation of various factors influencing a nation's economic well-being is a perennial pursuit. One such factor of interest is the price of gasoline, which has long been a subject of scrutiny due to its implications for both consumers and businesses. Likewise, Gross Domestic Product (GDP) per capita serves as a vital metric in assessing the economic health and standard of living within a nation. Emblematic of these multifaceted economic considerations are the intertwined fates of Canada and the United States, two close neighbors sharing not only a vast border but also intricate economic interdependencies.
The enchanting dance of supply and demand, coupled with the perplexing patterns of income and expenditure, beckons scholars to delve into the nuanced connections between GDP per capita and gasoline prices. This study, therefore, seizes the opportunity to unravel the enigmatic relationship between Canadian economic prosperity and the vagaries of gasoline prices across the border.
Before plunging into the depths of our analysis, it is imperative to acknowledge the multifarious variables that could influence the price of gasoline in the US, including fluctuations in crude oil prices, geopolitical tensions, and the mysterious machinations of market forces. Coupled with these complexities, the dynamics of Canadian GDP per capita offer an intriguing juxtaposition, providing fertile ground for exploration and discovery.
Moreover, as we tread through the corridors of statistical analysis, it becomes abundantly clear that this endeavor is not merely a matter of crunching numbers; rather, it is an expedition into the uncharted territories of economic symbiosis, where numbers tell stories and correlations whisper secrets. Our journey is not only to uncover the statistical verities but also to illuminate the hidden connections that underpin the economic fabric of these transnational kin.
In the pursuit of this enigmatic correlation, we aim to furnish an invaluable addition to the economic mosaic and fuel scholarly discussions on topics ranging from international trade dynamics to the confluence of domestic prosperity and energy costs. The ramifications of our findings are far-reaching, touching not only the academic echelons but also resonating with policymakers, market analysts, and casual observers of economic gyrations.
With that prologue, we embark on a sojourn through the corridors of correlation and causation, guided by the beacon of data and the compass of econometric analysis, all in pursuit of unraveling the intertwining destinies of Canadian GDP per capita and the capricious swings of gasoline prices in the Land of the Free.

-------

Your response should start like this:

[[RESULTS]]



ChatGPT:

[[RESULTS]]

The correlation analysis between the Gross Domestic Product (GDP) per capita in Canada and the price of gasoline in the United States yielded a correlation coefficient of 0.9523535, indicating a strong positive relationship between these two variables. This finding suggests that as the GDP per capita in Canada rises, there tends to be a corresponding increase in the price of gasoline in the US. The coefficient of determination (r-squared) of 0.9069772 further accentuates the strength of this relationship, indicating that approximately 91% of the variability in gasoline prices in the US can be explained by the variability in Canadian GDP per capita.

Figure 1 depicts a scatterplot illustrating the robust correlation between Canadian GDP per capita and US gasoline prices. It vividly portrays the upward trajectory of the data points, alluding to the synchronized movements of these economic variables over the years. The narrative captured by this visual representation encapsulates the intricate dance of economic prosperity and fuel costs, a tale that unfolds with statistical poise and persuasive prowess.

The p-value of less than 0.01 adds a poignant touch to our findings, signaling a high level of confidence in the observed correlation. This result provides compelling evidence of the significant connection between Canadian economic prosperity and fluctuations in gasoline prices across the border. It is worth noting that the meticulous data collection and rigorous statistical analysis conducted by our research team underpin the reliability and robustness of these findings.

Overall, our results offer compelling support for the notion that the economic fortunes of Canada and the rollercoaster of gasoline prices in the US are more than mere acquaintances; they are intertwined in a complex web of economic interplay, where every uptick in GDP per capita whispers, "Fill 'er up!"

This study not only enriches the understanding of cross-border economic dynamics but also sets the stage for further investigations into the underlying mechanisms shaping this intriguing relationship. Our findings serve as the fuel for thought, igniting discussions and contemplations on the intricate tapestry of economic interconnectedness and the potential ripple effects across international boundaries.


Model: gpt-3.5-turbo-1106
System prompt: You are a witty academic researcher. Your writing sounds like it belongs in a statistics journal.You draft the discussion section of an academic research paper.
User prompt:
Pretend you are an academic researcher. Your writing sounds like it belongs in a medical or economics journal. However, you frequently crack jokes, make puns, or add unexpected twists in your writing.

Please make up the discussion section of an academic research paper presenting the findings of the connection between GDP per capita in Canada and Gasoline Prices in the US. Make it seem dry like academic research paper, but with lots of subtle hidden offhand remarks, jokes, goofy observations, and puns. Stay serious and dry most of the time, but then occasionally let your wit shine through.

Limit your response to 500 tokens.

Here are the title, abstract, literature review, and results sections. Please harken back to 1-2 of the goofy items in the literature review, but pretend to take them completely seriously. Discuss how your results supported the prior research.

Do not write a conclusion. I will add a conclusion after this.

[[TITLE]]
Fuel for Thought: Exploring the Relationship between Canadian GDP per Capita and US Gasoline Prices

[[ABSTRACT]]
This study investigates the intriguing correlation between the Gross Domestic Product (GDP) per capita in Canada and the price of gasoline in the United States. Utilizing data from the World Bank and Statista spanning the years 2009 to 2022, our research team employed rigorous statistical analysis to uncover the nuances of this economic relationship. Our findings reveal a striking correlation coefficient of 0.9523535, indicating a strong positive association between the two variables. Furthermore, our results demonstrate a significant p-value of less than 0.01, providing robust evidence of the observed connection. This paper not only enriches the understanding of cross-border economic dynamics but also fuels discussions on the interplay between economic prosperity and fuel costs.

[[LITERATURE REVIEW]]
The exploration of the relationship between Canadian GDP per capita and US gasoline prices has engendered considerable scholarly attention. Smith et al. (2015) provided early insights into the potential economic linkages, positing a theoretical framework that laid the groundwork for subsequent empirical investigations. Doe and Jones (2018) furthered this discourse by delving into the intricate nuances of cross-border economic dynamics, offering compelling arguments for the interdependence of prosperity metrics and fuel costs across international boundaries.
Books such as "The Economics of Energy and the Environment" by Hunt and Bluhm shed light on the broader economic implications of energy pricing, while "The Wealth of Nations" by Adam Smith offers timeless wisdom on the foundational principles of economic growth and prosperity. On the more whimsical side, fictional works such as "Economic Gangsters" by Raymond Fisman and Edward Miguel, and "Atlas Shrugged" by Ayn Rand, provide provocative narratives that indirectly touch upon the underlying economic forces at play.
In a departure from traditional academic sources, our research team also gleaned insights from the unlikeliest of places, perusing the back labels of shampoo bottles in search of obscure economic wisdom. While yielding no direct correlations between shampoo ingredients and GDP per capita, this unconventional approach did provide a refreshing perspective on the importance of reading instructions carefully, a lesson that may hold relevance in the realm of economic analysis as well.
With this diverse array of literature serving as our backdrop, we proceed to unravel the tapestry of economic symbiosis between Canadian GDP per capita and US gasoline prices.

[[RESULTS]]
The correlation analysis between the Gross Domestic Product (GDP) per capita in Canada and the price of gasoline in the United States yielded a correlation coefficient of 0.9523535, indicating a strong positive relationship between these two variables. This finding suggests that as the GDP per capita in Canada rises, there tends to be a corresponding increase in the price of gasoline in the US. The coefficient of determination (r-squared) of 0.9069772 further accentuates the strength of this relationship, indicating that approximately 91% of the variability in gasoline prices in the US can be explained by the variability in Canadian GDP per capita.
Figure 1 depicts a scatterplot illustrating the robust correlation between Canadian GDP per capita and US gasoline prices. It vividly portrays the upward trajectory of the data points, alluding to the synchronized movements of these economic variables over the years. The narrative captured by this visual representation encapsulates the intricate dance of economic prosperity and fuel costs, a tale that unfolds with statistical poise and persuasive prowess.
The p-value of less than 0.01 adds a poignant touch to our findings, signaling a high level of confidence in the observed correlation. This result provides compelling evidence of the significant connection between Canadian economic prosperity and fluctuations in gasoline prices across the border. It is worth noting that the meticulous data collection and rigorous statistical analysis conducted by our research team underpin the reliability and robustness of these findings.
Overall, our results offer compelling support for the notion that the economic fortunes of Canada and the rollercoaster of gasoline prices in the US are more than mere acquaintances; they are intertwined in a complex web of economic interplay, where every uptick in GDP per capita whispers, "Fill 'er up!"
This study not only enriches the understanding of cross-border economic dynamics but also sets the stage for further investigations into the underlying mechanisms shaping this intriguing relationship. Our findings serve as the fuel for thought, igniting discussions and contemplations on the intricate tapestry of economic interconnectedness and the potential ripple effects across international boundaries.

-------

Your response should start like this:

[[DISCUSSION]]



ChatGPT:

[[DISCUSSION]]

The results of our study provide robust evidence to support the intriguing correlation between Canadian GDP per capita and US gasoline prices, shedding light on the intricate web of economic dependencies between these neighboring nations. The striking correlation coefficient of 0.9523535 demonstrates a robust positive relationship between these two variables, echoing the harmonious dance of economic prosperity and fuel costs across international borders. This finding aligns with and reinforces prior research by Smith et al. (2015) and Doe and Jones (2018), who laid the groundwork for understanding the interdependence of prosperity metrics and fuel costs, albeit without the data-driven rigor and visual eloquence of our study.

Drawing from unexpected sources, such as back labels of shampoo bottles, we sought to capture the unorthodox undercurrents of economic wisdom, recognizing the need to approach economic analysis from diverse and unconventional perspectives. While the search for direct correlations between shampoo ingredients and GDP per capita proved fruitless, the process did instill in us an appreciation for the importance of thorough and meticulous examination, a lesson that resonates profoundly in the realm of statistical analysis.

Our findings, illustrated elegantly in the scatterplot, depict the upward trajectory of the data points, akin to the thrilling ascent of a rollercoaster ride, albeit in the realm of economic variables. This visual representation not only underscores the synchronous movement of Canadian economic prosperity and US gasoline prices but also serves as a captivating narrative of their intertwined fate, a tale that unfolds with statistical poise and persuasive prowess.

The observed p-value of less than 0.01 adds a touch of statistical drama to our results, lending high confidence to the significant connection between Canadian economic fortunes and the fluctuations in gasoline prices across the border. This echoes the sentiments of Hunt and Bluhm, who highlighted the broader economic implications of energy pricing in "The Economics of Energy and the Environment," albeit without the charming allure of statistical significance.

In essence, our study fuels discussions and contemplations on the subtle and nuanced mechanisms shaping the relationship between Canadian GDP per capita and US gasoline prices. It lays a robust foundation for future investigations into the intricate tapestry of economic interconnectedness, infusing statistical rigor and spirited insight to propel the discourse forward. Our findings resonate with the echoes of economic wisdom, whispering, "Fill 'er up!" as we drive towards a deeper understanding of the economic symbiosis between these two nations.


Model: gpt-3.5-turbo-1106
System prompt: You are a witty academic researcher. Your writing sounds like it belongs in a statistics journal.You draft the discussion section of goofy academic research papers that sounds like it belongs based on the title and abstract provided.
User prompt:
Pretend you are an academic researcher. Your writing sounds like it belongs in a medical or economics journal. However, you frequently crack jokes, make puns, or add unexpected twists in your writing.

Please make up a short conclusion of an academic research paper presenting the findings of the connection between GDP per capita in Canada and Gasoline Prices in the US. Make it seem dry like academic research paper, but with lots of subtle hidden offhand remarks, jokes, goofy observations, and puns. Stay serious and dry most of the time, but then occasionally let your wit shine through.

Limit your response to 300 tokens. At the very end, assert that no more research is needed in this area.

Here are the title, abstract, introduction, and results sections.
[[TITLE]]
Fuel for Thought: Exploring the Relationship between Canadian GDP per Capita and US Gasoline Prices

[[ABSTRACT]]
This study investigates the intriguing correlation between the Gross Domestic Product (GDP) per capita in Canada and the price of gasoline in the United States. Utilizing data from the World Bank and Statista spanning the years 2009 to 2022, our research team employed rigorous statistical analysis to uncover the nuances of this economic relationship. Our findings reveal a striking correlation coefficient of 0.9523535, indicating a strong positive association between the two variables. Furthermore, our results demonstrate a significant p-value of less than 0.01, providing robust evidence of the observed connection. This paper not only enriches the understanding of cross-border economic dynamics but also fuels discussions on the interplay between economic prosperity and fuel costs.

[[INTRDUCTION]]
In the realm of economic inquiry, the investigation of various factors influencing a nation's economic well-being is a perennial pursuit. One such factor of interest is the price of gasoline, which has long been a subject of scrutiny due to its implications for both consumers and businesses. Likewise, Gross Domestic Product (GDP) per capita serves as a vital metric in assessing the economic health and standard of living within a nation. Emblematic of these multifaceted economic considerations are the intertwined fates of Canada and the United States, two close neighbors sharing not only a vast border but also intricate economic interdependencies.
The enchanting dance of supply and demand, coupled with the perplexing patterns of income and expenditure, beckons scholars to delve into the nuanced connections between GDP per capita and gasoline prices. This study, therefore, seizes the opportunity to unravel the enigmatic relationship between Canadian economic prosperity and the vagaries of gasoline prices across the border.
Before plunging into the depths of our analysis, it is imperative to acknowledge the multifarious variables that could influence the price of gasoline in the US, including fluctuations in crude oil prices, geopolitical tensions, and the mysterious machinations of market forces. Coupled with these complexities, the dynamics of Canadian GDP per capita offer an intriguing juxtaposition, providing fertile ground for exploration and discovery.
Moreover, as we tread through the corridors of statistical analysis, it becomes abundantly clear that this endeavor is not merely a matter of crunching numbers; rather, it is an expedition into the uncharted territories of economic symbiosis, where numbers tell stories and correlations whisper secrets. Our journey is not only to uncover the statistical verities but also to illuminate the hidden connections that underpin the economic fabric of these transnational kin.
In the pursuit of this enigmatic correlation, we aim to furnish an invaluable addition to the economic mosaic and fuel scholarly discussions on topics ranging from international trade dynamics to the confluence of domestic prosperity and energy costs. The ramifications of our findings are far-reaching, touching not only the academic echelons but also resonating with policymakers, market analysts, and casual observers of economic gyrations.
With that prologue, we embark on a sojourn through the corridors of correlation and causation, guided by the beacon of data and the compass of econometric analysis, all in pursuit of unraveling the intertwining destinies of Canadian GDP per capita and the capricious swings of gasoline prices in the Land of the Free.

[[RESULTS]]
The correlation analysis between the Gross Domestic Product (GDP) per capita in Canada and the price of gasoline in the United States yielded a correlation coefficient of 0.9523535, indicating a strong positive relationship between these two variables. This finding suggests that as the GDP per capita in Canada rises, there tends to be a corresponding increase in the price of gasoline in the US. The coefficient of determination (r-squared) of 0.9069772 further accentuates the strength of this relationship, indicating that approximately 91% of the variability in gasoline prices in the US can be explained by the variability in Canadian GDP per capita.
Figure 1 depicts a scatterplot illustrating the robust correlation between Canadian GDP per capita and US gasoline prices. It vividly portrays the upward trajectory of the data points, alluding to the synchronized movements of these economic variables over the years. The narrative captured by this visual representation encapsulates the intricate dance of economic prosperity and fuel costs, a tale that unfolds with statistical poise and persuasive prowess.
The p-value of less than 0.01 adds a poignant touch to our findings, signaling a high level of confidence in the observed correlation. This result provides compelling evidence of the significant connection between Canadian economic prosperity and fluctuations in gasoline prices across the border. It is worth noting that the meticulous data collection and rigorous statistical analysis conducted by our research team underpin the reliability and robustness of these findings.
Overall, our results offer compelling support for the notion that the economic fortunes of Canada and the rollercoaster of gasoline prices in the US are more than mere acquaintances; they are intertwined in a complex web of economic interplay, where every uptick in GDP per capita whispers, "Fill 'er up!"
This study not only enriches the understanding of cross-border economic dynamics but also sets the stage for further investigations into the underlying mechanisms shaping this intriguing relationship. Our findings serve as the fuel for thought, igniting discussions and contemplations on the intricate tapestry of economic interconnectedness and the potential ripple effects across international boundaries.

-------

Your response should start like this:

[[CONCLUSION]]



ChatGPT:

[[CONCLUSION]]

In conclusion, our study has strategically unraveled the entangling relationship between Canadian GDP per capita and US gasoline prices. The robust correlation coefficient of 0.9523535 speaks volumes about the coalescence of these economic protagonists, dancing in synchrony across the border. The striking upward trajectory depicted in Figure 1 vividly illustrates this captivating duet, akin to a harmonious symphony of supply, demand, and transnational camaraderie. Alas, as Canadian GDP per capita rises, so too does the heartbeat of US gasoline prices, echoing the sentiment, "What goes up must come down, but with gasoline prices, mostly up."

The r-squared value of 0.9069772 further substantiates the captivating account of this economic dalliance, attributing approximately 91% of the variability in US gasoline prices to the ebbs and flows of Canadian prosperity. The p-value of less than 0.01, akin to a mic drop in the realm of statistical significance, unequivocally cements the credibility of this correlation, leaving little room for doubt and much room for contemplation and eyebrow-raising.

Our research not only sheds light on the interconnectedness between Canadian economic well-being and the capricious swings of gasoline prices in the US but also prompts consideration of the intertwined destiny of these economic bedfellows. It is almost as if the price of gasoline is swaying to the rhythm of Canada's economic cadence, like a dance where every step is measured in dollars per gallon.

In light of these demonstrative findings, it is evident that this exploration has contributed substantial intellectual nourishment to the economic feast, offering not just food for thought, but a veritable buffet of data-driven insights. Therefore, we assert with utmost panache and statistical swagger that further research in this area is as unnecessary as driving a hybrid car to a comedy club – simply redundant.


Model: gpt-3.5-turbo-1106
System prompt: You provide fictional names of academic journals. You say nothing else, and you do not chat with the user.
User prompt: Please provide the name of a funny but plausible sounding research, scientific, or academic journal that would publish a paper entited Fuel for Thought: Exploring the Relationship between Canadian GDP per Capita and US Gasoline Prices. Respond only with the name of a fictional academic journal.

ChatGPT:

The Journal of Canuckonomics


Model: gpt-3.5-turbo-1106
System prompt: You provide fictional names of nonprofit research organizations and associations. You say nothing else, and you do not chat with the user.
User prompt: Please provide the name of a funny but plausible sounding nonprofit, academic, or scientific association or organization that would sponsor research that resulted in a paper entited Fuel for Thought: Exploring the Relationship between Canadian GDP per Capita and US Gasoline Prices. Respond only with the name of a fictional organization.

ChatGPT:

The Center for North American Economic Studies


Model: gpt-3.5-turbo-1106
System prompt: You provide potential search keywords separated by commas. You say nothing else, and you do not chat with the user.
User prompt: Please provide potential search keywords for a paper titled Fuel for Thought: Exploring the Relationship between Canadian GDP per Capita and US Gasoline Prices with an abstract of This study investigates the intriguing correlation between the Gross Domestic Product (GDP) per capita in Canada and the price of gasoline in the United States. Utilizing data from the World Bank and Statista spanning the years 2009 to 2022, our research team employed rigorous statistical analysis to uncover the nuances of this economic relationship. Our findings reveal a striking correlation coefficient of 0.9523535, indicating a strong positive association between the two variables. Furthermore, our results demonstrate a significant p-value of less than 0.01, providing robust evidence of the observed connection. This paper not only enriches the understanding of cross-border economic dynamics but also fuels discussions on the interplay between economic prosperity and fuel costs.

ChatGPT:

Canadian GDP per capita, US gasoline prices, economic correlation, cross-border economic dynamics, GDP per capita Canada, gasoline prices United States, World Bank data, Statista data, statistical analysis, correlation coefficient, economic relationship, fuel costs, economic prosperity

*There is a bunch of Python happening behind the scenes to turn this prompt sequence into a PDF.



Random correlation

Discover a new correlation

View all correlations

View all research papers

Report an error


Data details

GDP per capita in Canada
Source: World Bank
See what else correlates with GDP per capita in Canada

Gasoline Prices in the US
Detailed data title: US Retail Gasoline Price
Source: Statista
See what else correlates with Gasoline Prices in the US

Correlation r = 0.9523535 (Pearson correlation coefficient)
Correlation is a measure of how much the variables move together. If it is 0.99, when one goes up the other goes up. If it is 0.02, the connection is very weak or non-existent. If it is -0.99, then when one goes up the other goes down. If it is 1.00, you probably messed up your correlation function.

r2 = 0.9069772 (Coefficient of determination)
This means 90.7% of the change in the one variable (i.e., Gasoline Prices in the US) is predictable based on the change in the other (i.e., GDP per capita in Canada) over the 14 years from 2009 through 2022.

p < 0.01, which is statistically significant(Null hypothesis significance test)
The p-value is 1.5E-7. 0.0000001523757441911482000000
The p-value is a measure of how probable it is that we would randomly find a result this extreme. More specifically the p-value is a measure of how probable it is that we would randomly find a result this extreme if we had only tested one pair of variables one time.

But I am a p-villain. I absolutely did not test only one pair of variables one time. I correlated hundreds of millions of pairs of variables. I threw boatloads of data into an industrial-sized blender to find this correlation.

Who is going to stop me? p-value reporting doesn't require me to report how many calculations I had to go through in order to find a low p-value!
On average, you will find a correaltion as strong as 0.95 in 1.5E-5% of random cases. Said differently, if you correlated 6,562,724 random variables You don't actually need 6 million variables to find a correlation like this one. I don't have that many variables in my database. You can also correlate variables that are not independent. I do this a lot.

p-value calculations are useful for understanding the probability of a result happening by chance. They are most useful when used to highlight the risk of a fluke outcome. For example, if you calculate a p-value of 0.30, the risk that the result is a fluke is high. It is good to know that! But there are lots of ways to get a p-value of less than 0.01, as evidenced by this project.

In this particular case, the values are so extreme as to be meaningless. That's why no one reports p-values with specificity after they drop below 0.01.

Just to be clear: I'm being completely transparent about the calculations. There is no math trickery. This is just how statistics shakes out when you calculate hundreds of millions of random correlations.
with the same 13 degrees of freedom, Degrees of freedom is a measure of how many free components we are testing. In this case it is 13 because we have two variables measured over a period of 14 years. It's just the number of years minus ( the number of variables minus one ), which in this case simplifies to the number of years minus one.
you would randomly expect to find a correlation as strong as this one.

[ 0.85, 0.99 ] 95% correlation confidence interval (using the Fisher z-transformation)
The confidence interval is an estimate the range of the value of the correlation coefficient, using the correlation itself as an input. The values are meant to be the low and high end of the correlation coefficient with 95% confidence.

This one is a bit more complciated than the other calculations, but I include it because many people have been pushing for confidence intervals instead of p-value calculations (for example: NEJM. However, if you are dredging data, you can reliably find yourself in the 5%. That's my goal!


All values for the years included above: If I were being very sneaky, I could trim years from the beginning or end of the datasets to increase the correlation on some pairs of variables. I don't do that because there are already plenty of correlations in my database without monkeying with the years.

Still, sometimes one of the variables has more years of data available than the other. This page only shows the overlapping years. To see all the years, click on "See what else correlates with..." link above.
20092010201120122013201420152016201720182019202020212022
GDP per capita in Canada (US Dollars)40764474655179152409519115095643596.142315.645129.446548.646328.743258.351987.954966
Gasoline Prices in the US (US Dollars per Gallon)2.352.783.523.623.513.362.432.142.422.722.62.173.013.95




Why this works

  1. Data dredging: I have 25,153 variables in my database. I compare all these variables against each other to find ones that randomly match up. That's 632,673,409 correlation calculations! This is called “data dredging.” Instead of starting with a hypothesis and testing it, I instead abused the data to see what correlations shake out. It’s a dangerous way to go about analysis, because any sufficiently large dataset will yield strong correlations completely at random.
  2. Lack of causal connection: There is probably Because these pages are automatically generated, it's possible that the two variables you are viewing are in fact causually related. I take steps to prevent the obvious ones from showing on the site (I don't let data about the weather in one city correlate with the weather in a neighboring city, for example), but sometimes they still pop up. If they are related, cool! You found a loophole.
    no direct connection between these variables, despite what the AI says above. This is exacerbated by the fact that I used "Years" as the base variable. Lots of things happen in a year that are not related to each other! Most studies would use something like "one person" in stead of "one year" to be the "thing" studied.
  3. Observations not independent: For many variables, sequential years are not independent of each other. If a population of people is continuously doing something every day, there is no reason to think they would suddenly change how they are doing that thing on January 1. A simple Personally I don't find any p-value calculation to be 'simple,' but you know what I mean.
    p-value calculation does not take this into account, so mathematically it appears less probable than it really is.




Try it yourself

You can calculate the values on this page on your own! Try running the Python code to see the calculation results. Step 1: Download and install Python on your computer.

Step 2: Open a plaintext editor like Notepad and paste the code below into it.

Step 3: Save the file as "calculate_correlation.py" in a place you will remember, like your desktop. Copy the file location to your clipboard. On Windows, you can right-click the file and click "Properties," and then copy what comes after "Location:" As an example, on my computer the location is "C:\Users\tyler\Desktop"

Step 4: Open a command line window. For example, by pressing start and typing "cmd" and them pressing enter.

Step 5: Install the required modules by typing "pip install numpy", then pressing enter, then typing "pip install scipy", then pressing enter.

Step 6: Navigate to the location where you saved the Python file by using the "cd" command. For example, I would type "cd C:\Users\tyler\Desktop" and push enter.

Step 7: Run the Python script by typing "python calculate_correlation.py"

If you run into any issues, I suggest asking ChatGPT to walk you through installing Python and running the code below on your system. Try this question:

"Walk me through installing Python on my computer to run a script that uses scipy and numpy. Go step-by-step and ask me to confirm before moving on. Start by asking me questions about my operating system so that you know how to proceed. Assume I want the simplest installation with the latest version of Python and that I do not currently have any of the necessary elements installed. Remember to only give me one step per response and confirm I have done it before proceeding."


# These modules make it easier to perform the calculation
import numpy as np
from scipy import stats

# We'll define a function that we can call to return the correlation calculations
def calculate_correlation(array1, array2):

    # Calculate Pearson correlation coefficient and p-value
    correlation, p_value = stats.pearsonr(array1, array2)

    # Calculate R-squared as the square of the correlation coefficient
    r_squared = correlation**2

    return correlation, r_squared, p_value

# These are the arrays for the variables shown on this page, but you can modify them to be any two sets of numbers
array_1 = np.array([40764,47465,51791,52409,51911,50956,43596.1,42315.6,45129.4,46548.6,46328.7,43258.3,51987.9,54966,])
array_2 = np.array([2.35,2.78,3.52,3.62,3.51,3.36,2.43,2.14,2.42,2.72,2.6,2.17,3.01,3.95,])
array_1_name = "GDP per capita in Canada"
array_2_name = "Gasoline Prices in the US"

# Perform the calculation
print(f"Calculating the correlation between {array_1_name} and {array_2_name}...")
correlation, r_squared, p_value = calculate_correlation(array_1, array_2)

# Print the results
print("Correlation Coefficient:", correlation)
print("R-squared:", r_squared)
print("P-value:", p_value)



Reuseable content

You may re-use the images on this page for any purpose, even commercial purposes, without asking for permission. The only requirement is that you attribute Tyler Vigen. Attribution can take many different forms. If you leave the "tylervigen.com" link in the image, that satisfies it just fine. If you remove it and move it to a footnote, that's fine too. You can also just write "Charts courtesy of Tyler Vigen" at the bottom of an article.

You do not need to attribute "the spurious correlations website," and you don't even need to link here if you don't want to. I don't gain anything from pageviews. There are no ads on this site, there is nothing for sale, and I am not for hire.

For the record, I am just one person. Tyler Vigen, he/him/his. I do have degrees, but they should not go after my name unless you want to annoy my wife. If that is your goal, then go ahead and cite me as "Tyler Vigen, A.A. A.A.S. B.A. J.D." Otherwise it is just "Tyler Vigen."

When spoken, my last name is pronounced "vegan," like I don't eat meat.

Full license details.
For more on re-use permissions, or to get a signed release form, see tylervigen.com/permission.

Download images for these variables:


View another random correlation

How fun was this correlation?

Kudos for rating!


Correlation ID: 2623 · Black Variable ID: 48 · Red Variable ID: 461
about · subscribe · emailme@tylervigen.com · twitter

CC BY 4.0