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

A linear line chart with years as the X-axis and two variables on the Y-axis. The first variable is The number of Breweries in the United States and the second variable is M&T Bank's stock price (MTB).  The chart goes from 2002 to 2022, and the two variables track closely in value over that time. Small Image
Download png
, svg

AI explanation

As the number of breweries in the US increased, so did the demand for their delicious beverages. This led to a surge in beer sales, causing a spike in the need for financial services. M&T Bank, being well-versed in hops and barleyonomics, reaped the frothy profits, lifting their stock price to hoppy new heights. It's a sudsy tale of ale and bailouts!

Model: dalle-3
Prompt: [ Concept art ] Generate an image depicting a whimsical map of the United States, dotted with bottle-shaped icons representing breweries sprouting across the country. Concurrently, an uplifting graph of M&T Bank's stock price, noted as MTB, curves skyward amidst the brewery icons. In the background, snack vendors gleefully display an array of potato chips and pretzels, as eager customers form orderly queues, symbolizing the burgeoning snack sales industry. 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: The number of Breweries in the United States and M&T Bank's stock price (MTB). 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: Low poly Cute cartoon Glitch art Futuristic Concept art
ChatGPT: Concept art

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 The number of Breweries in the United States and M&T Bank's stock price (MTB), in the following situation: Because as more breweries opened, more people developed a taste for craft beer, leading to an increase in demand for bar snacks. M&T Bank happened to be the primary lender for several potato chip and pretzel manufacturers, resulting in a surge in snack sales and ultimately boosting their stock price.. Keep the description simple.
ChatGPT: In the scene, we see a map of the United States with numerous bottle-shaped icons denoting the increasing number of breweries across the country. Amidst this, there is a graph displaying M&T Bank's stock price (MTB), which is inclining positively. Additionally, in the background, there are snack vendors happily showcasing their assortment of potato chips and pretzels, with customers lining up to purchase them, symbolizing the surge in snack sales.

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: [ Concept art ] and depicting this scene: In the scene, we see a map of the United States with numerous bottle-shaped icons denoting the increasing number of breweries across the country. Amidst this, there is a graph displaying M&T Bank's stock price (MTB), which is inclining positively. Additionally, in the background, there are snack vendors happily showcasing their assortment of potato chips and pretzels, with customers lining up to purchase them, symbolizing the surge in snack sales. Keep the visual depiction simple. Do not include any words or speech bubbles.
ChatGPT: [ Concept art ] Generate an image depicting a whimsical map of the United States, dotted with bottle-shaped icons representing breweries sprouting across the country. Concurrently, an uplifting graph of M&T Bank's stock price, noted as MTB, curves skyward amidst the brewery icons. In the background, snack vendors gleefully display an array of potato chips and pretzels, as eager customers form orderly queues, symbolizing the burgeoning snack sales industry.

*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 The number of Breweries in the United States caused M&T Bank's stock price (MTB) to increase. Add a funny one-liner at the end.

AI academic paper

(Because p < 0.01)
Pouring Over Pints and Portfolios: The Brewtiful Relationship Between Breweries in the United States and M&T Bank's Stock Price

The Journal of Fermented Finance

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 dry but witty academic researcher. You speak in the passive voice, and your writing sounds like it belongs in a medical or economics 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 The number of Breweries in the United States and M&T Bank's stock price (MTB). Make lots of jokes, goofy observations, and puns.

Include a pun in the title.

Your research team used data from Brewers Association and LSEG Analytics (Refinitiv) to assess this nagging question. You found a correlation coefficient of 0.8289521 and p < 0.01 for 2002 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]]
Pouring Over Pints and Portfolios: The Brewtiful Relationship Between Breweries in the United States and M&T Bank's Stock Price

[[ABSTRACT]]
This research paper examines the sudsy and unforeseen link between the number of breweries in the United States and the stock price of M&T Bank (MTB). Our study utilized data from Brewers Association and LSEG Analytics (Refinitiv) to delve into this unexpected connection. Surprisingly, we discovered a strong correlation coefficient of 0.8289521 with a significance level of p < 0.01 for the period of 2002 to 2022. This brew-tiful relationship has left us hoppy with our findings and shows that perhaps financial success can indeed be brewed from unexpected sources. The findings highlight the need for further investigation into the potential impact of craft beer on the performance of financial institutions, and demonstrate the potential benefits of diversifying economic indicators beyond the traditional.


Model: gpt-3.5-turbo-1106
System prompt: You are a dry but witty academic researcher. You speak in the passive voice, and your writing sounds like it belongs in a medical or economics 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 The number of Breweries in the United States and M&T Bank's stock price (MTB). Make lots of 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]]
Pouring Over Pints and Portfolios: The Brewtiful Relationship Between Breweries in the United States and M&T Bank's Stock Price

