Blue upon blue

| Gabriel |

On Twitter, Dan Lavoie observed that Democrats got more votes for Congress but Republicans got more seats. One complication is that some states effectively had a Democratic run-off, not a traditional general. It is certainly true that most Californians wanted a Democratic senator, but not 100%, which is what the vote shows as the general was between Harris and Sanchez, both Democrats. That aside though, there’s a more basic issue which is that Democrats are just more geographically concentrated than Republicans.

Very few places with appreciable numbers of people are as Republican as New York or San Francisco are Democratic (ie, about 85%). Among counties with at least 150,000 votes cast, in 2004 only two suburbs of Dallas (Collin County and Denton County) voted over 70%. In 2008 and 2012 only Montgomery County (a Houston suburb) and Utah county (Provo, Utah) were this Republican. By contrast, in 2004 sixteen large counties voted at least 70% Democratic and 25 counties swung deep blue for both of Obama’s elections. A lot of big cities that we think of as Republican are really slightly reddish purple. For instance, in 2004 Harris county (Houston, Texas) went 55% for George W Bush and Dallas was a tie. In 2012 Mitt Romney got 58% in Salt Lake. The suburbs of these places can be pretty red, but as a rule these suburbs are not nearly as red as San Francisco is blue, not very populated, or both.

I think the best way to look at the big picture is to plot the density of Democratic vote shares by county, weighted by county population. Conceptually, this shows you the exposure of voters to red or blue counties.

Update
At Charlie Seguin’s suggestion, I added a dozen lines of code to the end to check the difference between the popular vote and what you’d get if you treated each county as winner-take-all then aggregated up weighted by county size. Doing so it looks like treating counties as winner-take-all gives you a cumulative advantage effect for the popular vote winner. Here’s a table summarizing the Democratic popular vote versus the Democratic vote treating counties as a sort of electoral college.
Popular vote Electoral counties
2004 48.26057 0.4243547
2008 52.96152 0.6004451
2012 51.09047 0.5329050
2016 50.12623 0.5129522

elect.png

setwd('C:/Users/gabri/Dropbox/Documents/codeandculture/blueonblue')
elections <- read.csv('https://raw.githubusercontent.com/helloworlddata/us-presidential-election-county-results/master/data/us-presidential-election-county-results-2004-through-2012.csv')

elect04 <- elections[(elections$year==2004 & elections$vote_total>0),]
elect04$weight <- elect04$vote_total/sum(elect04$vote_total)
dens04 <- density(elect04$pct_dem, weights = elect04$weight)
png(filename="elect04.png", width=600, height=600)
plot(dens04, main='2004 Democratic vote, weighted by population', ylab = 'Density, weighted by county population', xlab = "Democratic share of vote")
dev.off()

elect08 <- elections[(elections$year==2008 & elections$vote_total>0),]
elect08$weight <- elect08$vote_total/sum(elect08$vote_total)
dens08 <- density(elect08$pct_dem, weights = elect08$weight)
png(filename="elect08.png", width=600, height=600)
plot(dens08, main='2008 Democratic vote, weighted by population', ylab = 'Density, weighted by county population', xlab = "Democratic share of vote")
dev.off()

elect12 <- elections[(elections$year==2012 & elections$vote_total>0),]
elect12$weight <- elect12$vote_total/sum(elect12$vote_total)
dens12 <- density(elect12$pct_dem, weights = elect12$weight)
png(filename="elect12.png", width=600, height=600)
plot(dens12, main='2012 Democratic vote, weighted by population', ylab = 'Density, weighted by county population', xlab = "Democratic share of vote")
dev.off()

county <- read.csv('http://www-personal.umich.edu/~mejn/election/2016/countyresults.csv')
county$sumvotes <- county$TRUMP+county$CLINTON
county$clintonshare <- county$CLINTON / (county$TRUMP+county$CLINTON)
county$weight <- county$sumvotes / sum(county$sumvotes)
dens16 <- density(county$clintonshare, weights = county$weight)
png(filename = "elect16.png", width=600, height=600)
plot(dens16, main='2016 Democratic vote, weighted by population', ylab = 'Density, weighted by county population', xlab = "Democratic share of vote")
dev.off()

