Where are all the single men?

According to an interactive map from Jonathan Soma, they’re everywhere.

Single men outnumber single women across the country up until age 35.

20-34-relative

 

From age 35 onward, the balance starts shifting toward more single women until about age 50, where single women strongly outnumber the men.

50-59-relative

Play around with the interactive version here and see for yourself. You can adjust the slider to change the age range.

Note: From what I can tell ‘single’ here means ‘never been married’, rather than ‘not currently in a relationship’.

Crying

Robin Weis, the same girl who brought us 8 years of dating data, tracked her crying patterns for 589 days, rating them on a scale from ‘a tear or two’ to ‘I am a crumpled pile of flesh’. She cried on 216 of those days. And I thought cried a lot.

 Number of Cries Per Day

cry3

She categorized each cry into 8 general categories, shown in the graph below. The mound of purple life-related cries on the left side was largely during a 10 week trip to Europe. A large proportion of her cries were breakup and relationship related, which included finding out her boyfriend was married. Yep, that’s bound to cause some tears. Check out her full post here.

Categories of Cries Over Time

cry14

What I’ve found interesting

  • Relationships and breakups appear to cause a lot of negative emotions. It’d be interesting to see what a graph of positive emotions due to relationships would look like, though that would be harder to quantify. Crying generally has an obvious beginning and end, but how would you track your start of happy feelings and end of happy feelings as precisely?
  • Is travel-crying a thing? Robin mentions that almost 20% of her crying occurred while she was traveling solo. I had a similar experience recently when I was in South America. It can be particularly uncomfortable if you’re staying in a hostel and there’s nowhere private where you can just go and cry. Has anyone else experienced this?

As I’m taking my first steps into the world of online dating (I just signed up to OKCupid for the first time) it can be a little scary seeing the amount of angst relationships can cause. Might I be more comfortable staying safely single?

I hate to be yet another blog that touts the benefits of travel, but my experience with travel is relevant here. Even though I spent a lot of time being unhappy while traveling, overall it was a rewarding experience that enhanced my life and I’d do it again. As for dating, it’s a risk I’m willing to take.

 

Calculate Your Dating Age Range

Inspired by this xkcd comic, I built an interactive graph and calculator. You can use it to test whether your current relationship is socially acceptable or to calculate what age is too young or too old for you to date. (It might take a few seconds to load.)

dating age range graph sliders

The Equations

For the occasions when you need to quickly calculate whether pursuing a person of a particular age would be objectionable, here are the formulas:

Dating range calculations

So according to this, I could date a guy between the ages of 21 and 42. Personally, it’s wider than I’d probably date. My preferred minimum would be around 25 and maximum around 38, but for a rule of thumb, the calculations don’t seem too far off.

However, the older we get, the calculations start getting outrageous: A 51 year old can date an 88 year old? At 60 you can date anyone between the age of 37 and 106?  Something seems off.

How well do the formulas work?

Lucky for us, Psychology Today investigated this question by studying whether these formulas reflect people’s real preferences.

Here’s a summary of their findings:

  • Men’s preferred minimum age for a partner is close to the formula’s minimum.
  • Both sexes’ preferred maximum age is much younger than what the formula calculates.
  • Women’s preferred minimum acceptable age is older than what the formula calculates.
  • The younger you are, the more accurate the calculations.

You can read more here.

Now, who will create a more accurate calculation?

The Code

For anyone interested in learning how I built this app, here’s the code. If you know R, Shiny apps are surprisingly easy to create. Check out the tutorials at shiny.rstudio.com.

# range.R

# Calculate dating range and create text

range <- function(age){
 
     max_age <- function(x) 2*x - 14
     min_age <- function(x) .5*x + 7
 
     youngest <- min_age(age)
     oldest <- max_age(age)
 
     paste("You can safely date someone between the ages of ", 
          floor(youngest), " and ", floor(oldest), 
          ".", sep = "" )

}


# plot.R

age_plot <- function(){
     
     #set equations for lines
     top <- function(x) 2*x - 14
     bottom <- function(x) .5*x + 7
 
     #set the shading color
     color = rgb(232, 240, 237, max = 255, alpha = 225)
 
     # graph top line and titles
     curve(top, xlim = c(18,100), ylim = c(18,100),
          xlab = "your age", ylab = "your partner's age", 
          main = "Socially Acceptable Dating Range",
          col = color)
 
     # fill between lines
     top.x <- seq(0,110,.01)
     bottom.x <- seq(0,110,.01)
     top.y <- top(top.x)
     bottom.y <- bottom(bottom.x)
     x <- c(bottom.x, rev(top.x))
     y <- c(bottom.y, rev(top.y))
 
     polygon(x, y, col = color, border = color)
 
     # graph bottom line to add border again 
     # (there must be a better way!)
     par(new=TRUE)
     curve(bottom, xlim = c(18,100), ylim = c(18,100),
          xlab = "", ylab = "", col = color)
 
     # add legend
     legend(23,90, legend = "Acceptable" , 
          cex = .9, pch = 15, bty = "n", 
          col = color, pt.cex = 2)
}



# ui.R age_range

library(shiny)

shinyUI(fluidPage(

   # Sidebar with a slider input for each age
   sidebarLayout(
     sidebarPanel(
 
          br(),
          sliderInput("your_age",
               "Select your age:", min = 18,
               max = 100, value = 40
          ),
          br(),
          sliderInput("partners_age",
               "Select your partner's age:", min = 18,
               max = 100, value = 40
          ),
          br(),
 
          # Display the text
          strong("Acceptable Dating Range:"),
          textOutput("text1"),
          br()
     ),
 
     # Display the Acceptable Age Range Graph
     mainPanel(
          br(),
          plotOutput("plot")
     )
 )
))

# server.R Age Range Graph

library(shiny)
source("plot.R")
source("range.R")

shinyServer(function(input, output) {
 
 
     output$plot <- renderPlot({
 
          age_plot()
 
          # graph data point, using input from sliders
          points(input$your_age, input$partners_age, pch=20)
 
     })
 
     # Create text using input from your_age slider
     output$text1 <- renderText({
          range(input$your_age)
 
     })
})

 

If only love were so simple

In case you’ve ever wondered how to graph a heart in R, I’ve figured it out for you. No need to thank me. Pink Heart Graph R

Maybe it could be featured on a nerdy valentine?

The Equations

Heart Graph Equations

 

 

 

 

 

The R Code

###Filled Heart
##Plot the top
  top <- function(x) (1-(abs(x)-1)^2)^.5
  pink <- rgb(201, 6, 45, max = 255)   #set color
  plot(top, xlim=c(-2,2), ylim=c(-3,1),
   ylab="y", col=pink, main="Heart")
##Plot the v
  par(new=TRUE) 
  v <- function(x) -3*(1-(abs(x)/2)^.5)^.5 
  plot(v, xlim=c(-2,2), ylim=c(-3,1),
    ylab="y", col=pink)
##Fill the Graph
  top.x <- seq(-2,2, .01)   #x coordinates for top
  v.x <- seq(-2,2, .01)     #x coordinates for v 
  top.y <- top(v.x)        #y coordinates for top
  v.y <- v(v.x)            #y coordinates for v
  x <- c(v.x, rev(top.x))    #put the coordinates together
  y <- c(v.y, rev(top.y))
  polygon(x, y, col=pink, border=pink)