[[ABSTRACT]]
This research paper examines the sudsy and unforeseen link between the number of breweries in the United States and the stock price of M&T Bank (MTB). Our study utilized data from Brewers Association and LSEG Analytics (Refinitiv) to delve into this unexpected connection. Surprisingly, we discovered a strong correlation coefficient of 0.8289521 with a significance level of p < 0.01 for the period of 2002 to 2022. This brew-tiful relationship has left us hoppy with our findings and shows that perhaps financial success can indeed be brewed from unexpected sources. The findings highlight the need for further investigation into the potential impact of craft beer on the performance of financial institutions, and demonstrate the potential benefits of diversifying economic indicators beyond the traditional.

-------

Your response should start like this:

[[INTRODUCTION]]



ChatGPT:
[[INTRODUCTION]]

The world of finance and the world of craft brewing may seem like entirely separate entities, each with its own unique culture and language. Yet, as we delve into the depths of economic data and frothy pints, we uncover a surprising and tantalizing connection between the number of breweries in the United States and the stock price of M&T Bank (MTB).

While one might initially think that the brew-ness of beer and the business of banking have little in common, our research uncovers a brew-tiful relationship that will leave even the most seasoned economist foaming at the mouth. This study aims to pour over the numbers and portfolios, sifting through the hops and barleys of economic data to unearth the unexpectedly hoppy correlation between these seemingly unrelated industries.

The craft beer industry's explosive growth over the past two decades has not only delighted beer enthusiasts but has also sparked curiosity among financial analysts. The expanding landscape of craft breweries, with their diverse flavors and unique branding, has been a source of intrigue for economists seeking to identify unanticipated contributors to stock market performance.

In this paper, we present our investigation into the bond between the number of breweries in the United States and M&T Bank's stock price, drawing from data provided by the Brewers Association and LSEG Analytics (Refinitiv) for the period of 2002 to 2022. Our findings reveal a striking correlation coefficient of 0.8289521 with a significance level of p < 0.01, confounding conventional wisdom and adding a twist to the traditional understanding of financial market indicators.

The implications of these findings extend far beyond the realms of brewing and banking, challenging us to reconsider the interconnectedness of apparently disparate sectors of the economy. Could it be that financial success can be brewed from unexpected sources, leading us to recognize the value of expanding our analytical palate to encompass a wider range of economic indicators?

As we embark on this brew-tiful journey of discovery, we invite you to join us in raising a glass to the unexpected correlations that bring flavor to the otherwise dry realm of economic analysis. Cheers to the intriguing interplay between breweries and stock prices, and to the potential impact of craft beer on the performance of financial institutions. As the ancient proverb goes, "In hoppy times and in barley, the unexpected can brew profitably."


Model: gpt-3.5-turbo-1106
System prompt: You are a dry but witty academic researcher. You speak in the passive voice, and your writing sounds like it belongs in a medical or economics 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 The number of Breweries in the United States and M&T Bank's stock price (MTB). Make lots of 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 CVS receipts.

Here is the title and abstract of the paper:
[[TITLE]]
Pouring Over Pints and Portfolios: The Brewtiful Relationship Between Breweries in the United States and M&T Bank's Stock Price

[[ABSTRACT]]
This research paper examines the sudsy and unforeseen link between the number of breweries in the United States and the stock price of M&T Bank (MTB). Our study utilized data from Brewers Association and LSEG Analytics (Refinitiv) to delve into this unexpected connection. Surprisingly, we discovered a strong correlation coefficient of 0.8289521 with a significance level of p < 0.01 for the period of 2002 to 2022. This brew-tiful relationship has left us hoppy with our findings and shows that perhaps financial success can indeed be brewed from unexpected sources. The findings highlight the need for further investigation into the potential impact of craft beer on the performance of financial institutions, and demonstrate the potential benefits of diversifying economic indicators beyond the traditional.

-------

And here is the introduction section that led to this literature review:
[[INTRODUCTION]]
The world of finance and the world of craft brewing may seem like entirely separate entities, each with its own unique culture and language. Yet, as we delve into the depths of economic data and frothy pints, we uncover a surprising and tantalizing connection between the number of breweries in the United States and the stock price of M&T Bank (MTB).
While one might initially think that the brew-ness of beer and the business of banking have little in common, our research uncovers a brew-tiful relationship that will leave even the most seasoned economist foaming at the mouth. This study aims to pour over the numbers and portfolios, sifting through the hops and barleys of economic data to unearth the unexpectedly hoppy correlation between these seemingly unrelated industries.
The craft beer industry's explosive growth over the past two decades has not only delighted beer enthusiasts but has also sparked curiosity among financial analysts. The expanding landscape of craft breweries, with their diverse flavors and unique branding, has been a source of intrigue for economists seeking to identify unanticipated contributors to stock market performance.
In this paper, we present our investigation into the bond between the number of breweries in the United States and M&T Bank's stock price, drawing from data provided by the Brewers Association and LSEG Analytics (Refinitiv) for the period of 2002 to 2022. Our findings reveal a striking correlation coefficient of 0.8289521 with a significance level of p < 0.01, confounding conventional wisdom and adding a twist to the traditional understanding of financial market indicators.
The implications of these findings extend far beyond the realms of brewing and banking, challenging us to reconsider the interconnectedness of apparently disparate sectors of the economy. Could it be that financial success can be brewed from unexpected sources, leading us to recognize the value of expanding our analytical palate to encompass a wider range of economic indicators?
As we embark on this brew-tiful journey of discovery, we invite you to join us in raising a glass to the unexpected correlations that bring flavor to the otherwise dry realm of economic analysis. Cheers to the intriguing interplay between breweries and stock prices, and to the potential impact of craft beer on the performance of financial institutions. As the ancient proverb goes, "In hoppy times and in barley, the unexpected can brew profitably."

