about · email me · subscribe
Spurious correlation #1,104 · View random

A linear line chart with years as the X-axis and two variables on the Y-axis. The first variable is Google searches for 'who is jk rowling' and the second variable is The Coca-Cola Company's stock price (KO).  The chart goes from 2004 to 2023, and the two variables track closely in value over that time. Small Image
Download png
, svg

AI explanation

More people learning about the author of the Harry Potter series led to a surge in interest and a magical belief in the value of Coke's st-ocks. As the search for literary knowledge Rowling, so did the demand for the classic beverage, causing investors to raise their glasses to Coke's success.

Model: dalle-3
Prompt: Prompt for DALL-E-3: Generate an image of a glitch art style rendering of a bustling city scene. In the foreground, depict a group of perplexed investors gathered around a large electronic billboard displaying fluctuating stock prices of Coca-Cola. Show the investors with their confused expressions, and in the background, illustrate a wave of people vigorously typing 'Who is JK Rowling' into their smartphones. Emphasize the contrast between the investors' puzzled expressions and the crowd's curious search activity. Capture the tangible excitement in the air and hint at the surge in searches for JK Rowling and the concurrent rise in Coca-Cola stock price. 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 situation described. You respond only with the scene descriptions provided and say nothing else.
User prompt: Here is a situation: "Surge in 'Who is JK Rowling' Searches Linked to Rise in Coca-Cola Stock Price: Confused Investors Thirsty for Magic Solutions". Given that situation, which of the following image descriptions seems most appropriate? Pick the one that seems to be related to one of the variables at hand and the tone of the explanation. Please respond with only one of the following potential descriptions: Woodblock painting Glitch art Brutalism inspired by bauhaus Cybernetic art
ChatGPT: Glitch art

Model: gpt-3.5-turbo-1106
System prompt: You describe simple visual scenes that depict the two variables stated and the explanation described. Do not reference graphs or charts; describe physical objects.
User prompt: Please describe a visual scene that depicts the following situation. Keep the description simple. "Surge in 'Who is JK Rowling' Searches Linked to Rise in Coca-Cola Stock Price: Confused Investors Thirsty for Magic Solutions"
ChatGPT: In a bustling city, a group of perplexed investors are seen gathered around a large electronic billboard displaying the fluctuating stock prices of Coca-Cola. In the background, a wave of people is shown vigorously typing 'Who is JK Rowling' into their smartphones, while a tangible excitement fills the air. The juxtaposition of the investors' puzzled expressions and the buzz of curious search activity captures the surge in searches for JK Rowling and the concurrent rise in Coca-Cola stock price. The investors appear puzzled by the unexpected correlation as the crowd's fervent curiosity hints at their quest for magical solutions amidst confusion.

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: [ Glitch art ] and depicting this scene: In a bustling city, a group of perplexed investors are seen gathered around a large electronic billboard displaying the fluctuating stock prices of Coca-Cola. In the background, a wave of people is shown vigorously typing 'Who is JK Rowling' into their smartphones, while a tangible excitement fills the air. The juxtaposition of the investors' puzzled expressions and the buzz of curious search activity captures the surge in searches for JK Rowling and the concurrent rise in Coca-Cola stock price. The investors appear puzzled by the unexpected correlation as the crowd's fervent curiosity hints at their quest for magical solutions amidst confusion. Keep the visual depiction simple. Do not include any words or speech bubbles.
ChatGPT: Prompt for DALL-E-3: Generate an image of a glitch art style rendering of a bustling city scene. In the foreground, depict a group of perplexed investors gathered around a large electronic billboard displaying fluctuating stock prices of Coca-Cola. Show the investors with their confused expressions, and in the background, illustrate a wave of people vigorously typing 'Who is JK Rowling' into their smartphones. Emphasize the contrast between the investors' puzzled expressions and the crowd's curious search activity. Capture the tangible excitement in the air and hint at the surge in searches for JK Rowling and the concurrent rise in Coca-Cola stock price.

*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 who is jk rowling (Google searches for 'who is jk rowling') caused The Coca-Cola Company's stock price (KO) to increase. Include one good pun.

AI academic paper

(Because p < 0.01)
Fizzing Up the Search: The Curious Case of 'Who is J.K. Rowling' and Coca-Cola Stock Prices

The Journal of Quirky Connections

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 silly researcher writing an academic paper.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 Google searches for 'who is jk rowling' and The Coca-Cola Company's stock price. Make lots of jokes, goofy observations, and puns.

Include a pun in the title.

Your research team used data from Google Trends and LSEG Analytics (Refinitiv) to assess this nagging question. You found a correlation coefficient of 0.9256536 and p < 0.01 for 2004 to 2023.

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]]
Fizzing Up the Search: The Curious Case of 'Who is J.K. Rowling' and Coca-Cola Stock Prices

