Hexagonal statebins, or hive-like maps

I was excited to see a hexagonal statebin map on an NPR politics article this week. It reminded me of my exploration of statebins back in March, though obviously I wasn't trying to predict any elections. Remember that basic statebins may look like this:

statebins_ex.jpeg

(There's no meaning to this data - it's just an example.)

The author of the R statebins package made a short walkthrough last year about how to make a hexagonal version. It requires some geometry and geography-specific packages - I ran into some configuration issues with those and couldn't replicate the results - but the provided results look nice. (Potentially related: a hexagonal heatmap.

NPR sure seems to like hexagonal state maps. Someone was apparently inspired by that post and made a straightforward implementation called rGridMap*. Its output looks like this:

rGridMap assumes that the fill variable is categorical rather than continuous.

The overall idea of statebins probably isn't palatable to everyone and I'd suspect that hexagons only exacerbate the issue. The hex approach looks fun, though.

 

*Bucking the trend of "RPackageName" or "rpackagename".

Friday items: lists of mistakes, or at least distractions

Hello and welcome to both the end of the week and the end of the month (unless, of course, you're reading this well after I've posted it, in which case you're welcome anyway).

The aftermath of a recycle bin fire. I didn't start the fire.

The aftermath of a recycle bin fire. I didn't start the fire.

 

Here are a few interesting things from recent times.

It's difficult to find good examples of this but I have to assume it's because people don't like making their failures public knowledge.

  • The Oh No Ross and Carrie podcast has been doing a full, er, rundown on Scientology. The organization is odd but seems quite tame in comparison to Ross and Carrie's other research subjects, like the PIHOP. I mean, they've been to some strange places, but Scientology just seems very expensive.

Germany in January in photos

At long last, a few photos from my visit to several locations in Germany this past January. Click each for further descriptions and hover for text.

Most photos here are monochromatic because that's what the German winter weather is like (and also because my phone camera had a tendency to an inappropriate purple cast to everything).

Easy trees and heatmaps with iTOL v3

September 2017 edit: This method involves PhyloT, which has adopted a subscription model. Trees smaller than 10 items can be assembled freely, but for everything else, you may want to consider other options - or consider paying PhyloT.

If you're a well-organized biologists, you may have to work with phylogenetic trees frequently. You may even have to assemble them yourself. I find that trees look nice alongside heatmaps: that way, one part of a figure defines groups while the other part shows how they differ across a whole dataset. 

Some difficulty can arise when combining large trees with large heatmaps. It's nearly trivial to produce one or the other (here are some of my recent examples for heatmaps in R, at least) but we prefer to keep the order of groups in the heatmap identical to that in the tree.

The Interactive Tree of Life (iTOL) may solve this problem for you and everyone else. It hit version 3 sometime over the past few months, finally making the transition to HTML5 and adding a full suite of annotation options. Starting with a tree like the following, users can just drag and drop annotation files into the browser window.

Here's an example tree:

#NEXUS

begin trees;
tree 'phyloT_generated_tree' = (((((((((((((((((((((((((((((((Mus_musculus)Mus)Mus,(Rattus_norvegicus)Rattus)Murinae)Muridae)Muroidea)Sciurognathi)Rodentia)Glires,((((((((Homo_sapiens)Homo,(Pan_troglodytes)Pan)Homininae)Hominidae)Hominoidea)Catarrhini)Simiiformes)Haplorrhini)Primates)Euarchontoglires)Boreoeutheria)Eutheria)Theria)Mammalia,(((((((((((((((Gallus_gallus)Gallus)Phasianinae)Phasianidae)Galliformes)Galloanserae)Neognathae)Aves)Coelurosauria)Theropoda)Saurischia)Dinosauria)Archosauria)Archelosauria)Sauria)Sauropsida)Amniota)Tetrapoda)Dipnotetrapodomorpha)Sarcopterygii)Euteleostomi)Teleostomi)Gnathostomata)Vertebrata)Craniata)Chordata)Deuterostomia)Bilateria)Eumetazoa)Metazoa)Opisthokonta)Eukaryota)cellular_organisms);
end;

And here's an example of a data file used to add a heatmap:

DATASET_HEATMAP
SEPARATOR TAB
DATASET_LABEL   label2
COLOR   #ff0000
FIELD_LABELS    X   Y   Z
COLOR_MIN   #ff0000
COLOR_MAX   #0000ff
DATA
Gallus_gallus   1   1   1
Rattus_norvegicus   1   1   0        
Mus_musculus    0   0   1
Homo_sapiens    1   1   1
Pan_troglodytes 0   1   0

We get the following result:

Or, for a larger example with more data (not shown):

The new iTOL can still be used with PhyloT to build trees, so now a full tree + heatmap combination could be assembled in very little time. 

16 Personality Factors and deviant positions

I've posted here about various personality tests and psychometrics before and was intrigued to see a new test going around on Facebook recently. I say "intrigued" because the test clearly wasn't just another Meyers-Briggs remix. Instead, it's the Personality Factors test, and at least as far as their website claims, the test is "based on accurate research in psychometrics". It's actually based on Raymond Cattell's 16 Personality Factors.* Versions of the test have been in use since the 1940's and contributed to later methods.

The test is a series of self-assessment statements answered on a 5-point scale from "Very Inaccurate" to "Very Accurate". It reminds me of tests like the Values Based Leader assessment (and the MBTI, of course, but the MBTI is so omnipresent that it's hard to avoid).

I should note there's a mandatory Facebook login at the end of the test, followed by another subtle "Share to Facebook" button and an offer to buy the full version of your results for $10.

A few statements seemed out of the ordinary:

  • "I use swear words." 
  • "I take deviant positions."
  • "I like to stand during the National Anthem."

Some of the statements remind me of the Big Five personality traits. I'm skeptical. (I learned later that Cattell's factor analysis methods directly contributed to development of the Big Five.)

Here's my result:

It's certainly a blob.

It's certainly a blob.

All this result really tells me is that I am high in complexity. Isn't a personality test intended to reduce complexity to simplified categories? To be fair, it also scores me highly for Intellect and Imagination. No surprises here - that's how I assessed myself. I'm still curious about which category statements about the national anthem feed into (dutifulness, perhaps?).

I suppose that summarizing the results of any personality assessment without full interpretation are useless, especially if test subjects hope to learn something new about themselves. I'm also generally skeptical of all psychometrics, but in this case criticizing Cattell's methods may be like criticizing Freud's dream interpretations: sometimes it's enough just to talk about something everyone else disregards. 

Avoid paying ten bucks for the privilege, though.

*That WP article needs editing for neutral point of view.