png(filename = "elect.png", width=600, height=600)
plot(dens04, main='Democratic vote, weighted by population', ylab = 'Density, weighted by county population', xlab = "Democratic share of vote", col=)
lines(dens08)
lines(dens12)
lines(dens16)
dev.off()


m <- matrix(1:8,ncol=2,byrow = TRUE)
colnames(m) <- c("Popular vote","Electoral counties")
rownames(m) <- c("2004","2008","2012","2016")
m[1,1] <- weighted.mean(elect04$pct_dem,elect04$weight)
m[1,2] <- weighted.mean(as.numeric(elect04$bluecounty),elect04$weight)
m[2,1] <- weighted.mean(elect08$pct_dem,elect08$weight)
m[2,2] <- weighted.mean(as.numeric(elect08$bluecounty),elect08$weight)
m[3,1] <- weighted.mean(elect12$pct_dem,elect12$weight)
m[3,2] <- weighted.mean(as.numeric(elect12$bluecounty),elect12$weight)
m[4,1] <- weighted.mean(elect16$pct_dem,elect16$weight)
m[4,2] <- weighted.mean(as.numeric(elect16$bluecounty),elect16$weight)
m

 

Advertisements

November 9, 2017 at 11:24 am Leave a comment

Strange Things Are Afoot at the IMDb

| Gabriel |

I was helping a friend check something on IMDb for a paper and so we went to the URL that gives you the raw data. We found it’s in a completely different format than it was last time I checked, about a year ago.

The old data will be available until November 2017. I suggest you grab a complete copy while you still can.

Good news: The data is in a much simpler format, being six wide tables that are tab-separated row/column text files. You’ll no longer need my Perl scripts to convert them from a few dozen files that are a weird mish mash of field-tagged format and the weirdest tab-delimited text you’ve ever seen. Good riddance.

Bad news: It’s hard to use. S3 is designed for developers not end users. You could download the old version with Chrome or “curl” from the command line. The new version requires you to create an S3 account and as best I can tell, there’s no way to just use the S3 web interface to get it. There is sample Java code, but it requires supplying your account credentials which gives me cold sweat flashbacks to when Twitter changed its API and my R scrape broke. Anyway, bottom line being you’ll probably need IT to help you with this.

Really bad news: A lot of the files are gone. There’s no country by country release dates, no box offices, no plot keywords, there are only up to three genres, no distributor or production company, etc. These are all things I’ve used in publications.

September 8, 2017 at 2:29 pm 3 comments

The more things change

| Gabriel |

I just listened to a podcast conversation [transcript / audio] between Tyler Cowen and Ben Sasse and very much enjoyed it but was bothered by one of the senator’s laugh lines, “Turned out sex was really similar in most centuries.”* Now in a sense this is obviously true since any culture in which sex lost a certain aspect would only last one generation, and indeed this has happened. But there is still a lot of variation within the scope condition that in pretty much all times and places, sex is procreative at least some of the time. What kinds of sex one has varies enormously over time, as does with what kinds of and how many people. We can see this over big periods of history and within living memory in our own culture. My discussion will be necessarily detailed, but not prurient.

Dover’s Greek Homosexuality uses detailed interpretation of comedies, legal speeches, pornographic pottery, and similar sources to provide a thorough picture of sexuality in 4th and 5th c BCE Greece, especially among Athenian upper class men, but not limited just to the idiosyncratic and often idealized views of philosophers. There were two big differences with our culture, the most obvious being that with whom you had sex varied over the life course and the less obvious but equally important one being that what role you played was equally important as with whom you played it. An aristocratic Athenian male would typically be an eromenos (“beloved” or passive homosexual) in his late teens and when he reached full maturity would be an erastes (“lover” or active homosexual) but also get married to a woman. As long as you stuck to this life course trajectory, no money changed hands, and the eromenos had love but not lust for his erastes, the relationship was honorable. However for someone to remain an eromenos into full maturity was scandalous and bearded men who continued to accept passive sexual roles were stigmatized. Interestingly, what exactly is the action that occurs between active and passive varies enormously based on source, with philosophers downplaying sex entirely, pornographic pottery suggesting intercrural sex, and Aristophanes joking about anal intercourse (e.g., the best food for a dung beetle).

