about · email me · subscribe
Spurious correlation #3,815 · View random

A linear line chart with years as the X-axis and two variables on the Y-axis. The first variable is Air pollution in St. Marys, Pennsylvania and the second variable is Violent crime rates.  The chart goes from 1990 to 2022, and the two variables track closely in value over that time. Small Image
Download png
, svg

AI explanation

As the smog lifted, so did the tendency to brawl. Turns out, cleaner air led to cleaner tempers. It's as if the reduced pollution created a 'peaceful protest' within the population, showing that when it comes to crime, the real 'killer' was actually the pollutants in the air. This just goes to show that when the atmosphere is less toxic, so are the interactions. Who would have thought that the key to a safer city was simply letting the residents breathe easy?

Model: dalle-3
Prompt: [Concept art] Generate an image that features a serene nature trail in St. Marys, Pennsylvania. The clear blue skies should be the centerpiece, with gentle clouds and a feeling of spaciousness. Show people leisurely strolling along the trail, surrounded by vibrant, lush greenery. The absence of pollution should be reflected in the pristine clarity of the air. Additionally, depict a sense of tranquility and peace, contrasting with the notion of criminals choosing to partake in the peaceful environment rather than engaging in violent activities. 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: Air pollution in St. Marys, Pennsylvania and Violent crime rates. 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: Parallax art Cubism a meme Scalar art 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 Air pollution in St. Marys, Pennsylvania and Violent crime rates, in the following situation: Because with the air so clean and inviting, even the criminals in St. Marys, Pennsylvania are opting for leisurely nature walks instead of engaging in violent activities. Less pollution, more peaceful strolls.. Keep the description simple.
ChatGPT: In St. Marys, Pennsylvania, the clear blue skies are filled with fresh, crisp air. People are seen leisurely strolling along the scenic nature trails, surrounded by lush greenery. The absence of air pollution has brought a sense of tranquility to the town, with even the criminals opting for peaceful walks in the serene environment instead of engaging in violent activities.

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 St. Marys, Pennsylvania, the clear blue skies are filled with fresh, crisp air. People are seen leisurely strolling along the scenic nature trails, surrounded by lush greenery. The absence of air pollution has brought a sense of tranquility to the town, with even the criminals opting for peaceful walks in the serene environment instead of engaging in violent activities. Keep the visual depiction simple. Do not include any words or speech bubbles.
ChatGPT: [Concept art] Generate an image that features a serene nature trail in St. Marys, Pennsylvania. The clear blue skies should be the centerpiece, with gentle clouds and a feeling of spaciousness. Show people leisurely strolling along the trail, surrounded by vibrant, lush greenery. The absence of pollution should be reflected in the pristine clarity of the air. Additionally, depict a sense of tranquility and peace, contrasting with the notion of criminals choosing to partake in the peaceful environment rather than engaging in violent activities.

*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 a decrease in Air pollution in St. Marys, Pennsylvania caused Violent crime rates to decrease. Include one good pun.

AI academic paper

(Because p < 0.01)
The Hazy Link Between Air Pollution and Criminal Tendencies: A Case Study in St. Marys, Pennsylvania

Journal of Quirky Environmental Psychology

Jan 2024

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




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

Please draft the title and abstract of an academic research paper presenting the findings of the connection between Air pollution in St. Marys, Pennsylvania and Violent crime rates. Make lots of jokes, goofy observations, and puns.

Make the title punny if you can come up with clever pun. If not, make it sound serious.

Your research team used data from Environmental Protection Agency and FBI Criminal Justice Information Services to assess this nagging question. You found a correlation coefficient of 0.8527981 and p < 0.01 for 1990 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]]
The Hazy Link Between Air Pollution and Criminal Tendencies: A Case Study in St. Marys, Pennsylvania

[[ABSTRACT]]
The correlation between air pollution and violent crime rates has long been an intriguing enigma for researchers. In this paper, we present the results of our investigation into the potentially suffocating relationship between air pollution and criminal activity, focusing on the town of St. Marys, Pennsylvania. Leveraging data from the Environmental Protection Agency and the FBI Criminal Justice Information Services, we uncovered a remarkably strong correlation coefficient of 0.8527981 with a statistically significant p-value of less than 0.01 for the period spanning 1990 to 2022. Our findings suggest that as the air quality deteriorates, so does the temperament of the residents, triggering an uptick in violent crime. This research sheds light on the unassuming yet potent impact of air pollution on human behavior, making a compelling case for cleaner air and a safer community.


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

Please make up the introduction section of an academic research paper presenting the findings of the connection between Air pollution in St. Marys, Pennsylvania and Violent crime rates. Make lots of jokes, goofy observations, and puns. Sneak in some jokes and clever puns about science, research, statistics, and the variables.

Here is the title and abstract of the paper:
[[TITLE]]
The Hazy Link Between Air Pollution and Criminal Tendencies: A Case Study in St. Marys, Pennsylvania

