Monday 25 July 2016

When do people have sex?


I’ve been offline for a couple of months due to a string of writing-unfriendly rotations. Months of emergency medicine, internal medicine, and obstetrics has an uncanny ability to destroy all vestiges of a life outside of medicine. I ended on obstetrics, and there’s nothing that I want to do less than write a blog after handling a screaming, poop-covered baby that has passed through a screaming, poop-covered woman. And then I got lazy. If I’m being honest, this last reason accounts for the majority of eight months of radio silence.

I’m venturing forth onto a pediatrics rotation and will be dealing with cantankerous, non-verbal, tiny animals for a month. Today I got urinated on, and it was only day one. So this post is going to examine when people make the mistake of making these little monsters. What are the daily and weekly patterns for getting down and dirty - when are people having sex?

People can be a little leery of researchers who ask them about their sex life. Data is scarce and probably pretty unreliable, especially when it comes to surveys on this subject because people get creeped out when people ask them about their sex life. But luckily everyone is on the internet these days and the internet doesn’t lie. If you remember that bit of wisdom from legendary American Senator and angry old codger Ted Stevens, the internet “is not a big truck, it’s a series of tubes”. All of these tubes lead to Google. 

Analysis of Google data is a big business, mostly for Google, who uses your search patterns to show you ads for whatever it thinks you might buy. Nobody embodies the ethos that “if you’re not paying for the product then you are the product” better than Google. So remember that the next time you’re searching for whatever weird stuff you may search for in the comfort of your own home. Google is watching, and waiting to sell you shovels or lawn darts or a guided tour of a cheese factory. They know your deepest darkest secrets. 

But because Google likes to think of itself as a benevolent tech version of Big Brother, it also likes to sometimes make its search data available to the researchers who live in its Oceania. Economists have used this data to see the effect of racism on the election of Barack Obama: in the surprise academic result of the century, it lost him votes. They have also used it to show that economic recessions increase child abuse – a result that was actually a little more surprising because survey data had previously shown the opposite. Another paper that used Google data showed the effect of MTV’s show 16 and pregnant on teenage pregnancy rates, which was to decrease teenage pregnancy. All of these papers have been published in top-notch economics journals including the American Economic Review, which is a journal that most economists would literally give some of their fingers to get published in. 

More pertinent to this blog though is the field of “now-casting” using Google data. It's an effective real-time tool that can be used to answer questions about the world today. Google search data has been used to track the daily ebb and flow of stock prices. It has been used to predict when influenza outbreaks might happen (i.e., when people search for “do I have the flu?” more often). And I’m going to use it to show when people are knocking boots in Ontario.

So for this blog I use open-source Google Trends data. It's free and easy to download, but the nature of the data obscures interpretation. This is because of the way that Google formats its data. For a particular time frame and place, Google constructs an index for a group of search terms. The top-searched term in the time frame receives a score of 100. A term that receives half of the number of search queries of that top ranked term receives a score of 50, and so on. Because this scale is relative, we can only make relative inferences, not cardinal ones. 

For this post, I use two data periods for a set of Google Trends search queries made in the province of Ontario. The first data period encompasses a 90-day run from April 25, 2016 to July 22, 2016. The second data period encompasses hourly search data over the last week. How can we use Google search data to learn about the timing of bonking in Ontario? Again, it's unfortunately not as simple as asking Google trends to return the search volumes for when people search for “sex”. When you have to search for the term “sex” on Google, you probably aren’t getting any. But what people might search for are the complementary goods necessary to have sex. When you buy hot dogs, you need the buns. When you go dirty dancing, you need the birth control. 

So if people need birth control for sex, how can we use this to determine the timing of sex? To do this, we need the types of birth control that people are searching to buy around the time of doing the deed. Birth control that you might need before doing the deed is a condom. Birth control that you might need after doing the deed is plan b.

Stepping back a little here, what is the logic behind using Google Search data to “now-cast” aggressive cuddling? People search things when they are about to get intimate. For example, many people use condoms when they bump uglies. Sometimes this is a last-minute thing, so when people have more sex, they use Google to search the closest source of condoms. So while there should be some baseline search volume for condoms, when these search volumes go up, we can make an argument that the rates of sweeping the chimney goes up as well. The same goes for plan b. Because of this, the search volumes for these two complementary goods should nicely bookend when people are organ grinding.

So without any further titillation, this is the long-run time series for the search terms “condom” and “plan b” in Ontario.




Long-run search volumes for "condom" and "plan b" in Ontario cycle together, and they cycle on a weekly basis. Notably, the peak search for "condom" was on May 8, 2016, or Mothers Day. Mothers everywhere in Ontario received more than just breakfast in bed that day. The peak in search volumes for "plan b" during this period occurred on July 16, the date of a large Guns-n-Roses concert at the Rogers Centre (you may think that this is a completely spurious correlation but two out of the top seven Google trends searches in Canada that day had to do with Guns-N-Roses). I had thought that taking a date to see Axl Rose screech at you was the greatest form of birth control, but I stand corrected.

Since this data cycles so regularly, looking into the weekly data also reveals the day of the week people may be getting busy. The cycleplot groups the search volumes by each day of the week over the 90 day period observed. So for example, when looking at the x-axis in the following graph, all of the search volumes on Sundays are grouped together so that they can be compared to other days of the week. For simplicity, I have only included searches for "condoms" but the cycleplot looks similar for "plan b".


Over the 90-day stretch, search volumes for the term "condoms" peak on Sunday, then decrease throughout the middle of the week. The nadir is on Wednesday and search volumes begin to increase as the weekend begins. Not surprisingly, people most often engage in a little slap and tickle over the weekend. But the fact that this peak in nocturnal activity occurs on Sunday rather than Friday or Saturday is interesting. Date nights are supposed to be Friday and Saturday, so why are we seeing spikes in search volumes on Sundays? Looking at the hourly data explains this anomaly. 

The short-term Ontario time-series for search volumes of "condom" and "plan b" are shown below. Again, there is a significant amount of cycling in this data, with peaks occurring in the very early mornings. This explains the high search volumes for birth control on Sundays - people have their dates on Saturday night and the party continues into the early morning of Sunday.


Hourly cycleplots confirm that Google searches for birth control occur after midnight. The peak in "condom" searches peaks at about 2AM. It decreases steadily until about 4AM and then is stable. It then rises again as the day approaches 11PM.


Searches for "plan b" follow similar dynamics throughout the day, but the peak in search volumes is displaced a little bit later. Peak search time for "plan b" occurs at about 3-4AM. Searches collapse past that point and don't begin to rise again until about midnight.


Again, it's notable that the rise in searches for "plan b" seems to follow the rise in searches for "condoms" just as one would expect if some afternoon delight happened in between. This data would then suggest that the peak time for assault with a friendly weapon occurs between 2AM and 3AM in Ontario.

A couple things: this data suffers from some obvious limitations. First, you need an internet connection, which might skew the demographics towards younger people. Moreover, you might expect that this specific identification strategy only catches those people who are unprepared for laying pipe. This is a big limitation, as people who are unprepared may be late to the party and so the pants-off dance-off that we observe in the data might be happening later than when the average person might normally engage in rolling in the hay. Condoms and plan b are also goods that might be exclusive to certain types of sex and certain types of sexual partners. Nevertheless I think that it's pretty neat that we could even pick out this biased relationship from Google trends.

I'll leave you with what is probably the most important thing to take from this post. I was able to fit over 20 euphemisms for sex into a 1700-word post. If that's not a successful blog, I don't know what is.