-------

Your response should start like this:

[[LITERATURE REVIEW]]



ChatGPT:
[[LITERATURE REVIEW]]

Numerous studies have investigated various factors affecting stock prices, ranging from macroeconomic indicators to company-specific financial metrics. The works of Smith et al. and Doe et al. have comprehensively explored the traditional determinants of stock price movements, shedding light on the complex interplay of market forces. However, our investigation seeks to expand this conventional framework by incorporating a surprisingly frothy factor into the mix: the number of breweries in the United States.

In "Financial Indicators: A Comprehensive Analysis," Smith et al. elucidate the commonly accepted drivers of stock price fluctuations, emphasizing the influence of interest rates, inflation, and company earnings. Similarly, Doe et al. in "Market Dynamics and Stock Price Volatility" delve into the intricate relationship between market dynamics, investor sentiment, and stock price movements. However, none of these esteemed researchers have dared to venture into the realm of craft beer and its potential impact on stock performance.

Turning to the literature on the craft brewing industry, "The Brewers Association Annual Report" and "Craft Beer USA" offer profound insights into the exponential growth of craft breweries in the United States. These publications highlight the expanding landscape of craft beer, providing a flavorful portrayal of the industry's robust growth and evolving consumer preferences. While these sources offer valuable perspectives on the cultural and economic significance of craft brewing, the link to stock market performance remains unexplored in the literature.

Furthermore, fictional works such as "Brewonomics: A Tale of Hops and High Finance" and "Brewing Up Profits: A Financial Mystery" add a whimsical touch to the investigation, hinting at the unexpected intersections between brewing and banking. While these books may only offer fictional narratives, they prompt us to ponder the potential connections between the art of brewing and the science of stock price analysis.

In a departure from traditional academic sources, our exploration of this uncharted terrain has also involved perusing unconventional sources of information. Indeed, our foray into the depths of literature has led us to scrutinize the cryptic inscriptions of lengthy CVS receipts, hinting at the arcane rituals of consumer spending and perhaps yielding hidden insights into the unpredictable pathways of economic causality.

In summary, while the existing body of literature has yielded valuable insights into traditional determinants of stock prices and the vibrant landscape of craft brewing, the nexus between the number of breweries in the United States and M&T Bank's stock price remains an understudied and tantalizingly frothy subject. As we immerse ourselves in the foam of economic analysis and the effervescence of market dynamics, our investigation promises to offer a refreshing addition to the scholarly discourse on the interplay between unexpected factors and financial market performance.


Model: gpt-3.5-turbo-1106
System prompt: You are a dry but witty academic researcher. You speak in the passive voice, and your writing sounds like it belongs in a medical or economics 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 The number of Breweries in the United States and M&T Bank's stock price (MTB). Make lots of 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 Brewers Association and LSEG Analytics (Refinitiv) . You used data from 2002 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]]
Pouring Over Pints and Portfolios: The Brewtiful Relationship Between Breweries in the United States and M&T Bank's Stock Price

[[ABSTRACT]]
This research paper examines the sudsy and unforeseen link between the number of breweries in the United States and the stock price of M&T Bank (MTB). Our study utilized data from Brewers Association and LSEG Analytics (Refinitiv) to delve into this unexpected connection. Surprisingly, we discovered a strong correlation coefficient of 0.8289521 with a significance level of p < 0.01 for the period of 2002 to 2022. This brew-tiful relationship has left us hoppy with our findings and shows that perhaps financial success can indeed be brewed from unexpected sources. The findings highlight the need for further investigation into the potential impact of craft beer on the performance of financial institutions, and demonstrate the potential benefits of diversifying economic indicators beyond the traditional.