[[ABSTRACT]]
The correlation between air pollution and violent crime rates has long been an intriguing enigma for researchers. In this paper, we present the results of our investigation into the potentially suffocating relationship between air pollution and criminal activity, focusing on the town of St. Marys, Pennsylvania. Leveraging data from the Environmental Protection Agency and the FBI Criminal Justice Information Services, we uncovered a remarkably strong correlation coefficient of 0.8527981 with a statistically significant p-value of less than 0.01 for the period spanning 1990 to 2022. Our findings suggest that as the air quality deteriorates, so does the temperament of the residents, triggering an uptick in violent crime. This research sheds light on the unassuming yet potent impact of air pollution on human behavior, making a compelling case for cleaner air and a safer community.

-------

Your response should start like this:

[[INTRODUCTION]]



ChatGPT:
[[INTRODUCTION]]

The notion of a connection between air pollution and criminal behavior may sound like an idea straight out of a cheesy sci-fi movie, but the data suggests there's more to this hypothesis than meets the eye. The mystery of how the air we breathe might influence our inclination towards violent crime has long been a head-scratcher for researchers, leaving us gasping for answers. In this study, we take a deep dive into the murky depths of this concept, focusing our investigation on the charming town of St. Marys, Pennsylvania.

As we venture into this foggy realm of research, it's worth noting that the relationship between air pollution and criminal tendencies is a complex web of variables and confounding factors. We're not just dealing with straightforward cause-and-effect relationships here; we're navigating through a fog of potential correlations, interactions, and lurking lurking lurking omitted-variable biases. It's a statistical labyrinth that could make even the most seasoned data analyst feel like they're walking through a mental haze.

Armed with data from the Environmental Protection Agency and the FBI Criminal Justice Information Services, we set out to unravel this enigmatic tale of tainted air and temperamental behavior. We scrutinized air quality metrics and crime rates from 1990 to 2022, teasing apart the intricate dance between PM2.5 particles and propensity for mischief.

In the face of this complex statistical puzzle, we unearthed a remarkably robust correlation coefficient of 0.8527981, shining a stark light on the relationship between polluted air and propensity for aggressive behavior. The p-value of less than 0.01 further solidifies our findings, signaling that the connection we've uncovered is not just a random fluke, but a statistically meaningful revelation.

In this paper, we will present our findings with a mix of scientific rigor and lighthearted curiosity, shedding light on the unexpected dance between air pollution and criminal tendencies. So buckle up and take a deep breath (preferably in an area with clean air) as we unravel the hazy link between air pollution and criminal inclinations in the charming town of St. Marys, Pennsylvania.


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

Please make up a literature review section of an academic research paper presenting the findings of the connection between Air pollution in St. Marys, Pennsylvania and Violent crime rates. 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 cite some social media posts you read that seem to be related.

Here is the title and abstract of the paper:
[[TITLE]]
The Hazy Link Between Air Pollution and Criminal Tendencies: A Case Study in St. Marys, Pennsylvania

[[ABSTRACT]]
The correlation between air pollution and violent crime rates has long been an intriguing enigma for researchers. In this paper, we present the results of our investigation into the potentially suffocating relationship between air pollution and criminal activity, focusing on the town of St. Marys, Pennsylvania. Leveraging data from the Environmental Protection Agency and the FBI Criminal Justice Information Services, we uncovered a remarkably strong correlation coefficient of 0.8527981 with a statistically significant p-value of less than 0.01 for the period spanning 1990 to 2022. Our findings suggest that as the air quality deteriorates, so does the temperament of the residents, triggering an uptick in violent crime. This research sheds light on the unassuming yet potent impact of air pollution on human behavior, making a compelling case for cleaner air and a safer community.

-------

And here is the introduction section that led to this literature review:
[[INTRODUCTION]]
The notion of a connection between air pollution and criminal behavior may sound like an idea straight out of a cheesy sci-fi movie, but the data suggests there's more to this hypothesis than meets the eye. The mystery of how the air we breathe might influence our inclination towards violent crime has long been a head-scratcher for researchers, leaving us gasping for answers. In this study, we take a deep dive into the murky depths of this concept, focusing our investigation on the charming town of St. Marys, Pennsylvania.
As we venture into this foggy realm of research, it's worth noting that the relationship between air pollution and criminal tendencies is a complex web of variables and confounding factors. We're not just dealing with straightforward cause-and-effect relationships here; we're navigating through a fog of potential correlations, interactions, and lurking lurking lurking omitted-variable biases. It's a statistical labyrinth that could make even the most seasoned data analyst feel like they're walking through a mental haze.
Armed with data from the Environmental Protection Agency and the FBI Criminal Justice Information Services, we set out to unravel this enigmatic tale of tainted air and temperamental behavior. We scrutinized air quality metrics and crime rates from 1990 to 2022, teasing apart the intricate dance between PM2.5 particles and propensity for mischief.
In the face of this complex statistical puzzle, we unearthed a remarkably robust correlation coefficient of 0.8527981, shining a stark light on the relationship between polluted air and propensity for aggressive behavior. The p-value of less than 0.01 further solidifies our findings, signaling that the connection we've uncovered is not just a random fluke, but a statistically meaningful revelation.
In this paper, we will present our findings with a mix of scientific rigor and lighthearted curiosity, shedding light on the unexpected dance between air pollution and criminal tendencies. So buckle up and take a deep breath (preferably in an area with clean air) as we unravel the hazy link between air pollution and criminal inclinations in the charming town of St. Marys, Pennsylvania.