One thing the sources seem to agree on is that fellatio generally did not occur among Greek men. Dover argues that the avoidance of fellatio, avoidance of prostitution, and age separation of partners all served the purpose of avoiding hubris (assault that degrades status) otherwise implied by one male citizen penetrating another. Generally, our culture’s ubiquity of fellatio, and especially our common assumption that it is less intimate than vaginal intercourse, is exceptional across cultures. This is not only an issue of Greece, fellatio was exceptionally rare in 18th c elite French prostitution (although anal sex was common) and in early 20th c New York city. Interestingly, Dover notes that the women of Lesbos were legendary in Greek culture for heterosexual fellatio. While our culture derives our word for gay women from that island, largely through it being the home of Sappho, the cultural meaning in antiquity was of fellatrix, though the two meanings made sense in the Greek mind as relating to women who were especially open to sex of many varieties. This sounds bizarre to us, but as I’ll describe in a bit, this reflects emerging practice in our own culture.

For changes in recent decades, we do not need to rely on measuring the angles of penetration depicted on a kylix or on epithets in old comedy but can go by systematic survey data.** The main finding of Laumann et al’s 1994 Sex in America study was that sex was much more focused on monogamy, marriage, and vaginal intercourse than anyone expected based on Kinsey (who relied on convenience sampling) or popular culture. However things have changed a lot in the last two decades and in ways much more profound than that my undergrads don’t like rock music. The National Survey of Family Growth 2002-2013 replicates most of the research questions of Laumann et al and found that sex had gotten much more complicated since the early 1990s.  One major finding is a substantial rise in same sex intercourse. Women born from 1966-1974 are half as likely to have had same sex intercourse as women born from 1985-1995. In contrast to ancient Athens, this rise in same sex intercourse is limited to women (and the base rate is much higher), but as in ancient Greece, it is mostly an issue of youthful experimentation that is complementary to heterosexual practice and on the margin women self-identify as straight or bi, not lesbian. Chandra et al’s analysis of the same data showed a corollary that echos ancient stereotypes of Lesbians, which is that female experience with same sex partners is positively correlated with lifetime number of male partners. In addition, Chandra et al found that heterosexual anal intercourse is rising substantially, with about 30% of women aged 18-44 in 2002 having experienced it, or almost double what Laumann et al found twenty years earlier. This likely reflects influence from pornography, as does the almost universal (~85%) adoption of pubic grooming among women under thirty. However, again, this reflects ancient trends as ancient Greek women would singe off pubic hair and indeed the punishment for a male adulterer was to be symbolically feminized through pubic depilation and penetration with a radish.

* Sasse elaborated that he meant that in all times and places sex serves a mix of recreation, procreation, and pair-bonding and I think he’s right about that.

** I am not relying on pornography production or usage data as I strongly suspect that pornography follows a zero-inflated over-dispersed count distribution and thus consumption data, especially that showing that pornography is increasingly bizarre, is mostly informative about a relatively small minority of intensive users.

July 3, 2017 at 10:38 am 11 comments

Medicaid and mortality

| Gabriel |

This morning Spotted Toad picked up on the point in Quinones that a lot of pill mills were funded through Medicaid fraud and so he used Medicaid expansion under Obamacare to see if this led to greater drug overdoses in Medicaid expansion states. In fact he found that in the time since the Medicaid expansion, states that participated in the expansion had faster growth in overdose deaths than states that refused Medicaid expansion. That’s interesting, but I never want to base a trend on just two time points. (FWIW, Toad was analyzing the data as the CDC presents it — the analysis below requires a lot more queries). So I queried the CDC data in more granular detail to check if the trend started with Medicaid expansion. (saved query link, just iterate over year to get annual state-level OD deaths).