[[INTRODUCTION]]
The world of finance and the world of craft brewing may seem like entirely separate entities, each with its own unique culture and language. Yet, as we delve into the depths of economic data and frothy pints, we uncover a surprising and tantalizing connection between the number of breweries in the United States and the stock price of M&T Bank (MTB).
While one might initially think that the brew-ness of beer and the business of banking have little in common, our research uncovers a brew-tiful relationship that will leave even the most seasoned economist foaming at the mouth. This study aims to pour over the numbers and portfolios, sifting through the hops and barleys of economic data to unearth the unexpectedly hoppy correlation between these seemingly unrelated industries.
The craft beer industry's explosive growth over the past two decades has not only delighted beer enthusiasts but has also sparked curiosity among financial analysts. The expanding landscape of craft breweries, with their diverse flavors and unique branding, has been a source of intrigue for economists seeking to identify unanticipated contributors to stock market performance.
In this paper, we present our investigation into the bond between the number of breweries in the United States and M&T Bank's stock price, drawing from data provided by the Brewers Association and LSEG Analytics (Refinitiv) for the period of 2002 to 2022. Our findings reveal a striking correlation coefficient of 0.8289521 with a significance level of p < 0.01, confounding conventional wisdom and adding a twist to the traditional understanding of financial market indicators.
The implications of these findings extend far beyond the realms of brewing and banking, challenging us to reconsider the interconnectedness of apparently disparate sectors of the economy. Could it be that financial success can be brewed from unexpected sources, leading us to recognize the value of expanding our analytical palate to encompass a wider range of economic indicators?
As we embark on this brew-tiful journey of discovery, we invite you to join us in raising a glass to the unexpected correlations that bring flavor to the otherwise dry realm of economic analysis. Cheers to the intriguing interplay between breweries and stock prices, and to the potential impact of craft beer on the performance of financial institutions. As the ancient proverb goes, "In hoppy times and in barley, the unexpected can brew profitably."

-------

Your response should start like this:

[[METHODOLOGY]]



ChatGPT:

[[METHODOLOGY]]

To unearth the frothy connection between the number of breweries in the United States and M&T Bank's stock price (MTB), a multifaceted approach was employed, encompassing data collection, statistical analysis, and thorough cleansing of ale-inspired puns.

Data on the number of breweries in the United States was obtained from the Brewers Association, an esteemed fount of knowledge in the world of craft beer. The stock price of M&T Bank (MTB) was sourced from LSEG Analytics (Refinitiv), a well-regarded provider of financial market data. The period of analysis encompassed the years 2002 to 2022, allowing for a comprehensive exploration of changes in both brewery counts and stock performance over two decades.

To navigate the sea of data and concoct a meaningful analysis, a statistical software package was utilized to calculate a correlation coefficient between the two variables. The utilization of this software was conducted with the diligence of a brewmaster crafting the perfect pint, ensuring that the statistical computations were as precise as the pouring of an imperial stout.

The correlation coefficient, accompanied by its respective p-value, bestowed upon us the quantifiable evidence of the relationship between the number of breweries and M&T Bank's stock price. This statistical revelation was achieved with the careful consideration of potential confounding variables, akin to the judicious selection of hops for a well-balanced brew.

Furthermore, to rigorously assess the robustness of the findings, sensitivity analyses were employed to evaluate the impact of different time periods and regional variations within the United States. This allowed for a deeper understanding of the nuances within the data, akin to discerning the distinct flavor profiles of various craft beers.

In summary, the methodology adopted in this investigation ensured a thorough examination of the brew-tiful relationship between breweries in the United States and M&T Bank's stock price, culminating in a blend of data-driven insights and the occasional, sly pun.


Model: gpt-3.5-turbo-1106
System prompt: You are a dry but witty academic researcher. You speak in the passive voice, and your writing sounds like it belongs in a medical or economics 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 The number of Breweries in the United States and M&T Bank's stock price (MTB). Make lots of 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 Brewers Association and LSEG Analytics (Refinitiv) .

For the time period 2002 to 2022, you found a correlation 0.8289521, r-squared of 0.6871617, 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]]
Pouring Over Pints and Portfolios: The Brewtiful Relationship Between Breweries in the United States and M&T Bank's Stock Price

[[ABSTRACT]]
This research paper examines the sudsy and unforeseen link between the number of breweries in the United States and the stock price of M&T Bank (MTB). Our study utilized data from Brewers Association and LSEG Analytics (Refinitiv) to delve into this unexpected connection. Surprisingly, we discovered a strong correlation coefficient of 0.8289521 with a significance level of p < 0.01 for the period of 2002 to 2022. This brew-tiful relationship has left us hoppy with our findings and shows that perhaps financial success can indeed be brewed from unexpected sources. The findings highlight the need for further investigation into the potential impact of craft beer on the performance of financial institutions, and demonstrate the potential benefits of diversifying economic indicators beyond the traditional.

-------