-------

Your response should start like this:

[[LITERATURE REVIEW]]



ChatGPT:
[[LITERATURE REVIEW]]

In "Smith and Doe (2010)," the authors find compelling evidence of a positive association between air pollution and crime rates in urban areas, shedding light on the potentially smoggy correlation between the two variables. Similarly, in "Jones et al. (2015)," the researchers delve into the intricate dynamics of air quality and aggressive behavior, uncovering a haze of statistical significance in their analysis.

These serious endeavors in the field of environmental criminology provide a solid foundation for our investigation into the connection between air pollution and criminal tendencies. However, as we embark on our own research journey, we cannot ignore the whimsical interplay of pop culture references and fictional narratives that have permeated the public consciousness regarding this enigmatic relationship.

Diving into the literary world, we turn to "Air Pollution and Crime: A Tale of Two Cities" by Bill N. Airy, which, contrary to its title, offers nothing but smoke and mirrors in its attempt to unravel the complex interplay between atmospheric contaminants and illicit activities.

On a more imaginative note, "The Smog of Suspicion" by Penny Plotz presents a fantastical portrayal of a world where air pollution not only clouds the skies but also clouds the judgment of its inhabitants, leading to a surge in devious deeds and dubious behavior.

In a more grounded approach, "The Economics of Criminal Air: A Social Media Analysis" by @CleanAirCriminalAffair dives into the Twitterverse and untangles the web of user-generated content hinting at a clandestine connection between hazy skies and unlawful conduct, with hashtags like #SmoggyMinds and #PollutionPerpetrators gaining traction in the digital sphere.

As we navigate through this labyrinth of literature and online discourse, it becomes clear that the link between air pollution and criminal tendencies is not just a subject for scholarly investigation, but a canvas for artistic expression and social speculation.

Stay tuned for the unexpected twists and turns as we unveil the peculiar relationship between air pollution and criminal tendencies in the idyllic town of St. Marys, Pennsylvania.


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

Please make up the methodology section of an academic research paper presenting the findings of the connection between Air pollution in St. Marys, Pennsylvania and Violent crime rates. Make lots of jokes, goofy observations, and puns. Sneak in some jokes and clever puns about science, research, statistics, and the variables.

Your research team collected data from all across the internet, but mostly just used information from Environmental Protection Agency and FBI Criminal Justice Information Services . You used data from 1990 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]]
The Hazy Link Between Air Pollution and Criminal Tendencies: A Case Study in St. Marys, Pennsylvania

[[ABSTRACT]]
The correlation between air pollution and violent crime rates has long been an intriguing enigma for researchers. In this paper, we present the results of our investigation into the potentially suffocating relationship between air pollution and criminal activity, focusing on the town of St. Marys, Pennsylvania. Leveraging data from the Environmental Protection Agency and the FBI Criminal Justice Information Services, we uncovered a remarkably strong correlation coefficient of 0.8527981 with a statistically significant p-value of less than 0.01 for the period spanning 1990 to 2022. Our findings suggest that as the air quality deteriorates, so does the temperament of the residents, triggering an uptick in violent crime. This research sheds light on the unassuming yet potent impact of air pollution on human behavior, making a compelling case for cleaner air and a safer community.

[[INTRODUCTION]]
The notion of a connection between air pollution and criminal behavior may sound like an idea straight out of a cheesy sci-fi movie, but the data suggests there's more to this hypothesis than meets the eye. The mystery of how the air we breathe might influence our inclination towards violent crime has long been a head-scratcher for researchers, leaving us gasping for answers. In this study, we take a deep dive into the murky depths of this concept, focusing our investigation on the charming town of St. Marys, Pennsylvania.
As we venture into this foggy realm of research, it's worth noting that the relationship between air pollution and criminal tendencies is a complex web of variables and confounding factors. We're not just dealing with straightforward cause-and-effect relationships here; we're navigating through a fog of potential correlations, interactions, and lurking lurking lurking omitted-variable biases. It's a statistical labyrinth that could make even the most seasoned data analyst feel like they're walking through a mental haze.
Armed with data from the Environmental Protection Agency and the FBI Criminal Justice Information Services, we set out to unravel this enigmatic tale of tainted air and temperamental behavior. We scrutinized air quality metrics and crime rates from 1990 to 2022, teasing apart the intricate dance between PM2.5 particles and propensity for mischief.
In the face of this complex statistical puzzle, we unearthed a remarkably robust correlation coefficient of 0.8527981, shining a stark light on the relationship between polluted air and propensity for aggressive behavior. The p-value of less than 0.01 further solidifies our findings, signaling that the connection we've uncovered is not just a random fluke, but a statistically meaningful revelation.
In this paper, we will present our findings with a mix of scientific rigor and lighthearted curiosity, shedding light on the unexpected dance between air pollution and criminal tendencies. So buckle up and take a deep breath (preferably in an area with clean air) as we unravel the hazy link between air pollution and criminal inclinations in the charming town of St. Marys, Pennsylvania.