As it turns out, I was able to replicate Toad’s finding that Medicaid expansion states (blue) have higher rates and faster growth in fatal drug overdoses than Medicaid holdout states (red), but the two groups of states diverged starting in 2010, well before states began implementing Obamacare’s Medicaid expansion. So there may be a real difference between Medicaid expansion states (which are generally Democratic) and Medicaid holdout states (which are Republican), and the difference may even be some aspect of health policy, but it wasn’t Obamacare Medicaid expansion as the divergence starts too early. (It’s worth noting that Toad updated his own post with my graph as soon as I sent it to him).

medicaidod

Here is the data in Stata format (which you can reconstruct yourself from a series of CDC queries).

Here is the code

cd "~/Documents/codeandculture/cdcdrugmortality"
*https://wonder.cdc.gov/controller/saved/D76/D11F702


clear
gen state=""
gen year=.
save drugs19992015.dta, replace

forvalues i=1999/2015 {
 disp "`i'"
 insheet using drugs`i'.txt, clear
 append using drugs19992015.dta, force
 recode year .=`i'
 save drugs19992015, replace
}
drop if state==""

desc
sum

insheet using medicaidholdouts.txt, clear
ren v1 state
save medicaidholdouts.dta, replace

use medicaidholdouts, clear
merge 1:m state using drugs19992015
ren _merge medicaidexpansion 
recode medicaidexpansion 2=1 3=0

list state medicaidexpansion if (state=="Texas" | state=="California") & year==2010

save drugs19992015, replace

collapse (sum)deaths population, by (year medicaidexpansion)
gen cruderate= deaths/population
twoway (line cruderate year if medicaidexpansion==1) (line cruderate year if medicaidexpansion==0) , legend(order(1 "Medicaid expansion" 2 "Holdouts")) ytitle(Weighted Crude Rate of Fatal Drug Overdoses)
graph export medicaidod.png, replace

*have a nice day

And here’s my list of Medicaid holdouts:

Alabama
Florida
Georgia
Idaho
Kansas
Mississippi
Missouri
Nebraska
North Carolina
Oklahoma
South Carolina
South Dakota
Tennessee
Texas
Utah
Virginia
Wisconsin
Wyoming

 

March 21, 2017 at 9:16 pm 3 comments

They Meant Us No Harm, But Only Gave Us the Lotus

| Gabriel |

After hearing Sam Quinones on EconTalk, I finally stopped procrastinating and read Dreamland. It only took a few days over which every other activity was a distraction from finishing the book. Dreamland provides a unified story of the opiate epidemic starting in the late 1990s with both the overall social trend and close-ups on the lives of dealers, addicts, doctors, cops, epidemiologists, and mourners. I’ve watched every episode of Justified and read Case and Deaton PNAS 2015, so I was not surprised by the broad argument of the book that a shift in medicine towards prescribing opiates created ubiquitous chemical dependence that was eventually met by black tar heroin, all of which disproportionately affected rust belt white people. What made the book amazing to me even knowing the broad contours of the social facts it describes was how every detail of the book illustrated and illuminated another aspect of sociology. As I remarked on Twitter, my discipline could very well treat Dreamland the same way political scientists treat History of the Peloponnesian War.

In no particular order, here are a few of the themes I noticed.

The dealers who come up from Xalisco, Nayarit to live for a few months in spartan conditions working long hours driving around with balloons of dope in their mouths are motivated by relative deprivation. As more and more dealer-migrants return to Xalisco flush with cash this creates a new standard of living in the village and transforms being an impoverished sugar cane farmer from just how life goes to a status that can be rejected. But relative deprivation is too weak to explain Xalisco life, which is better characterized as competitive feasting straight out of Mauss’s The Gift. Xalisco-style potlatch can occur whenever a migrant returns with suitcases full of Levis 501s to disburse to a receiving line of supplicants, but is especially centered on the corn festival, where migrants would compete by sponsoring banda performances (104). Interestingly, while dealers often planned to save enough wages to capitalize a small business, they tended to dissipate their wealth in gifts to family and “the rest on beer, strip clubs, and cocaine, and walked the streets of Xalisco for a week or two the object of other men’s envy” (261). This envy is something Quinones emphasizes repeatedly and the way it is formed by public feasting and is sublimated into a need to reciprocate so as to restore honor, which in turn creates the labor supply for black tar heroin retailing as men seek another bundle of cash through which to engage in such honorable public profligacy.