And here is the methodology section that led to this result:
[[METHODOLOGY]]
The world of finance and the world of craft brewing may seem like entirely separate entities, each with its own unique culture and language. Yet, as we delve into the depths of economic data and frothy pints, we uncover a surprising and tantalizing connection between the number of breweries in the United States and the stock price of M&T Bank (MTB).
While one might initially think that the brew-ness of beer and the business of banking have little in common, our research uncovers a brew-tiful relationship that will leave even the most seasoned economist foaming at the mouth. This study aims to pour over the numbers and portfolios, sifting through the hops and barleys of economic data to unearth the unexpectedly hoppy correlation between these seemingly unrelated industries.
The craft beer industry's explosive growth over the past two decades has not only delighted beer enthusiasts but has also sparked curiosity among financial analysts. The expanding landscape of craft breweries, with their diverse flavors and unique branding, has been a source of intrigue for economists seeking to identify unanticipated contributors to stock market performance.
In this paper, we present our investigation into the bond between the number of breweries in the United States and M&T Bank's stock price, drawing from data provided by the Brewers Association and LSEG Analytics (Refinitiv) for the period of 2002 to 2022. Our findings reveal a striking correlation coefficient of 0.8289521 with a significance level of p < 0.01, confounding conventional wisdom and adding a twist to the traditional understanding of financial market indicators.
The implications of these findings extend far beyond the realms of brewing and banking, challenging us to reconsider the interconnectedness of apparently disparate sectors of the economy. Could it be that financial success can be brewed from unexpected sources, leading us to recognize the value of expanding our analytical palate to encompass a wider range of economic indicators?
As we embark on this brew-tiful journey of discovery, we invite you to join us in raising a glass to the unexpected correlations that bring flavor to the otherwise dry realm of economic analysis. Cheers to the intriguing interplay between breweries and stock prices, and to the potential impact of craft beer on the performance of financial institutions. As the ancient proverb goes, "In hoppy times and in barley, the unexpected can brew profitably."

-------

Your response should start like this:

[[RESULTS]]



ChatGPT:

[[RESULTS]]

The results of our analysis reveal a remarkable correlation coefficient of 0.8289521 between the number of breweries in the United States and the stock price of M&T Bank (MTB) for the period spanning from 2002 to 2022. This correlation coefficient, often described as "brew-tiful" in statistical circles, implies a strong positive relationship between these seemingly unrelated sectors. The coefficient of determination (r-squared) of 0.6871617 further reinforces the robustness of the relationship, indicating that approximately 69% of the variation in M&T Bank's stock price can be explained by the number of breweries in the United States. With a significance level of p < 0.01, the findings suggest that this correlation is not a mere ale-usion, but rather a statistically significant phenomenon.

The scatterplot (Fig. 1) in the data visualization section visually encapsulates the strength of the correlation, presenting a compelling picture of the intriguing relationship between breweries and stock prices. The scatterplot resembles a frothy pint of beer, with data points bubbling up in a pattern that aligns with the positive correlation observed in our analysis. This evocative representation serves as an apt metaphor for the unexpected yet refreshing connection we have uncovered.

Our findings serve as a refreshing reminder that economic indicators cannot be served in isolation, and the recipe for understanding market performance may include unexpected ingredients. As our research concludes, we raise a glass to the unforeseen correlations that add flavor to the sometimes dry world of economic analysis. Amidst the data-driven discussions of market dynamics, it is heartening to encounter such a brew-tiful relationship, demonstrating that financial success can indeed be brewed from unexpected sources.


Model: gpt-3.5-turbo-1106
System prompt: You are a dry but witty academic researcher. You speak in the passive voice, and your writing sounds like it belongs in a medical or economics 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 The number of Breweries in the United States and M&T Bank's stock price (MTB). Make lots of 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]]
Pouring Over Pints and Portfolios: The Brewtiful Relationship Between Breweries in the United States and M&T Bank's Stock Price

[[ABSTRACT]]
This research paper examines the sudsy and unforeseen link between the number of breweries in the United States and the stock price of M&T Bank (MTB). Our study utilized data from Brewers Association and LSEG Analytics (Refinitiv) to delve into this unexpected connection. Surprisingly, we discovered a strong correlation coefficient of 0.8289521 with a significance level of p < 0.01 for the period of 2002 to 2022. This brew-tiful relationship has left us hoppy with our findings and shows that perhaps financial success can indeed be brewed from unexpected sources. The findings highlight the need for further investigation into the potential impact of craft beer on the performance of financial institutions, and demonstrate the potential benefits of diversifying economic indicators beyond the traditional.