-------

Your response should start like this:

[[METHODOLOGY]]



ChatGPT:

[[METHODOLOGY]]

To navigate the convoluted connection between air pollution and criminal behavior, our research team embarked on a methodological odyssey that involved wrangling data from the Environmental Protection Agency and the FBI Criminal Justice Information Services. Our data collection process was akin to scuba diving in a murky swamp - we had to dig through heaps of information, avoiding statistical crocodiles and data cobwebs, to emerge with a treasure trove of air quality metrics and crime rates.

We started by sifting through air quality data, focusing on the concentration of PM2.5 particles - those pesky micro-particles floating in the air that can wreak havoc on our respiratory systems. Like detectives on the trail of a mysterious culprit, we gathered PM2.5 data from various monitoring stations in and around St. Marys, Pennsylvania. We then wrangled with crime statistics from the FBI Criminal Justice Information Services, carefully navigating the labyrinth of incident reports and arrest records to pinpoint trends in violent crime rates.

The next step in our methodology was akin to concocting a scientific potion - we mixed and matched the data, comparing air pollution levels with criminal tendencies to uncover potential correlations. Using statistical software that could give even a seasoned mathematician a run for their money, we applied robust regression models and sophisticated analyses to find the unicorn in the forest of variables - a strong, statistically significant relationship between air pollution and violent crime rates.

With caution and curiosity, we delved into the statistical jungle, taking precautions not to stumble into the traps of spurious correlations or omitted-variable biases. We subjected our data to rigorous tests, ensuring that the relationships we uncovered were not just statistical flukes, but meaningful connections worthy of further investigation.

Ultimately, our methodology combined the tenacity of a detective on a case, the precision of a chemist mixing complex compounds, and the patience of a mathematician unraveling intricate puzzles. Through this multidisciplinary approach, we emerged with compelling evidence of the hazy link between air pollution and criminal tendencies, shedding light on a captivating connection that may have gone unnoticed amid the fog of statistical variables.


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

Please make up the results section of an academic research paper presenting the findings of the connection between Air pollution in St. Marys, Pennsylvania and Violent crime rates. Make lots of jokes, goofy observations, and puns. Sneak in some jokes and clever puns about science, research, statistics, and the variables.

Your research team collected data from all across the internet, but mostly just used information from Environmental Protection Agency and FBI Criminal Justice Information Services .

For the time period 1990 to 2022, you found a correlation 0.8527981, r-squared of 0.7272647, 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]]
The Hazy Link Between Air Pollution and Criminal Tendencies: A Case Study in St. Marys, Pennsylvania

[[ABSTRACT]]
The correlation between air pollution and violent crime rates has long been an intriguing enigma for researchers. In this paper, we present the results of our investigation into the potentially suffocating relationship between air pollution and criminal activity, focusing on the town of St. Marys, Pennsylvania. Leveraging data from the Environmental Protection Agency and the FBI Criminal Justice Information Services, we uncovered a remarkably strong correlation coefficient of 0.8527981 with a statistically significant p-value of less than 0.01 for the period spanning 1990 to 2022. Our findings suggest that as the air quality deteriorates, so does the temperament of the residents, triggering an uptick in violent crime. This research sheds light on the unassuming yet potent impact of air pollution on human behavior, making a compelling case for cleaner air and a safer community.

-------

And here is the methodology section that led to this result:
[[METHODOLOGY]]
The notion of a connection between air pollution and criminal behavior may sound like an idea straight out of a cheesy sci-fi movie, but the data suggests there's more to this hypothesis than meets the eye. The mystery of how the air we breathe might influence our inclination towards violent crime has long been a head-scratcher for researchers, leaving us gasping for answers. In this study, we take a deep dive into the murky depths of this concept, focusing our investigation on the charming town of St. Marys, Pennsylvania.
As we venture into this foggy realm of research, it's worth noting that the relationship between air pollution and criminal tendencies is a complex web of variables and confounding factors. We're not just dealing with straightforward cause-and-effect relationships here; we're navigating through a fog of potential correlations, interactions, and lurking lurking lurking omitted-variable biases. It's a statistical labyrinth that could make even the most seasoned data analyst feel like they're walking through a mental haze.
Armed with data from the Environmental Protection Agency and the FBI Criminal Justice Information Services, we set out to unravel this enigmatic tale of tainted air and temperamental behavior. We scrutinized air quality metrics and crime rates from 1990 to 2022, teasing apart the intricate dance between PM2.5 particles and propensity for mischief.
In the face of this complex statistical puzzle, we unearthed a remarkably robust correlation coefficient of 0.8527981, shining a stark light on the relationship between polluted air and propensity for aggressive behavior. The p-value of less than 0.01 further solidifies our findings, signaling that the connection we've uncovered is not just a random fluke, but a statistically meaningful revelation.
In this paper, we will present our findings with a mix of scientific rigor and lighthearted curiosity, shedding light on the unexpected dance between air pollution and criminal tendencies. So buckle up and take a deep breath (preferably in an area with clean air) as we unravel the hazy link between air pollution and criminal inclinations in the charming town of St. Marys, Pennsylvania.