[[ABSTRACT]]
In this refreshingly unconventional research paper, we explore the unlikely connection between Google searches for "who is J.K. Rowling" and the stock prices of the ever-popular Coca-Cola Company. With a bubbling curiosity, our research team delved into the data from Google Trends and LSEG Analytics (Refinitiv) to quench the thirst for knowledge on this quirkily intriguing topic. To our delightful surprise, we discovered a fizz-tastic correlation coefficient of 0.9256536 and p < 0.01 for the period spanning 2004 to 2023. Our findings not only raise eyebrows but also raise a toast to the unexpected relationships that can be uncovered in the world of data analysis. So, sit back, pop the cap off your favorite carbonated beverage, and join us as we dive into this refreshing blend of pop culture and stock market shenanigans!


Model: gpt-3.5-turbo-1106
System prompt: You are a silly researcher writing an academic paper.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 Google searches for 'who is jk rowling' and The Coca-Cola Company's stock price. 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]]
Fizzing Up the Search: The Curious Case of 'Who is J.K. Rowling' and Coca-Cola Stock Prices

[[ABSTRACT]]
In this refreshingly unconventional research paper, we explore the unlikely connection between Google searches for "who is J.K. Rowling" and the stock prices of the ever-popular Coca-Cola Company. With a bubbling curiosity, our research team delved into the data from Google Trends and LSEG Analytics (Refinitiv) to quench the thirst for knowledge on this quirkily intriguing topic. To our delightful surprise, we discovered a fizz-tastic correlation coefficient of 0.9256536 and p < 0.01 for the period spanning 2004 to 2023. Our findings not only raise eyebrows but also raise a toast to the unexpected relationships that can be uncovered in the world of data analysis. So, sit back, pop the cap off your favorite carbonated beverage, and join us as we dive into this refreshing blend of pop culture and stock market shenanigans!

-------

Your response should start like this:

[[INTRODUCTION]]



ChatGPT:
INTRODUCTION

As the great philosopher Plato once said, "The beginning is the most important part of the work." With that in mind, we kick off this academic adventure into the fizz-worthy world of virtual information and financial frolics. The intersection of Google searches for "who is J.K. Rowling" and the financial fortunes of The Coca-Cola Company might seem as odd a combination as mixing Mentos and soda, yet we implore our esteemed readers to suspend their disbelief and embark on this journey with an open mind – and perhaps an open bottle of soft drink.

It is a truth universally acknowledged that the entrance of a new author into the literary world is often met with both curiosity and celebration. J.K. Rowling, the acclaimed author of the Harry Potter series, has captivated the imaginations of readers of all ages and walks of life. The widespread fascination with her life and works has been so palpable that, dare we say, it seems to exude an effervescent quality – much like the delightful carbonation in a fizzy beverage.

At the same time, The Coca-Cola Company, an enduring titan of the global beverage industry, has experienced its fair share of price fluctuations and market challenges. Theories and hypotheses on what drives its stock prices have been as numerous as bubbles in a freshly poured cola. Yet, amidst these financial musings and market analyses, one might not expect to find a peculiar rendezvous with the inquiries about a British author. It is precisely this unexpected and at first blush, perplexing relationship, that has provided the impetus for our scholarly sojourn.

In the paragraphs that follow, we will unravel the threads that tie together virtual searches for literary luminaries and the ebb and flow of stock prices. Through meticulously gathered data and rigorous statistical analysis, we seek to shed light on this quirky correlation and offer a fresh perspective that transcends the usual confines of economic research. So, buckle up and brace for a playful yet probing exploration into the interconnected, and at times, paradoxical world of pop culture fascination and market movements.


Model: gpt-3.5-turbo-1106
System prompt: You are a silly researcher writing an academic paper.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 Google searches for 'who is jk rowling' and The Coca-Cola Company's stock price. 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 the backs of shampoo bottles.

Here is the title and abstract of the paper:
[[TITLE]]
Fizzing Up the Search: The Curious Case of 'Who is J.K. Rowling' and Coca-Cola Stock Prices

[[ABSTRACT]]
In this refreshingly unconventional research paper, we explore the unlikely connection between Google searches for "who is J.K. Rowling" and the stock prices of the ever-popular Coca-Cola Company. With a bubbling curiosity, our research team delved into the data from Google Trends and LSEG Analytics (Refinitiv) to quench the thirst for knowledge on this quirkily intriguing topic. To our delightful surprise, we discovered a fizz-tastic correlation coefficient of 0.9256536 and p < 0.01 for the period spanning 2004 to 2023. Our findings not only raise eyebrows but also raise a toast to the unexpected relationships that can be uncovered in the world of data analysis. So, sit back, pop the cap off your favorite carbonated beverage, and join us as we dive into this refreshing blend of pop culture and stock market shenanigans!

-------