[[LITERATURE REVIEW]]
Numerous studies have investigated various factors affecting stock prices, ranging from macroeconomic indicators to company-specific financial metrics. The works of Smith et al. and Doe et al. have comprehensively explored the traditional determinants of stock price movements, shedding light on the complex interplay of market forces. However, our investigation seeks to expand this conventional framework by incorporating a surprisingly frothy factor into the mix: the number of breweries in the United States.
In "Financial Indicators: A Comprehensive Analysis," Smith et al. elucidate the commonly accepted drivers of stock price fluctuations, emphasizing the influence of interest rates, inflation, and company earnings. Similarly, Doe et al. in "Market Dynamics and Stock Price Volatility" delve into the intricate relationship between market dynamics, investor sentiment, and stock price movements. However, none of these esteemed researchers have dared to venture into the realm of craft beer and its potential impact on stock performance.
Turning to the literature on the craft brewing industry, "The Brewers Association Annual Report" and "Craft Beer USA" offer profound insights into the exponential growth of craft breweries in the United States. These publications highlight the expanding landscape of craft beer, providing a flavorful portrayal of the industry's robust growth and evolving consumer preferences. While these sources offer valuable perspectives on the cultural and economic significance of craft brewing, the link to stock market performance remains unexplored in the literature.
Furthermore, fictional works such as "Brewonomics: A Tale of Hops and High Finance" and "Brewing Up Profits: A Financial Mystery" add a whimsical touch to the investigation, hinting at the unexpected intersections between brewing and banking. While these books may only offer fictional narratives, they prompt us to ponder the potential connections between the art of brewing and the science of stock price analysis.
In a departure from traditional academic sources, our exploration of this uncharted terrain has also involved perusing unconventional sources of information. Indeed, our foray into the depths of literature has led us to scrutinize the cryptic inscriptions of lengthy CVS receipts, hinting at the arcane rituals of consumer spending and perhaps yielding hidden insights into the unpredictable pathways of economic causality.
In summary, while the existing body of literature has yielded valuable insights into traditional determinants of stock prices and the vibrant landscape of craft brewing, the nexus between the number of breweries in the United States and M&T Bank's stock price remains an understudied and tantalizingly frothy subject. As we immerse ourselves in the foam of economic analysis and the effervescence of market dynamics, our investigation promises to offer a refreshing addition to the scholarly discourse on the interplay between unexpected factors and financial market performance.

[[RESULTS]]
The results of our analysis reveal a remarkable correlation coefficient of 0.8289521 between the number of breweries in the United States and the stock price of M&T Bank (MTB) for the period spanning from 2002 to 2022. This correlation coefficient, often described as "brew-tiful" in statistical circles, implies a strong positive relationship between these seemingly unrelated sectors. The coefficient of determination (r-squared) of 0.6871617 further reinforces the robustness of the relationship, indicating that approximately 69% of the variation in M&T Bank's stock price can be explained by the number of breweries in the United States. With a significance level of p < 0.01, the findings suggest that this correlation is not a mere ale-usion, but rather a statistically significant phenomenon.
The scatterplot (Fig. 1) in the data visualization section visually encapsulates the strength of the correlation, presenting a compelling picture of the intriguing relationship between breweries and stock prices. The scatterplot resembles a frothy pint of beer, with data points bubbling up in a pattern that aligns with the positive correlation observed in our analysis. This evocative representation serves as an apt metaphor for the unexpected yet refreshing connection we have uncovered.
Our findings serve as a refreshing reminder that economic indicators cannot be served in isolation, and the recipe for understanding market performance may include unexpected ingredients. As our research concludes, we raise a glass to the unforeseen correlations that add flavor to the sometimes dry world of economic analysis. Amidst the data-driven discussions of market dynamics, it is heartening to encounter such a brew-tiful relationship, demonstrating that financial success can indeed be brewed from unexpected sources.

-------

Your response should start like this:

[[DISCUSSION]]



ChatGPT:

[[DISCUSSION]]

The findings of this study have taken us on a captivating journey through the ebbs and flows of the financial and brewing realms, revealing a surprising and statistically robust relationship between the number of breweries in the United States and the stock price of M&T Bank (MTB). Our results not only provide empirical support for the unassuming yet potent influence of craft beer on stock performance but also offer a refreshing departure from the conventional factors typically examined in stock price analysis.

The strong correlation coefficient of 0.8289521 supports the burgeoning literature on the impact of seemingly unrelated factors on stock market dynamics. In light of the existing body of research, including the works of Smith et al. and Doe et al., which delve into the conventional determinants of stock price movements, our study adds a delightfully frothy twist to the narrative. The unexpected connection we have uncovered underscores the need to expand the scope of economic indicators, beckoning researchers to recognize the potential contributions of diverse and unconventional factors in shaping market outcomes.

Moreover, our findings resonate with the poignant insights offered by "Brewonomics: A Tale of Hops and High Finance" and "Brewing Up Profits: A Financial Mystery," spotlighting the transfixing interplay between the art of brewing and the science of stock price analysis. As these fictional narratives subtly hinted at the untapped potential of weaving together disparate domains, our empirical analysis has illuminated the underlying validity of such connections. It appears that the whimsical musings of these works may hold more truth than meets the eye, as we witness the tangible influence of craft beer on the performance of financial institutions.

In addition to aligning with the existing literature, our results also corroborate the anecdotal evidence provided by lengthy CVS receipts, which, in their enigmatic expanses, allude to the enigmatic rituals of consumer spending and, potentially, to the intricate web of economic causality. While these unconventional forays into the fabric of economic analysis may initially seem light-hearted, our study lends weight to the notion that unanticipated sources of influence can have profound implications for market dynamics.

Thus, the findings of this investigation lend credence to the often-overlooked intersections between the brewing industry and financial markets. Our analysis serves as a solemn nod to the levity and creativity that infuse the discipline of economics, illustrating that the pursuit of knowledge need not always be dry and tedious. As we savor the flavorful revelations brought forth by this study, we are reminded that in the tapestry of economic analyses, unexpected ingredients can yield the most tantalizing insights. Cheers to the serendipitous discoveries that add effervescence to the scholarly discourse on financial markets!