-------

Your response should start like this:

[[RESULTS]]



ChatGPT:

[[RESULTS]]

The data analysis unveiled a strong and rather breathtaking correlation coefficient of 0.8527981 between air pollution and violent crime rates in St. Marys, Pennsylvania from 1990 to 2022. It seems that as the air quality plummeted, the town witnessed a surge in criminal activity, giving a whole new meaning to the term "air rage."

The scatterplot (Fig. 1, not to be mistaken for Fig. Newton) graphically depicts this compelling relationship, highlighting the unmistakable upward trend in violent crime as air pollution levels soared. It's almost as if the air pollution was instigating a rebellious streak in the town's inhabitants, prompting them to act out in ways that were nothing short of... breath-taking.

The r-squared value of 0.7272647 further emphasizes the strength of this connection, suggesting that approximately 72.7% of the variation in violent crime rates can be explained by changes in air pollution. It's as if the polluted air was whispering sinister plots into the ears of the town's residents, goading them into engaging in nefarious activities.

But we shouldn't jump to conclusions just yet. While the correlation is robust, it does not imply causation. After all, we don't want to be caught in a statistical haze, mistaking correlation for causation and getting lost in a fog of erroneous assumptions. However, the statistically significant p-value of less than 0.01 gives us confidence that this relationship isn't just a statistical fluke, but a legitimate phenomenon worthy of further investigation.

In essence, the results of this study paint a vivid picture of the entwined dance between polluted air and criminal tendencies, urging us to consider the unforeseen influence of environmental factors on human behavior. Our findings serve as a compelling argument for cleaner air, not just for the sake of the environment, but for the tranquility and safety of our communities. As the saying goes, when it comes to air quality and crime rates, it's not just hot air – it's a matter of criminal significance.


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

Please make up the discussion section of an academic research paper presenting the findings of the connection between Air pollution in St. Marys, Pennsylvania and Violent crime rates. Make lots of jokes, goofy observations, and puns. Sneak in some jokes and clever puns about science, research, statistics, and the variables.

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]]
The Hazy Link Between Air Pollution and Criminal Tendencies: A Case Study in St. Marys, Pennsylvania

[[ABSTRACT]]
The correlation between air pollution and violent crime rates has long been an intriguing enigma for researchers. In this paper, we present the results of our investigation into the potentially suffocating relationship between air pollution and criminal activity, focusing on the town of St. Marys, Pennsylvania. Leveraging data from the Environmental Protection Agency and the FBI Criminal Justice Information Services, we uncovered a remarkably strong correlation coefficient of 0.8527981 with a statistically significant p-value of less than 0.01 for the period spanning 1990 to 2022. Our findings suggest that as the air quality deteriorates, so does the temperament of the residents, triggering an uptick in violent crime. This research sheds light on the unassuming yet potent impact of air pollution on human behavior, making a compelling case for cleaner air and a safer community.

[[LITERATURE REVIEW]]
In "Smith and Doe (2010)," the authors find compelling evidence of a positive association between air pollution and crime rates in urban areas, shedding light on the potentially smoggy correlation between the two variables. Similarly, in "Jones et al. (2015)," the researchers delve into the intricate dynamics of air quality and aggressive behavior, uncovering a haze of statistical significance in their analysis.
These serious endeavors in the field of environmental criminology provide a solid foundation for our investigation into the connection between air pollution and criminal tendencies. However, as we embark on our own research journey, we cannot ignore the whimsical interplay of pop culture references and fictional narratives that have permeated the public consciousness regarding this enigmatic relationship.
Diving into the literary world, we turn to "Air Pollution and Crime: A Tale of Two Cities" by Bill N. Airy, which, contrary to its title, offers nothing but smoke and mirrors in its attempt to unravel the complex interplay between atmospheric contaminants and illicit activities.
On a more imaginative note, "The Smog of Suspicion" by Penny Plotz presents a fantastical portrayal of a world where air pollution not only clouds the skies but also clouds the judgment of its inhabitants, leading to a surge in devious deeds and dubious behavior.
In a more grounded approach, "The Economics of Criminal Air: A Social Media Analysis" by @CleanAirCriminalAffair dives into the Twitterverse and untangles the web of user-generated content hinting at a clandestine connection between hazy skies and unlawful conduct, with hashtags like #SmoggyMinds and #PollutionPerpetrators gaining traction in the digital sphere.
As we navigate through this labyrinth of literature and online discourse, it becomes clear that the link between air pollution and criminal tendencies is not just a subject for scholarly investigation, but a canvas for artistic expression and social speculation.
Stay tuned for the unexpected twists and turns as we unveil the peculiar relationship between air pollution and criminal tendencies in the idyllic town of St. Marys, Pennsylvania.

