Predicting potheads? Not the kind you’re thinking…

May 6, 2013
By

(This article was originally published at Data - Ilan Man, and syndicated at StatsBlogs.)

Unless of course you were thinking about this type of pothead. In which case yes, exactly the kind you're thinking. So, how can we predict people who've smoked ganja at least once? While there are probably multiple causes, as is always the case with socio-cultural studies, let's take a look at this from the perspective of academia and higher learning (pun not intended, but very glad it turned out that way). For a recent project I did, I was able to get my hands on a very interesting data set. I'm not at liberty to share it (which makes me feel kind of special in that fleeting sort of way), but it's the survey results of 900 State University students who answered the following questions* (summary stats parenthesized):

  • What is your GPA? (average score - 3.26)
  • How many classes do you skip per week? (average #/week - 0.5)
  • Have you ever had a fake ID? (17%/83% Yes/No)
  • Have you ever cheated on your significant other? (25%/75% Yes/No)
  • Have you ever smoked a cigarette? (11%/89% Yes/No)
  • Have you ever cheated on an exam? (10%/90% Yes/No)
  • And finally, the one we care about (our response variable) - have you ever smoked marijuana? (41%/59% Yes/No)

*To my knowledge, this test was asked anonymously and therefore we can assume that a large majority of students answered honestly. Unless they were super blitzed in which case they might not remember.

What stands out to you? First off, the average GPA is obviously a lie (but that could be a bias of mine, given that mine was below the average). What else is off? 0.5 skips per week also seems low to me. Who the heck are all these people going to so many classes? And why? Anyway... The fake ID stat feels low, although it's almost exactly what a2002 Harvard study found, so at least we know this isn't some biased set of uber keeners. The stat that jumps out at me is the percent of people who have tried marijuana at least once. 41%! Without some perspective, it's hard to make heads or tails of that number, but in relation to the other stats in this sample of students, you'd think less people would have celebrated 420. I guess sometimes the high achievers (see what I did there..) also like to partake in the sacred herb. But enough euphemisms, let's analyze.

So, are good students more likely to smoke the bowl than not? What about those vice-ridden, morally-corrupt individuals who have a fake ID, have cheated on an exam and significant other, all while maintaining a sweet GPA and skipping multiple classes a week (of which there were 3 by the way)?

Let's actually go one step further, and see which of the variables above are more significant in explaining the prevalence of marijuana use than others. Before I present my findings, I want to hear from you guys, my thousands of devotees. From the variables above, which do you think are the strongest and weakest in predicting whether a college-aged student likes to roll the Torah? I'd like to gather some of your opinions, and then compare those against my findings. Let's see how well you guys can predict your potheads.

Thanks...and for your viewing pleasure, another word cloud!

First, let's check out which words Nelson Mandela said the most frequently, in his famous 1964 speech, "I am prepared to die".

mandelaWordCloud

Now, to balance the tone, what was Colbert raving about during his speech at the 2006 presidential correspondents dinner.

colbertWordCloud

And the code (which you can also find on my github):

library(wordcloud) 
library(tm)

## store text file in here
text <- Corpus(DirSource('text/'))

## clean text file
text <- tm_map(text, stripWhitespace)
text <- tm_map(text, tolower)
text <- tm_map(text, removeWords, stopwords('english'))
text <- tm_map(text, stemDocument)
text <- tm_map(text, removePunctuation)
text <- tm_map(text, removeNumbers)

tdm <- TermDocumentMatrix(text)
m <- as.matrix(tdm)
v <- sort(rowSums(m),decreasing=TRUE)
d <- data.frame(word = names(v),freq=v)

## select color palette
pal <- brewer.pal(8,"Blue")
pal <- pal[-(1:4)]

## worldCloud() has a number of optional parameters so you can play around with it
wordcloud(d$word,d$freq,c(7,.3),min.freq=4,max.words=Inf,random.order=FALSE,random.color=FALSE,rot.per=.25,pal,ordered.colors=FALSE,vfont=c("serif","plain"))



Please comment on the article here: Data - Ilan Man

Tags: , ,


Subscribe

Email:

  Subscribe