And here is the introduction section that led to this literature review:
[[INTRODUCTION]]
INTRODUCTION
As the great philosopher Plato once said, "The beginning is the most important part of the work." With that in mind, we kick off this academic adventure into the fizz-worthy world of virtual information and financial frolics. The intersection of Google searches for "who is J.K. Rowling" and the financial fortunes of The Coca-Cola Company might seem as odd a combination as mixing Mentos and soda, yet we implore our esteemed readers to suspend their disbelief and embark on this journey with an open mind – and perhaps an open bottle of soft drink.
It is a truth universally acknowledged that the entrance of a new author into the literary world is often met with both curiosity and celebration. J.K. Rowling, the acclaimed author of the Harry Potter series, has captivated the imaginations of readers of all ages and walks of life. The widespread fascination with her life and works has been so palpable that, dare we say, it seems to exude an effervescent quality – much like the delightful carbonation in a fizzy beverage.
At the same time, The Coca-Cola Company, an enduring titan of the global beverage industry, has experienced its fair share of price fluctuations and market challenges. Theories and hypotheses on what drives its stock prices have been as numerous as bubbles in a freshly poured cola. Yet, amidst these financial musings and market analyses, one might not expect to find a peculiar rendezvous with the inquiries about a British author. It is precisely this unexpected and at first blush, perplexing relationship, that has provided the impetus for our scholarly sojourn.
In the paragraphs that follow, we will unravel the threads that tie together virtual searches for literary luminaries and the ebb and flow of stock prices. Through meticulously gathered data and rigorous statistical analysis, we seek to shed light on this quirky correlation and offer a fresh perspective that transcends the usual confines of economic research. So, buckle up and brace for a playful yet probing exploration into the interconnected, and at times, paradoxical world of pop culture fascination and market movements.

-------

Your response should start like this:

[[LITERATURE REVIEW]]



ChatGPT:
[[LITERATURE REVIEW]]

The examination of the relationship between seemingly unrelated phenomena has long been a pursuit of both scholarly and whimsical minds alike. In the world of academic research, some studies by Smith and Jones have delved into the unexpected connections between consumer behavior and stock prices, providing foundational insights into the enigmatic interplay of popular culture and financial markets. Additionally, Doe's exploration of internet search trends and their impact on market sentiment has offered a thought-provoking perspective on the potential influence of virtual curiosity on investment decisions.

In a similar vein, non-fiction literature such as "Freakonomics" by Steven D. Levitt and Stephen J. Dubner has sparked contemplation on unconventional correlations, challenging traditional views of causality and shedding light on the unexpected intertwining of disparate domains. Likewise, "Thinking, Fast and Slow" by Daniel Kahneman has probed the intricacies of human decision-making, prompting reflection on the curious quirks that govern our choices and their potential reverberations in the economic sphere.

Amidst this backdrop of serious scholarly inquiry, the whimsical world of fiction offers its own assortment of literary contributions that seem tangentially related to our peculiar research endeavor. "The Curious Incident of the Dog in the Night-Time" by Mark Haddon and "The Da Vinci Code" by Dan Brown contain elements of mystery and intrigue, paralleling the curious conundrum we seek to unravel in our investigation. Furthermore, the enchanting allure of J.K. Rowling's magical realm in the Harry Potter series adds an aura of whimsy to our exploration, beckoning the reader to join us on this bewitching voyage of discovery.

As we venture further into the realm of unconventional information sources, it is worth noting that our pursuit of knowledge extended beyond traditional academic archives. In a lighthearted departure from convention, our research team embraced an unorthodox approach to literature review, perusing eclectic materials ranging from the backs of shampoo bottles to comedic sketches, reveling in the delightful absurdity that permeates everyday life.

Our divergent approach to the literature review reflects the playful spirit with which we have embarked upon this inquiry, inviting the reader to partake in our unconventional blend of academic rigor and lighthearted exploration. With the stage thus set, let us merrily journey forth into the delightful amalgamation of literary whimsy, financial intrigue, and, of course, fizzy fascination. Cheers to the unexpected connections that await us!


Model: gpt-3.5-turbo-1106
System prompt: You are a silly researcher writing an academic paper.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 Google searches for 'who is jk rowling' and The Coca-Cola Company's stock price. 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 Google Trends and LSEG Analytics (Refinitiv) . You used data from 2004 to 2023

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]]
Fizzing Up the Search: The Curious Case of 'Who is J.K. Rowling' and Coca-Cola Stock Prices

[[ABSTRACT]]
In this refreshingly unconventional research paper, we explore the unlikely connection between Google searches for "who is J.K. Rowling" and the stock prices of the ever-popular Coca-Cola Company. With a bubbling curiosity, our research team delved into the data from Google Trends and LSEG Analytics (Refinitiv) to quench the thirst for knowledge on this quirkily intriguing topic. To our delightful surprise, we discovered a fizz-tastic correlation coefficient of 0.9256536 and p < 0.01 for the period spanning 2004 to 2023. Our findings not only raise eyebrows but also raise a toast to the unexpected relationships that can be uncovered in the world of data analysis. So, sit back, pop the cap off your favorite carbonated beverage, and join us as we dive into this refreshing blend of pop culture and stock market shenanigans!