[[RESULTS]]
The data analysis unveiled a strong and rather breathtaking correlation coefficient of 0.8527981 between air pollution and violent crime rates in St. Marys, Pennsylvania from 1990 to 2022. It seems that as the air quality plummeted, the town witnessed a surge in criminal activity, giving a whole new meaning to the term "air rage."
The scatterplot (Fig. 1, not to be mistaken for Fig. Newton) graphically depicts this compelling relationship, highlighting the unmistakable upward trend in violent crime as air pollution levels soared. It's almost as if the air pollution was instigating a rebellious streak in the town's inhabitants, prompting them to act out in ways that were nothing short of... breath-taking.
The r-squared value of 0.7272647 further emphasizes the strength of this connection, suggesting that approximately 72.7% of the variation in violent crime rates can be explained by changes in air pollution. It's as if the polluted air was whispering sinister plots into the ears of the town's residents, goading them into engaging in nefarious activities.
But we shouldn't jump to conclusions just yet. While the correlation is robust, it does not imply causation. After all, we don't want to be caught in a statistical haze, mistaking correlation for causation and getting lost in a fog of erroneous assumptions. However, the statistically significant p-value of less than 0.01 gives us confidence that this relationship isn't just a statistical fluke, but a legitimate phenomenon worthy of further investigation.
In essence, the results of this study paint a vivid picture of the entwined dance between polluted air and criminal tendencies, urging us to consider the unforeseen influence of environmental factors on human behavior. Our findings serve as a compelling argument for cleaner air, not just for the sake of the environment, but for the tranquility and safety of our communities. As the saying goes, when it comes to air quality and crime rates, it's not just hot air – it's a matter of criminal significance.

-------

Your response should start like this:

[[DISCUSSION]]



ChatGPT:

[[DISCUSSION]]

The tantalizing relationship between air pollution and violent crime rates in the charming town of St. Marys, Pennsylvania has left us gasping for breath as we dissect the implications of our findings. Our results not only supported prior research, but they also unveiled a temptingly robust correlation coefficient, breathing new life into the age-old mystery of the nexus between environmental factors and criminal behavior.

Our investigation builds upon the edifice of previous studies, echoing the bewitching findings of Smith and Doe (2010) and Jones et al. (2015), and transcending the murky haze of uncertainty that shrouds this area of research. The statistical relationship we unearthed serves as a clarion call to take this issue seriously, while also drawing attention to the whimsical narratives and tongue-in-cheek portrayals of this enigmatic connection that have permeated popular culture and fiction, much like an unexpected plot twist in a novel.

As we gaze upon the scatterplot (resembling a thrilling page-turner) depicting the undeniable ascent of violent crime in tandem with deteriorating air quality, one might be inclined to speculate that the air pollution was perhaps playing the role of a mischievous instigator, nudging the townsfolk toward delinquent deeds – a true "air of mystery," if you will. However, we must tread cautiously and not fall prey to hasty conclusions – after all, correlation does not imply causation, and we certainly don't want to be caught up in a cloud of statistical befuddlement.

Yet, the statistically significant p-value of less than 0.01 serves as a beacon of validation for our findings, indicating that this connection is not a mere statistical fluke but a tangible phenomenon worthy of inquisitive pursuit. It's almost as if our research is peeling back the layers of a suspenseful mystery novel, revealing the concealed link between atmospheric impurities and human behavior, all while sprinkling in a dash of scientific humor and levity.

In closing, the satirical musings and tongue-in-cheek observations infused throughout our exploration of the perplexing relationship between air pollution and criminal inclinations have served to illuminate the intersection of rigorous scientific inquiry and playful imagination. Our findings stimulate contemplation on the unanticipated influence of environmental variables on human conduct, prompting us to seriously consider the implications of our metaphorical "tale of two variables." After all, when it comes to the fusion of air pollution and criminal tendencies, it's not merely a statistical whirlwind – it's a tantalizing saga of scholarly and subtly humorous significance.



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

Please make up a short conclusion of an academic research paper presenting the findings of the connection between Air pollution in St. Marys, Pennsylvania and Violent crime rates. Make lots of jokes, goofy observations, and puns. Sneak in some jokes and clever puns about science, research, statistics, and the variables.

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]]
The Hazy Link Between Air Pollution and Criminal Tendencies: A Case Study in St. Marys, Pennsylvania

[[ABSTRACT]]
The correlation between air pollution and violent crime rates has long been an intriguing enigma for researchers. In this paper, we present the results of our investigation into the potentially suffocating relationship between air pollution and criminal activity, focusing on the town of St. Marys, Pennsylvania. Leveraging data from the Environmental Protection Agency and the FBI Criminal Justice Information Services, we uncovered a remarkably strong correlation coefficient of 0.8527981 with a statistically significant p-value of less than 0.01 for the period spanning 1990 to 2022. Our findings suggest that as the air quality deteriorates, so does the temperament of the residents, triggering an uptick in violent crime. This research sheds light on the unassuming yet potent impact of air pollution on human behavior, making a compelling case for cleaner air and a safer community.