Social capital also plays a strong role in explaining how Xalisco drug crews operated, which was distinct from most drug dealers. Notwithstanding a handful of murders in the book, Xalisco dealers generally eschewed violence and never carry guns. Competing heroin crews had an approach of friendly competition rather than violent turf wars over territory. Quinones attributes this partly to their “pizza delivery” business model as compared to traditional corner slinging, but mostly to the thick interconnected ties based in a small rancho back home where everybody knows everybody. Another distinctive aspect of the Xalisco boys business model is that dealers earn a salary, whereas typically drugs are sold on commission. This would normally present a principle-agent problem, but it was not an issue for Xalisco dealers. Crew bosses did engage in monitoring  through calling junkies to confirm that their dealers were prompt, polite, and the heroin was of high quality, but these monitoring costs were feasible because of the high level of trust. Crew bosses basically trusted their dealers because they weren’t junkies (Xalisco boys consider heroin disgusting) and they had thick communal ties from the rancho. This is the positive aspect of social capital, but there is also a negative sense of social capital in that men were pushed into drug dealing and returning to drug dealing by the insatiable demands to support relatives. That’s all supply side, but social capital also characterizes Quinones’s understanding of the demand side, though in a sense closer to Putnam than Portes, in blaming the rise of opiates on the collapse of community. In this aspect of the story Quinones is a staunch communitarian moralist, which didn’t bother me as I’m a communitarian moralist too, but YMMV and blaming opiates on the collapse of community was the only argument in the book that was more tell than show.

On the prescription opiates side, Quinones tells the story of how medicine lost its traditional reluctance to prescribe opiates in the pain revolution and particularly the key role played by Porter and Jick NEJM (1980). The article itself is a one paragraph letter noting that in-patients treated with opiates rarely became addicted. The role of this brief letter in the pain revolution is instructive for scientific epistemology. In terms of scientific epistemology it provides a valuable cautionary tale for the problem of generalizing beyond the scope of the data. The finding showed that in-patients receiving very conservative doses of opiates rarely became addicted but this was interpreted as it being completely safe to provide out-patients with liberal supplies of opiates. In Quinones’s telling, the article is something of a Sleeping Beauty citation, taking off after it was cited in a 1986 Pain article by Foley and Portenoy. However a Google Scholar search shows that the article began getting cited almost immediately (the earliest citation is from 1982 in a nursing journal). Nonetheless the story of how a brief publication summarizing a single database query was interpreted well beyond its original scope conditions to justify risky changes to medical practice can provide grist for the mill of historians and sociologists of science. A key part of the story as to why people cited this tiny publication is because they wanted to believe it as it created a permission structure for prescribing effective but dangerous drugs and pharmaceutical detailing exploited this by promoting Porter and Jick, or even just the black-boxed factoid of “1% addiction rate” to physicians.

A few other themes I noticed:

  • pharmaceutical detailing in opiates, as in all drugs, follows my model of obfuscated transactionalism and Quinones has a lot of material on the history of detailing
  • the submerged state gives Medicaid rather than cash transfers and a lot of diverted opiates came from pill mills paid for through Medicaid fraud
  • Xalisco boys engage in statistical discrimination by only selling to white customers who they see as less likely to rob them than black customers
  • chain migration characterizes some aspects of Xalisco boy migration, but they also are entrepreneurial in relying on junkies as scouts to explore new markets, including ones with no history of Nayarit migrants
  • doctors prescribed opiates in part to get patients out of their offices quickly and prescribed 30 day packs of pills rather than 3 day packs of pills to avoid return visits. Proper pain management is extremely labor intensive, but hard to get insurance reimbursement. This follows logically from Baumol’s disease in that as high-skilled medical labor grows more expensive, insurance companies will substitute capital (drugs).
  • reactivity is everywhere. Pain is part of doctor and hospital ratings, but iatrogenic addiction is not so doctors prescribe dope. Sentencing is based on large quantities of dope and carrying a gun so Xalisco boys carry only small quantities of dope and go unarmed.

 