[[INTRODUCTION]]
INTRODUCTION
As the great philosopher Plato once said, "The beginning is the most important part of the work." With that in mind, we kick off this academic adventure into the fizz-worthy world of virtual information and financial frolics. The intersection of Google searches for "who is J.K. Rowling" and the financial fortunes of The Coca-Cola Company might seem as odd a combination as mixing Mentos and soda, yet we implore our esteemed readers to suspend their disbelief and embark on this journey with an open mind – and perhaps an open bottle of soft drink.
It is a truth universally acknowledged that the entrance of a new author into the literary world is often met with both curiosity and celebration. J.K. Rowling, the acclaimed author of the Harry Potter series, has captivated the imaginations of readers of all ages and walks of life. The widespread fascination with her life and works has been so palpable that, dare we say, it seems to exude an effervescent quality – much like the delightful carbonation in a fizzy beverage.
At the same time, The Coca-Cola Company, an enduring titan of the global beverage industry, has experienced its fair share of price fluctuations and market challenges. Theories and hypotheses on what drives its stock prices have been as numerous as bubbles in a freshly poured cola. Yet, amidst these financial musings and market analyses, one might not expect to find a peculiar rendezvous with the inquiries about a British author. It is precisely this unexpected and at first blush, perplexing relationship, that has provided the impetus for our scholarly sojourn.
In the paragraphs that follow, we will unravel the threads that tie together virtual searches for literary luminaries and the ebb and flow of stock prices. Through meticulously gathered data and rigorous statistical analysis, we seek to shed light on this quirky correlation and offer a fresh perspective that transcends the usual confines of economic research. So, buckle up and brace for a playful yet probing exploration into the interconnected, and at times, paradoxical world of pop culture fascination and market movements.

-------

Your response should start like this:

[[METHODOLOGY]]



ChatGPT:

[[METHODOLOGY]]

To unravel the mysterious connection between Google searches for "who is J.K. Rowling" and the fluctuating stock prices of The Coca-Cola Company, we embarked on a data-driven odyssey that was equally exhilarating and, dare we say, carbonated with curiosity. Our methodology was as meticulously crafted as a limited-edition, collectible glass bottle - providing a refreshing approach to our offbeat investigation.

Data Collection:
Our intrepid journey began with the collection of data from Google Trends, quenching our thirst for insights into the search behavior patterns of inquisitive netizens. We examined the frequency of searches related to "who is J.K. Rowling" across different regions, timelines, and search platforms - like a vigilant soda connoisseur sifting through various flavors to find the perfect fizz. To complement this, we channeled the powers of LSEG Analytics (Refinitiv) to obtain a comprehensive dataset of daily stock prices for The Coca-Cola Company from 2004 to 2023. This allowed us to capture the fluctuations in the company's financial performance with the precision of an artisanal soda maker carefully measuring ingredients.

Data Preprocessing:
With the sheer amount of data at our disposal, we applied a methodological sieve to filter out any carbonation-induced noise and discrepancies. This involved cleaning, harmonizing, and aligning the datasets, ensuring that the flavors of search trends and stock prices blended harmoniously. We also calibrated our approach to factor in any potential external influences that could pop up and cause interference, like unexpected burps in a carbonated beverage.

Statistical Analysis:
Armed with a treasure trove of meticulously curated data, we deployed an assortment of statistical tools that could make even the most seasoned quantitative researchers foam at the mouth with excitement. Our primary analysis entailed correlation coefficients and regression models - akin to crafting the perfect soda formula with just the right balance of ingredients. We probed the data to uncover not just whether a relationship existed but also the magnitude and significance of this unlikely connection.

Time-Series Analysis:
Recognizing the dynamic nature of both search trends and stock prices, we leveraged time-series analysis to capture the temporal patterns and fluctuations. This allowed us to track the rise and fall of interest in J.K. Rowling and the concomitant ripples in Coca-Cola's stock prices, akin to observing the satisfying effervescence of a freshly poured soft drink.

Control Variables:
To ensure the robustness of our findings, we factored in several control variables - such as overall market trends, macroeconomic indicators, and perhaps even the phase of the moon (albeit with a tinge of irony). This fortification was crucial in isolating the specific influence of J.K. Rowling's search popularity on Coca-Cola's market dynamics, akin to separating the distinct flavor profiles in a mixed beverage.

Sensitivity Analysis:
Lastly, we subjected our findings to a rigorous sensitivity analysis, akin to subjecting a soda to various conditions to assess its resilience. This allowed us to evaluate the stability and reliability of our results across different scenarios, ensuring that our conclusions were as robust as the carbonation in a well-sealed bottle.

In essence, our methodology was as meticulous and robust as concocting the perfect soda formula, with an added hint of playful unpredictability. It encompassed a blend of quantitative rigor and exploratory zeal that mirrored the effervescent fusion of pop culture curiosity and market dynamics we sought to unravel.


Model: gpt-3.5-turbo-1106
System prompt: You are a silly researcher writing an academic paper.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 Google searches for 'who is jk rowling' and The Coca-Cola Company's stock price. 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 Google Trends and LSEG Analytics (Refinitiv) .

For the time period 2004 to 2023, you found a correlation 0.9256536, r-squared of 0.8568346, 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]]
Fizzing Up the Search: The Curious Case of 'Who is J.K. Rowling' and Coca-Cola Stock Prices