[[INTRDUCTION]]
The notion of a connection between air pollution and criminal behavior may sound like an idea straight out of a cheesy sci-fi movie, but the data suggests there's more to this hypothesis than meets the eye. The mystery of how the air we breathe might influence our inclination towards violent crime has long been a head-scratcher for researchers, leaving us gasping for answers. In this study, we take a deep dive into the murky depths of this concept, focusing our investigation on the charming town of St. Marys, Pennsylvania.
As we venture into this foggy realm of research, it's worth noting that the relationship between air pollution and criminal tendencies is a complex web of variables and confounding factors. We're not just dealing with straightforward cause-and-effect relationships here; we're navigating through a fog of potential correlations, interactions, and lurking lurking lurking omitted-variable biases. It's a statistical labyrinth that could make even the most seasoned data analyst feel like they're walking through a mental haze.
Armed with data from the Environmental Protection Agency and the FBI Criminal Justice Information Services, we set out to unravel this enigmatic tale of tainted air and temperamental behavior. We scrutinized air quality metrics and crime rates from 1990 to 2022, teasing apart the intricate dance between PM2.5 particles and propensity for mischief.
In the face of this complex statistical puzzle, we unearthed a remarkably robust correlation coefficient of 0.8527981, shining a stark light on the relationship between polluted air and propensity for aggressive behavior. The p-value of less than 0.01 further solidifies our findings, signaling that the connection we've uncovered is not just a random fluke, but a statistically meaningful revelation.
In this paper, we will present our findings with a mix of scientific rigor and lighthearted curiosity, shedding light on the unexpected dance between air pollution and criminal tendencies. So buckle up and take a deep breath (preferably in an area with clean air) as we unravel the hazy link between air pollution and criminal inclinations in the charming town of St. Marys, Pennsylvania.

[[RESULTS]]
The data analysis unveiled a strong and rather breathtaking correlation coefficient of 0.8527981 between air pollution and violent crime rates in St. Marys, Pennsylvania from 1990 to 2022. It seems that as the air quality plummeted, the town witnessed a surge in criminal activity, giving a whole new meaning to the term "air rage."
The scatterplot (Fig. 1, not to be mistaken for Fig. Newton) graphically depicts this compelling relationship, highlighting the unmistakable upward trend in violent crime as air pollution levels soared. It's almost as if the air pollution was instigating a rebellious streak in the town's inhabitants, prompting them to act out in ways that were nothing short of... breath-taking.
The r-squared value of 0.7272647 further emphasizes the strength of this connection, suggesting that approximately 72.7% of the variation in violent crime rates can be explained by changes in air pollution. It's as if the polluted air was whispering sinister plots into the ears of the town's residents, goading them into engaging in nefarious activities.
But we shouldn't jump to conclusions just yet. While the correlation is robust, it does not imply causation. After all, we don't want to be caught in a statistical haze, mistaking correlation for causation and getting lost in a fog of erroneous assumptions. However, the statistically significant p-value of less than 0.01 gives us confidence that this relationship isn't just a statistical fluke, but a legitimate phenomenon worthy of further investigation.
In essence, the results of this study paint a vivid picture of the entwined dance between polluted air and criminal tendencies, urging us to consider the unforeseen influence of environmental factors on human behavior. Our findings serve as a compelling argument for cleaner air, not just for the sake of the environment, but for the tranquility and safety of our communities. As the saying goes, when it comes to air quality and crime rates, it's not just hot air – it's a matter of criminal significance.

-------

Your response should start like this:

[[CONCLUSION]]



ChatGPT:

[[CONCLUSION]]

In conclusion, our research has blown away any lingering doubts about the potent relationship between air pollution and criminal tendencies. The results of our study in St. Marys, Pennsylvania leave little room for interpretation – when the air quality goes down, the crime rates go up, creating a real "whodunit" mystery for the town's residents.

The strong correlation coefficient of 0.8527981 we uncovered is nothing to sneeze at – unless it's due to poor air quality, of course. Our findings paint a compelling picture of how the town's atmosphere might have been instigating a rebellious streak, prompting residents to engage in activities that were nothing short of breathtakingly dubious.

However, we must tread carefully through this hazy landscape of statistics and correlations. While we can't definitively say that air pollution causes criminal behavior, our results certainly make a compelling case for cleaner air and more cheerful dispositions.

In the wise words of the iconic statistician, William Edwards Deming, "In God we trust, all others bring data." And boy, did we bring a ton of data – enough to convince even the skeptics that there's more to air pollution than meets the eye.

In the grand scheme of scientific mysteries, our study brings us one step closer to understanding the enigmatic interplay between environmental factors and human inclinations. It's a little bit like unraveling a never-ending statistical riddle wrapped in an enigma and minced with confounding variables. But fear not, fellow researchers, for we are on the right track.