And oh yeah, there’s also some stuff in the book about how this is an enormous social and public health epidemic, killing tens of thousands of Americans a year and stealing the souls of many more — debasing them into the kind of people who steal their children’s Christmas presents to trade for pills. But I’d rather focus on how it provides material for developing theory because I prefer to be fascinated than livid and that attitude is how I made it all the way through the book only breaking down in tears once.

January 27, 2017 at 9:55 am 1 comment

Obfuscated Transactionalism at Cato Unbound

| Gabriel |

From my lead essay at Cato Unbound:

And so we modern people take for granted that we both produce and consume through markets. The idea that we might acquire groceries because the butcher, the baker, and the brewer owe us favors rather than because we hand them cash or a Visa card seems primitive. Nonetheless, there are circumstances where we modern westerners consider prestations more appropriate than purchases. This preference extends well beyond obvious matters of intimacy like sex and Christmas presents and even reaches into business interactions.

Responses from Mike Munger, Alan Fiske, and Alex Tabarrok to follow.

June 6, 2016 at 9:05 am

Ruby Slippers

| Gabriel |

giantbattery

Rod Dreher at The American Conservative has a post on people invoking the concept of “social construction” with his lead example being a speech and debate team that always changes the subject to a critical race theory rant about the conventions of debate itself, even if the pre-specified debate topic is about national service or green energy or whatever. The judge then awards the match to this non sequitur, invoking “social constructionism” to explain himself.

I can get angry about this on a whole other level than Dreher does, precisely because I think social construction is a valuable concept. And I really do take the concept seriously. My PhD training is as a neo-institutionalist (ie, how organizational practices are socially constructed), I have an ASR on market information regimes (ie, how socially constructed market data shapes market behavior), and my current project is on relational work (ie, how exchange is socially constructed as market or social). I also advise grad students on these sorts of topics. So it’s not like I’m some angry epistemological realist who goes around giving swirlies to phenomenologists.

Social construction is a really useful concept, but unfortunately, this really important concept has the misfortune of being popular with idiots who don’t really understand it. When this sort of person says “x is socially constructed” the implication is “therefore we can ignore x.” When I lecture on social constructionism I ridicule this sort of thing as “ruby slippers” social constructionism, as if your sociology professor tells you “why Dorothy, you’ve had the power to solve inequality all along, just click your heels three times and say ‘race is a social construct,’ ‘race is a social construct,’ ‘race is a social construct.'” If you really grok social constructionism, the appropriate reaction to somebody invoking the concept in almost any practical context is to shrug and say “your point being?” If you actually read Berger and Luckmann rather than just get the gist of it from some guy with whom you are smoking weed, you’ll see that the key aspects of social constructionism are intersubjectivity and institutions. That is social construction is important because social interaction is premised on shared conventions and becomes deeply codified to the extent that for most purposes it might as well be objective.

Suppose you had two contractors bidding on remodeling your kitchen. One of them says that it will be done in X days, involving Y materials, and cost you $Z. The other gives you a fascinating (but at times dubious) lecture about whether time exists in the abstract or only relative to perception, the ugly history of exploitation in the formica industry, and the chartalist theory of money. You then go back to the first contractor, who is bewildered and has no rebuttal to the second contractor’s very, um, creative arguments. You would have to be an idiot to award the bid to the second contractor, even if you think they are right about everything they said. As it happens, I actually believe that time, kitchen materials, and money are all socially constructed. It is also true that kitchen remodeling is also a social construct and one of the conventions of that particular social construct is that you talk about things like time, material, and price rather than offer a critical perspective on the same.

March 18, 2016 at 8:03 pm 6 comments

Older Posts


The Culture Geeks