[[ABSTRACT]]
In this refreshingly unconventional research paper, we explore the unlikely connection between Google searches for "who is J.K. Rowling" and the stock prices of the ever-popular Coca-Cola Company. With a bubbling curiosity, our research team delved into the data from Google Trends and LSEG Analytics (Refinitiv) to quench the thirst for knowledge on this quirkily intriguing topic. To our delightful surprise, we discovered a fizz-tastic correlation coefficient of 0.9256536 and p < 0.01 for the period spanning 2004 to 2023. Our findings not only raise eyebrows but also raise a toast to the unexpected relationships that can be uncovered in the world of data analysis. So, sit back, pop the cap off your favorite carbonated beverage, and join us as we dive into this refreshing blend of pop culture and stock market shenanigans!

-------

And here is the methodology section that led to this result:
[[METHODOLOGY]]
INTRODUCTION
As the great philosopher Plato once said, "The beginning is the most important part of the work." With that in mind, we kick off this academic adventure into the fizz-worthy world of virtual information and financial frolics. The intersection of Google searches for "who is J.K. Rowling" and the financial fortunes of The Coca-Cola Company might seem as odd a combination as mixing Mentos and soda, yet we implore our esteemed readers to suspend their disbelief and embark on this journey with an open mind – and perhaps an open bottle of soft drink.
It is a truth universally acknowledged that the entrance of a new author into the literary world is often met with both curiosity and celebration. J.K. Rowling, the acclaimed author of the Harry Potter series, has captivated the imaginations of readers of all ages and walks of life. The widespread fascination with her life and works has been so palpable that, dare we say, it seems to exude an effervescent quality – much like the delightful carbonation in a fizzy beverage.
At the same time, The Coca-Cola Company, an enduring titan of the global beverage industry, has experienced its fair share of price fluctuations and market challenges. Theories and hypotheses on what drives its stock prices have been as numerous as bubbles in a freshly poured cola. Yet, amidst these financial musings and market analyses, one might not expect to find a peculiar rendezvous with the inquiries about a British author. It is precisely this unexpected and at first blush, perplexing relationship, that has provided the impetus for our scholarly sojourn.
In the paragraphs that follow, we will unravel the threads that tie together virtual searches for literary luminaries and the ebb and flow of stock prices. Through meticulously gathered data and rigorous statistical analysis, we seek to shed light on this quirky correlation and offer a fresh perspective that transcends the usual confines of economic research. So, buckle up and brace for a playful yet probing exploration into the interconnected, and at times, paradoxical world of pop culture fascination and market movements.

-------

Your response should start like this:

[[RESULTS]]



ChatGPT:

[[RESULTS]]

The results of our statistical analysis revealed a surprisingly strong positive correlation between Google searches for "who is J.K. Rowling" and the stock prices of The Coca-Cola Company. The correlation coefficient of 0.9256536 indicated a robust relationship between these seemingly unrelated variables. Furthermore, the r-squared value of 0.8568346 indicated that approximately 86% of the variability in Coca-Cola's stock prices could be explained by the fluctuations in the search interest for J.K. Rowling.

Intriguingly, the p-value of less than 0.01 reinforced the significance of this correlation, providing compelling evidence that the observed relationship was not due to random chance. This finding was particularly striking, considering the seemingly disparate nature of the two variables under investigation.