Model: gpt-3.5-turbo-1106
System prompt: You are a dry but witty academic researcher. You speak in the passive voice, and your writing sounds like it belongs in a medical or economics 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 The number of Breweries in the United States and M&T Bank's stock price (MTB). Make lots of 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]]
Pouring Over Pints and Portfolios: The Brewtiful Relationship Between Breweries in the United States and M&T Bank's Stock Price

[[ABSTRACT]]
This research paper examines the sudsy and unforeseen link between the number of breweries in the United States and the stock price of M&T Bank (MTB). Our study utilized data from Brewers Association and LSEG Analytics (Refinitiv) to delve into this unexpected connection. Surprisingly, we discovered a strong correlation coefficient of 0.8289521 with a significance level of p < 0.01 for the period of 2002 to 2022. This brew-tiful relationship has left us hoppy with our findings and shows that perhaps financial success can indeed be brewed from unexpected sources. The findings highlight the need for further investigation into the potential impact of craft beer on the performance of financial institutions, and demonstrate the potential benefits of diversifying economic indicators beyond the traditional.

[[INTRDUCTION]]
The world of finance and the world of craft brewing may seem like entirely separate entities, each with its own unique culture and language. Yet, as we delve into the depths of economic data and frothy pints, we uncover a surprising and tantalizing connection between the number of breweries in the United States and the stock price of M&T Bank (MTB).
While one might initially think that the brew-ness of beer and the business of banking have little in common, our research uncovers a brew-tiful relationship that will leave even the most seasoned economist foaming at the mouth. This study aims to pour over the numbers and portfolios, sifting through the hops and barleys of economic data to unearth the unexpectedly hoppy correlation between these seemingly unrelated industries.
The craft beer industry's explosive growth over the past two decades has not only delighted beer enthusiasts but has also sparked curiosity among financial analysts. The expanding landscape of craft breweries, with their diverse flavors and unique branding, has been a source of intrigue for economists seeking to identify unanticipated contributors to stock market performance.
In this paper, we present our investigation into the bond between the number of breweries in the United States and M&T Bank's stock price, drawing from data provided by the Brewers Association and LSEG Analytics (Refinitiv) for the period of 2002 to 2022. Our findings reveal a striking correlation coefficient of 0.8289521 with a significance level of p < 0.01, confounding conventional wisdom and adding a twist to the traditional understanding of financial market indicators.
The implications of these findings extend far beyond the realms of brewing and banking, challenging us to reconsider the interconnectedness of apparently disparate sectors of the economy. Could it be that financial success can be brewed from unexpected sources, leading us to recognize the value of expanding our analytical palate to encompass a wider range of economic indicators?
As we embark on this brew-tiful journey of discovery, we invite you to join us in raising a glass to the unexpected correlations that bring flavor to the otherwise dry realm of economic analysis. Cheers to the intriguing interplay between breweries and stock prices, and to the potential impact of craft beer on the performance of financial institutions. As the ancient proverb goes, "In hoppy times and in barley, the unexpected can brew profitably."

[[RESULTS]]
The results of our analysis reveal a remarkable correlation coefficient of 0.8289521 between the number of breweries in the United States and the stock price of M&T Bank (MTB) for the period spanning from 2002 to 2022. This correlation coefficient, often described as "brew-tiful" in statistical circles, implies a strong positive relationship between these seemingly unrelated sectors. The coefficient of determination (r-squared) of 0.6871617 further reinforces the robustness of the relationship, indicating that approximately 69% of the variation in M&T Bank's stock price can be explained by the number of breweries in the United States. With a significance level of p < 0.01, the findings suggest that this correlation is not a mere ale-usion, but rather a statistically significant phenomenon.
The scatterplot (Fig. 1) in the data visualization section visually encapsulates the strength of the correlation, presenting a compelling picture of the intriguing relationship between breweries and stock prices. The scatterplot resembles a frothy pint of beer, with data points bubbling up in a pattern that aligns with the positive correlation observed in our analysis. This evocative representation serves as an apt metaphor for the unexpected yet refreshing connection we have uncovered.
Our findings serve as a refreshing reminder that economic indicators cannot be served in isolation, and the recipe for understanding market performance may include unexpected ingredients. As our research concludes, we raise a glass to the unforeseen correlations that add flavor to the sometimes dry world of economic analysis. Amidst the data-driven discussions of market dynamics, it is heartening to encounter such a brew-tiful relationship, demonstrating that financial success can indeed be brewed from unexpected sources.

-------

Your response should start like this:

[[CONCLUSION]]



ChatGPT:

[[CONCLUSION]]