In conclusion, we firmly assert that no more research is needed in this area. The evidence is as clear as the sky on a crisp, pollution-free morning – cleaner air leads to cleaner behavior. So let's breathe easy and embrace the idea that when it comes to air pollution and crime rates, the statistics speak for themselves – no further investigation needed!


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 The Hazy Link Between Air Pollution and Criminal Tendencies: A Case Study in St. Marys, Pennsylvania. Respond only with the name of a fictional academic journal.

ChatGPT:

Journal of Quirky Environmental Psychology


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 The Hazy Link Between Air Pollution and Criminal Tendencies: A Case Study in St. Marys, Pennsylvania. Respond only with the name of a fictional organization.

ChatGPT:

The Society for the Advancement of Unconventional Behavioral Research


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 The Hazy Link Between Air Pollution and Criminal Tendencies: A Case Study in St. Marys, Pennsylvania with an abstract of The correlation between air pollution and violent crime rates has long been an intriguing enigma for researchers. In this paper, we present the results of our investigation into the potentially suffocating relationship between air pollution and criminal activity, focusing on the town of St. Marys, Pennsylvania. Leveraging data from the Environmental Protection Agency and the FBI Criminal Justice Information Services, we uncovered a remarkably strong correlation coefficient of 0.8527981 with a statistically significant p-value of less than 0.01 for the period spanning 1990 to 2022. Our findings suggest that as the air quality deteriorates, so does the temperament of the residents, triggering an uptick in violent crime. This research sheds light on the unassuming yet potent impact of air pollution on human behavior, making a compelling case for cleaner air and a safer community.

ChatGPT:

air pollution, criminal tendencies, violent crime rates, St. Marys Pennsylvania, correlation, environmental protection agency, FBI criminal justice information services, correlation coefficient, statistical significance, human behavior, community safety

*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

Air pollution in St. Marys, Pennsylvania
Detailed data title: Percentage of days with air quality at 'unhealthy for sensitive groups' or worse in St. Marys, PA
Source: Environmental Protection Agency
See what else correlates with Air pollution in St. Marys, Pennsylvania

Violent crime rates
Detailed data title: The violent crime rate per 100,000 residents in United States
Source: FBI Criminal Justice Information Services
See what else correlates with Violent crime rates

Correlation r = 0.8527981 (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.7272647 (Coefficient of determination)
This means 72.7% of the change in the one variable (i.e., Violent crime rates) is predictable based on the change in the other (i.e., Air pollution in St. Marys, Pennsylvania) over the 33 years from 1990 through 2022.

p < 0.01, which is statistically significant(Null hypothesis significance test)
The p-value is 3.0E-10. 0.0000000002958639143556665400
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.85 in 3.0E-8% of random cases. Said differently, if you correlated 3,379,932,298 random variables You don't actually need 3 billion 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 32 degrees of freedom, Degrees of freedom is a measure of how many free components we are testing. In this case it is 32 because we have two variables measured over a period of 33 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.72, 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.
199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022
Air pollution in St. Marys, Pennsylvania (Bad air quality days)0.06603770.09166670.04986150.08536590.04432130.07224330.05288460.03971120.0773810.06060610.03682720.07365440.05898880.01949860.01694920.03197670.01690140.02216070.01453490.002915450.005586590.00279330.01381220.002770080.002747250.002881840.00867052000000.00275482
Violent crime rates (Violent crime)729.6758.2757.7747.1713.6684.5636.6611567.6523506.5504.5494.4475.8463.2469479.3471.8458.6431.9404.5387.1387.8369.1361.6373.7397.5394.9383.4380.8398.5387380.7




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.
  4. Y-axis doesn't start at zero: I truncated the Y-axes of the graph above. I also used a line graph, which makes the visual connection stand out more than it deserves. Nothing against line graphs. They are great at telling a story when you have linear data! But visually it is deceptive because the only data is at the points on the graph, not the lines on the graph. In between each point, the data could have been doing anything. Like going for a random walk by itself!
    Mathematically what I showed is true, but it is intentionally misleading. Below is the same chart but with both Y-axes starting at zero.




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([0.0660377,0.0916667,0.0498615,0.0853659,0.0443213,0.0722433,0.0528846,0.0397112,0.077381,0.0606061,0.0368272,0.0736544,0.0589888,0.0194986,0.0169492,0.0319767,0.0169014,0.0221607,0.0145349,0.00291545,0.00558659,0.0027933,0.0138122,0.00277008,0.00274725,0.00288184,0.00867052,0,0,0,0,0,0.00275482,])
array_2 = np.array([729.6,758.2,757.7,747.1,713.6,684.5,636.6,611,567.6,523,506.5,504.5,494.4,475.8,463.2,469,479.3,471.8,458.6,431.9,404.5,387.1,387.8,369.1,361.6,373.7,397.5,394.9,383.4,380.8,398.5,387,380.7,])
array_1_name = "Air pollution in St. Marys, Pennsylvania"
array_2_name = "Violent crime rates"

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

Thanks for being the explorer we needed!


Correlation ID: 3815 · Black Variable ID: 22251 · Red Variable ID: 20220
about · subscribe · emailme@tylervigen.com · twitter

CC BY 4.0