(Fig. 1, the scatterplot, depicts the unmistakable correlation between Google searches for "who is J.K. Rowling" and Coca-Cola's stock prices. The plot illustrates a clear trend, with an upward trajectory in search interest coinciding with an increase in stock prices, and vice versa.)

These results not only highlight the unexpected nature of this correlation but also underline the potential impact of non-traditional factors on stock market dynamics. The findings prompt further contemplation on the intricate web of influences that intersect with financial markets, reminding us that sometimes, the most intriguing relationships manifest in the most unexpected places.

In summary, our research has unveiled a notable linkage between the public's curiosity about a beloved author and the market performance of a renowned beverage company. This peculiar but robust association serves as a testament to the whimsical, unpredictable nature of the economic world and inspires a refreshing perspective on the interplay between popular culture and financial phenomena.


Model: gpt-3.5-turbo-1106
System prompt: You are a silly researcher writing an academic paper.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 Google searches for 'who is jk rowling' and The Coca-Cola Company's stock price. 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]]
Fizzing Up the Search: The Curious Case of 'Who is J.K. Rowling' and Coca-Cola Stock Prices

[[ABSTRACT]]
In this refreshingly unconventional research paper, we explore the unlikely connection between Google searches for "who is J.K. Rowling" and the stock prices of the ever-popular Coca-Cola Company. With a bubbling curiosity, our research team delved into the data from Google Trends and LSEG Analytics (Refinitiv) to quench the thirst for knowledge on this quirkily intriguing topic. To our delightful surprise, we discovered a fizz-tastic correlation coefficient of 0.9256536 and p < 0.01 for the period spanning 2004 to 2023. Our findings not only raise eyebrows but also raise a toast to the unexpected relationships that can be uncovered in the world of data analysis. So, sit back, pop the cap off your favorite carbonated beverage, and join us as we dive into this refreshing blend of pop culture and stock market shenanigans!

[[LITERATURE REVIEW]]
The examination of the relationship between seemingly unrelated phenomena has long been a pursuit of both scholarly and whimsical minds alike. In the world of academic research, some studies by Smith and Jones have delved into the unexpected connections between consumer behavior and stock prices, providing foundational insights into the enigmatic interplay of popular culture and financial markets. Additionally, Doe's exploration of internet search trends and their impact on market sentiment has offered a thought-provoking perspective on the potential influence of virtual curiosity on investment decisions.
In a similar vein, non-fiction literature such as "Freakonomics" by Steven D. Levitt and Stephen J. Dubner has sparked contemplation on unconventional correlations, challenging traditional views of causality and shedding light on the unexpected intertwining of disparate domains. Likewise, "Thinking, Fast and Slow" by Daniel Kahneman has probed the intricacies of human decision-making, prompting reflection on the curious quirks that govern our choices and their potential reverberations in the economic sphere.
Amidst this backdrop of serious scholarly inquiry, the whimsical world of fiction offers its own assortment of literary contributions that seem tangentially related to our peculiar research endeavor. "The Curious Incident of the Dog in the Night-Time" by Mark Haddon and "The Da Vinci Code" by Dan Brown contain elements of mystery and intrigue, paralleling the curious conundrum we seek to unravel in our investigation. Furthermore, the enchanting allure of J.K. Rowling's magical realm in the Harry Potter series adds an aura of whimsy to our exploration, beckoning the reader to join us on this bewitching voyage of discovery.
As we venture further into the realm of unconventional information sources, it is worth noting that our pursuit of knowledge extended beyond traditional academic archives. In a lighthearted departure from convention, our research team embraced an unorthodox approach to literature review, perusing eclectic materials ranging from the backs of shampoo bottles to comedic sketches, reveling in the delightful absurdity that permeates everyday life.
Our divergent approach to the literature review reflects the playful spirit with which we have embarked upon this inquiry, inviting the reader to partake in our unconventional blend of academic rigor and lighthearted exploration. With the stage thus set, let us merrily journey forth into the delightful amalgamation of literary whimsy, financial intrigue, and, of course, fizzy fascination. Cheers to the unexpected connections that await us!

[[RESULTS]]
The results of our statistical analysis revealed a surprisingly strong positive correlation between Google searches for "who is J.K. Rowling" and the stock prices of The Coca-Cola Company. The correlation coefficient of 0.9256536 indicated a robust relationship between these seemingly unrelated variables. Furthermore, the r-squared value of 0.8568346 indicated that approximately 86% of the variability in Coca-Cola's stock prices could be explained by the fluctuations in the search interest for J.K. Rowling.
Intriguingly, the p-value of less than 0.01 reinforced the significance of this correlation, providing compelling evidence that the observed relationship was not due to random chance. This finding was particularly striking, considering the seemingly disparate nature of the two variables under investigation.
(Fig. 1, the scatterplot, depicts the unmistakable correlation between Google searches for "who is J.K. Rowling" and Coca-Cola's stock prices. The plot illustrates a clear trend, with an upward trajectory in search interest coinciding with an increase in stock prices, and vice versa.)
These results not only highlight the unexpected nature of this correlation but also underline the potential impact of non-traditional factors on stock market dynamics. The findings prompt further contemplation on the intricate web of influences that intersect with financial markets, reminding us that sometimes, the most intriguing relationships manifest in the most unexpected places.
In summary, our research has unveiled a notable linkage between the public's curiosity about a beloved author and the market performance of a renowned beverage company. This peculiar but robust association serves as a testament to the whimsical, unpredictable nature of the economic world and inspires a refreshing perspective on the interplay between popular culture and financial phenomena.

-------

Your response should start like this:

[[DISCUSSION]]



ChatGPT:

[[DISCUSSION]]

Our investigation into the correlation between Google searches for "who is J.K. Rowling" and the stock prices of The Coca-Cola Company has provided some truly uplifting results. The robust correlation coefficient of 0.9256536 and the p-value of less than 0.01 paint a compelling picture of the surprising connection between the virtual curiosity surrounding the acclaimed author and the fluctuation of the soda giant's stock prices.

As we pour over the whimsical revelations of our literature review, we find that our findings are in harmony with prior research. Smith and Jones' exploration of consumer behavior and stock prices seems to have found an unexpected soulmate in our study. It appears that just as Coke is inseparable from its signature fizz, the public's curiosity about J.K. Rowling and the market performance of Coca-Cola are just as inseparably linked. Likewise, Doe's musings on internet search trends and market sentiment now have an effervescent companion in our work, as the fizzy correlation we've unveiled leaves a refreshing taste for future investigations into similar, unexplored connections.

While our results may seem as unlikely as finding a golden snitch in a soda can, there is a serious takeaway here. It's a reminder that the economic world is a complex tapestry with threads that can seem frivolous yet hold surprising influence. Our findings underscore that the market's behavior can be as capricious as the sorting hat, and just like in the wizarding world, there are enchanting discoveries waiting to be unearthed in the seemingly mundane.

Our exploratory approach, rooted in both academic rigor and playful whimsy, has offered a delightful fusion of seriousness and lightheartedness. In doing so, we've managed not only to illuminate the curious connection between cultural curiosity and financial fluctuations but also to infuse some levity into the often buttoned-up world of economic research. In conclusion, this fizzy amalgamation of whimsy and finance reminds us that sometimes, the most unexpected pairings have the potential to yield the most refreshing insights. So, here's to indulging in the delightful absurdity of the world, one unexpected correlation at a time!


Model: gpt-3.5-turbo-1106
System prompt: You are a silly researcher writing an academic paper.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 Google searches for 'who is jk rowling' and The Coca-Cola Company's stock price. 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]]
Fizzing Up the Search: The Curious Case of 'Who is J.K. Rowling' and Coca-Cola Stock Prices

[[ABSTRACT]]
In this refreshingly unconventional research paper, we explore the unlikely connection between Google searches for "who is J.K. Rowling" and the stock prices of the ever-popular Coca-Cola Company. With a bubbling curiosity, our research team delved into the data from Google Trends and LSEG Analytics (Refinitiv) to quench the thirst for knowledge on this quirkily intriguing topic. To our delightful surprise, we discovered a fizz-tastic correlation coefficient of 0.9256536 and p < 0.01 for the period spanning 2004 to 2023. Our findings not only raise eyebrows but also raise a toast to the unexpected relationships that can be uncovered in the world of data analysis. So, sit back, pop the cap off your favorite carbonated beverage, and join us as we dive into this refreshing blend of pop culture and stock market shenanigans!

[[INTRDUCTION]]
INTRODUCTION
As the great philosopher Plato once said, "The beginning is the most important part of the work." With that in mind, we kick off this academic adventure into the fizz-worthy world of virtual information and financial frolics. The intersection of Google searches for "who is J.K. Rowling" and the financial fortunes of The Coca-Cola Company might seem as odd a combination as mixing Mentos and soda, yet we implore our esteemed readers to suspend their disbelief and embark on this journey with an open mind – and perhaps an open bottle of soft drink.
It is a truth universally acknowledged that the entrance of a new author into the literary world is often met with both curiosity and celebration. J.K. Rowling, the acclaimed author of the Harry Potter series, has captivated the imaginations of readers of all ages and walks of life. The widespread fascination with her life and works has been so palpable that, dare we say, it seems to exude an effervescent quality – much like the delightful carbonation in a fizzy beverage.
At the same time, The Coca-Cola Company, an enduring titan of the global beverage industry, has experienced its fair share of price fluctuations and market challenges. Theories and hypotheses on what drives its stock prices have been as numerous as bubbles in a freshly poured cola. Yet, amidst these financial musings and market analyses, one might not expect to find a peculiar rendezvous with the inquiries about a British author. It is precisely this unexpected and at first blush, perplexing relationship, that has provided the impetus for our scholarly sojourn.
In the paragraphs that follow, we will unravel the threads that tie together virtual searches for literary luminaries and the ebb and flow of stock prices. Through meticulously gathered data and rigorous statistical analysis, we seek to shed light on this quirky correlation and offer a fresh perspective that transcends the usual confines of economic research. So, buckle up and brace for a playful yet probing exploration into the interconnected, and at times, paradoxical world of pop culture fascination and market movements.

[[RESULTS]]
The results of our statistical analysis revealed a surprisingly strong positive correlation between Google searches for "who is J.K. Rowling" and the stock prices of The Coca-Cola Company. The correlation coefficient of 0.9256536 indicated a robust relationship between these seemingly unrelated variables. Furthermore, the r-squared value of 0.8568346 indicated that approximately 86% of the variability in Coca-Cola's stock prices could be explained by the fluctuations in the search interest for J.K. Rowling.
Intriguingly, the p-value of less than 0.01 reinforced the significance of this correlation, providing compelling evidence that the observed relationship was not due to random chance. This finding was particularly striking, considering the seemingly disparate nature of the two variables under investigation.
(Fig. 1, the scatterplot, depicts the unmistakable correlation between Google searches for "who is J.K. Rowling" and Coca-Cola's stock prices. The plot illustrates a clear trend, with an upward trajectory in search interest coinciding with an increase in stock prices, and vice versa.)
These results not only highlight the unexpected nature of this correlation but also underline the potential impact of non-traditional factors on stock market dynamics. The findings prompt further contemplation on the intricate web of influences that intersect with financial markets, reminding us that sometimes, the most intriguing relationships manifest in the most unexpected places.
In summary, our research has unveiled a notable linkage between the public's curiosity about a beloved author and the market performance of a renowned beverage company. This peculiar but robust association serves as a testament to the whimsical, unpredictable nature of the economic world and inspires a refreshing perspective on the interplay between popular culture and financial phenomena.

-------

Your response should start like this:

[[CONCLUSION]]



ChatGPT:

[[CONCLUSION]]

In conclusion, our investigation into the correlation between "who is J.K. Rowling" Google searches and The Coca-Cola Company's stock prices has unearthed a result as surprising as finding a fizzy drink in the desert – a remarkably strong positive correlation. This robust relationship, akin to the reliable effervescence of carbonated beverages, has defied conventional expectations and sent ripples through the realms of literary curiosity and financial fortunes.

While our findings may seem as unexpected as discovering a hidden prize under the cap of a soda bottle, they underscore the importance of exploring non-traditional factors in the world of market dynamics. Just as a perfectly balanced blend of ingredients creates the perfect cola, our research suggests that seemingly unrelated elements can blend together to influence stock prices in unforeseen ways.

With a correlation coefficient stronger than the carbonation of a freshly opened soda and a p-value more significant than the impact of a Mentos dropped into said soda, our results are as clear and effervescent as the message in a bottle. This unique connection between cultural curiosity and market movements may raise more eyebrows than the satisfying sound of a bottle cap popping, but it also encourages a reinvigorated perspective on the interplay between popular culture and economic phenomena.

Having quenched our thirst for knowledge in this peculiar paradigm, we emphatically assert that no further research is needed in this area. As we savor the unexpected delight of this uncommon correlation, we raise our glasses – whether filled with soda or any other beverage of one's preference – to the whimsical, often surprising nature of the economic world. Cheers to a refreshing blend of statistical intrigue and market merriment!


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 Fizzing Up the Search: The Curious Case of 'Who is J.K. Rowling' and Coca-Cola Stock Prices. Respond only with the name of a fictional academic journal.

ChatGPT:

The Journal of Quirky Connections


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 Fizzing Up the Search: The Curious Case of 'Who is J.K. Rowling' and Coca-Cola Stock Prices. Respond only with the name of a fictional organization.

ChatGPT:

The Society for Quirky Connections in Economics and Literature


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 Fizzing Up the Search: The Curious Case of 'Who is J.K. Rowling' and Coca-Cola Stock Prices with an abstract of In this refreshingly unconventional research paper, we explore the unlikely connection between Google searches for "who is J.K. Rowling" and the stock prices of the ever-popular Coca-Cola Company. With a bubbling curiosity, our research team delved into the data from Google Trends and LSEG Analytics (Refinitiv) to quench the thirst for knowledge on this quirkily intriguing topic. To our delightful surprise, we discovered a fizz-tastic correlation coefficient of 0.9256536 and p < 0.01 for the period spanning 2004 to 2023. Our findings not only raise eyebrows but also raise a toast to the unexpected relationships that can be uncovered in the world of data analysis. So, sit back, pop the cap off your favorite carbonated beverage, and join us as we dive into this refreshing blend of pop culture and stock market shenanigans!

ChatGPT:

"who is J.K. Rowling" search trends, Coca-Cola stock prices, Google Trends data analysis, LSEG Analytics (Refinitiv), correlation coefficient in data analysis, unexpected relationships in data analysis, pop culture and stock market correlation, "who is J.K. Rowling" search and Coca-Cola stock prices, curious correlations in data analysis

*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

Google searches for 'who is jk rowling'
Detailed data title: Relative volume of Google searches for 'who is jk rowling' (Worldwide, without quotes)
Source: Google Trends
Additional Info: Relative search volume (not absolute numbers)

See what else correlates with Google searches for 'who is jk rowling'

The Coca-Cola Company's stock price (KO)
Detailed data title: Opening price of The Coca-Cola Company (KO) on the first trading day of the year
Source: LSEG Analytics (Refinitiv)
Additional Info: Via Microsoft Excel Stockhistory function

See what else correlates with The Coca-Cola Company's stock price (KO)

Correlation r = 0.9256536 (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.8568346 (Coefficient of determination)
This means 85.7% of the change in the one variable (i.e., The Coca-Cola Company's stock price (KO)) is predictable based on the change in the other (i.e., Google searches for 'who is jk rowling') over the 20 years from 2004 through 2023.

p < 0.01, which is statistically significant(Null hypothesis significance test)
The p-value is 5.02E-9. 0.0000000050211719152423230000
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.93 in 5.02E-7% of random cases. Said differently, if you correlated 199,156,694 random variables You don't actually need 199 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 19 degrees of freedom, Degrees of freedom is a measure of how many free components we are testing. In this case it is 19 because we have two variables measured over a period of 20 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.82, 0.97 ] 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.
20042005200620072008200920102011201220132014201520162017201820192020202120222023
Google searches for 'who is jk rowling' (Rel. search volume)7.4166712.1667516.083311.2517.16679.528.666721.833321.916725.416733.33332933.7535.333340.416757.416739.833347.546
The Coca-Cola Company's stock price (KO) (Stock price)25.420.9520.424.1830.7322.728.5832.9435.0836.9941.1242.2642.3441.545.9146.9455.3254.2758.8263.56




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([7.41667,12.1667,5,16.0833,11.25,17.1667,9.5,28.6667,21.8333,21.9167,25.4167,33.3333,29,33.75,35.3333,40.4167,57.4167,39.8333,47.5,46,])
array_2 = np.array([25.4,20.95,20.4,24.18,30.73,22.7,28.58,32.94,35.08,36.99,41.12,42.26,42.34,41.5,45.91,46.94,55.32,54.27,58.82,63.56,])
array_1_name = "Google searches for 'who is jk rowling'"
array_2_name = "The Coca-Cola Company's stock price (KO)"

# 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 genuinely thankful for your rating!


Correlation ID: 1104 · Black Variable ID: 1364 · Red Variable ID: 1565
about · subscribe · emailme@tylervigen.com · twitter

CC BY 4.0