In conclusion, our study has unveiled a remarkably “brew-tiful” relationship between the number of breweries in the United States and the stock price of M&T Bank (MTB) for the period of 2002 to 2022. The robust correlation coefficient of 0.8289521 has left us hoppy with the unexpected findings of this research. It seems that financial success can indeed be brewed from unforeseen sources, much like an elusive microbrewery concocting a winning IPA in a basement.

The association between craft beer and financial markets is not to be dismissed as mere ale-usion, but rather demands further consideration. The scatterplot, akin to a frothy pint of ale, vividly captures the buoyant correlation. It's as if the financial market is saying, “Cheers to that, let’s raise a glass to the unexpectedly hoppy financial data!”

This research not only challenges conventional economic wisdom but also highlights the potential benefits of diversifying economic indicators beyond the traditional. Who would have thought that a sudsy pint and a stock portfolio could be intertwined in such a brew-tiful manner? It appears that in hoppy times and in barley, the unexpected can brew profitably.

Therefore, we assert that no further research is necessary in this area, as our findings have already provided a brew-tifully refreshing glimpse into the unexpectedly percolating world of financial markets. Further exploration might just leave us drowning in data, much like a mug that’s been overpoured. It’s time to raise a glass and savor the brew-tiful mysteries of the economic world, and perhaps, enjoy a good craft beer while we're at it!


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 Pouring Over Pints and Portfolios: The Brewtiful Relationship Between Breweries in the United States and M&T Bank's Stock Price. Respond only with the name of a fictional academic journal.

ChatGPT:

The Journal of Fermented Finance


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 Pouring Over Pints and Portfolios: The Brewtiful Relationship Between Breweries in the United States and M&T Bank's Stock Price. Respond only with the name of a fictional organization.

ChatGPT:

The Institute for Fermentation Economics and Financial Analysis


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 Pouring Over Pints and Portfolios: The Brewtiful Relationship Between Breweries in the United States and M&T Bank's Stock Price with an abstract of This research paper examines the sudsy and unforeseen link between the number of breweries in the United States and the stock price of M&T Bank (MTB). Our study utilized data from Brewers Association and LSEG Analytics (Refinitiv) to delve into this unexpected connection. Surprisingly, we discovered a strong correlation coefficient of 0.8289521 with a significance level of p < 0.01 for the period of 2002 to 2022. This brew-tiful relationship has left us hoppy with our findings and shows that perhaps financial success can indeed be brewed from unexpected sources. The findings highlight the need for further investigation into the potential impact of craft beer on the performance of financial institutions, and demonstrate the potential benefits of diversifying economic indicators beyond the traditional.

ChatGPT:

breweries, United States, M&T Bank, stock price, correlation, Brewers Association, LSEG Analytics, Refinitiv, financial institutions, craft beer, economic indicators, correlation coefficient, significance level, p value, diversification, unexpected sources

*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

The number of Breweries in the United States
Detailed data title: Number of Breweries in the United States
Source: Brewers Association
See what else correlates with The number of Breweries in the United States

M&T Bank's stock price (MTB)
Detailed data title: Opening price of M&T Bank (MTB) on the first trading day of the year
Source: LSEG Analytics (Refinitiv)
Additional Info: Via Microsoft Excel Stockhistory function

See what else correlates with M&T Bank's stock price (MTB)

Correlation r = 0.8289521 (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.6871617 (Coefficient of determination)
This means 68.7% of the change in the one variable (i.e., M&T Bank's stock price (MTB)) is predictable based on the change in the other (i.e., The number of Breweries in the United States) over the 21 years from 2002 through 2022.

p < 0.01, which is statistically significant(Null hypothesis significance test)
The p-value is 3.4E-6. 0.0000034266336348699115000000
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.83 in 0.00034% of random cases. Said differently, if you correlated 291,832 random variables You don't actually need 291 thousand 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 20 degrees of freedom, Degrees of freedom is a measure of how many free components we are testing. In this case it is 20 because we have two variables measured over a period of 21 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.62, 0.93 ] 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.
200220032004200520062007200820092010201120122013201420152016201720182019202020212022
The number of Breweries in the United States (Number of breweries)157516291635161217411805189619332131252526703162401448475780676777228557909293849709
M&T Bank's stock price (MTB) (Stock price)73.2579.898.1107.84109.05121.9482.1758.7467.6387.6777.85100.33116.38126.42119.24158.2172.48141.11170.36128.63155.77




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([1575,1629,1635,1612,1741,1805,1896,1933,2131,2525,2670,3162,4014,4847,5780,6767,7722,8557,9092,9384,9709,])
array_2 = np.array([73.25,79.8,98.1,107.84,109.05,121.94,82.17,58.74,67.63,87.67,77.85,100.33,116.38,126.42,119.24,158.2,172.48,141.11,170.36,128.63,155.77,])
array_1_name = "The number of Breweries in the United States"
array_2_name = "M&T Bank's stock price (MTB)"

# 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?

I'm grateful for your review!


Correlation ID: 2661 · Black Variable ID: 34 · Red Variable ID: 1912
about · subscribe · emailme@tylervigen.com · twitter

CC BY 4.0