{"id":5898,"date":"2016-03-31T23:27:11","date_gmt":"2016-03-31T22:27:11","guid":{"rendered":"http:\/\/emilkirkegaard.dk\/en\/?p=5898"},"modified":"2016-03-31T23:29:50","modified_gmt":"2016-03-31T22:29:50","slug":"us-state-iqs-cannot-be-estimated-from-okcupid-data","status":"publish","type":"post","link":"https:\/\/emilkirkegaard.dk\/en\/2016\/03\/us-state-iqs-cannot-be-estimated-from-okcupid-data\/","title":{"rendered":"US state IQs cannot be estimated from OKCupid data"},"content":{"rendered":"<p>In the interest of publishing null findings: I tried estimating US state IQs from the mean cognitive ability for users in <a href=\"https:\/\/osf.io\/p9ixw\/\">the OKCupid dataset<\/a>. However, this did not work out. This was a far shot to begin with due to massive self-selection and somewhat non-random sampling.<\/p>\n<p>Actually, what I really wanted was another way to estimate county-level IQs, since <a href=\"http:\/\/emilkirkegaard.dk\/en\/?p=5894\">Add Health refuses to share that data<\/a>. But before I could do that, I needed to validate the estimates for something else. The scatterplot can be seen below. The NAEP is from <a href=\"https:\/\/osf.io\/78nvf\/\">Admixture in the Americas<\/a>, so it is based on a few years of NAEP data.<\/p>\n<p><a href=\"http:\/\/emilkirkegaard.dk\/en\/wp-content\/uploads\/state_IQ.png\" rel=\"attachment wp-att-5899\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium wp-image-5899\" src=\"http:\/\/emilkirkegaard.dk\/en\/wp-content\/uploads\/state_IQ-300x200.png\" alt=\"state_IQ\" width=\"300\" height=\"200\" \/><\/a><\/p>\n<p><strong>R code<\/strong><\/p>\n<p>This assumes you have loaded the OKCupid data as d_main and have already calculated the cognitive ability scores.<\/p>\n<pre>### VALIDATE STATE-LEVEL IQs\r\n\r\n# subset data -------------------------------------------------------------\r\nv_2chars = d_main$d_country %&gt;% str_length() &lt; 3\r\nv_notUK = !d_main$d_country %in% c(\"UK\", \"GU\", \"13\", NA)\r\nd_states = d_main[v_2chars &amp; v_notUK, ]\r\n\r\n#mean score by \r\nd_states = ddply(d_states, .(d_country), .fun = plyr::summarize, IQ = mean(CA, na.rm = T))\r\nrownames(d_states) = d_states$d_country\r\n\r\n# load comparison data ----------------------------------------------------\r\n#read\r\nd_admix = read.csv(\"data\/Data_All.csv\", row.names = 1)\r\n\r\n#subset USA\r\nd_admix = d_admix[str_detect(rownames(d_admix), pattern = \"USA_\"), ]\r\n\r\n#rownames\r\nrownames(d_admix) = str_sub(rownames(d_admix), start = 5)\r\n\r\n#merge\r\nd_states = merge_datasets2(d_states, d_admix)\r\n\r\n# plot --------------------------------------------------------------------\r\nGG_scatter(d_states, \"MeisenbergOCT2014ACH\", \"IQ\") + xlab(\"NAEP\") + ylab(\"OKCupid IQ\")\r\nggsave(\"figures\/state_IQ.png\")<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>In the interest of publishing null findings: I tried estimating US state IQs from the mean cognitive ability for users in the OKCupid dataset. However, this did not work out. This was a far shot to begin with due to massive self-selection and somewhat non-random sampling. Actually, what I really wanted was another way to [&hellip;]<\/p>\n","protected":false},"author":17,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1839,2591],"tags":[1866,2326,2323],"class_list":["post-5898","post","type-post","status-publish","format-standard","hentry","category-psychometics","category-intelligence-iq-cognitive-ability","tag-okcupid","tag-state","tag-us","entry"],"_links":{"self":[{"href":"https:\/\/emilkirkegaard.dk\/en\/wp-json\/wp\/v2\/posts\/5898","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/emilkirkegaard.dk\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/emilkirkegaard.dk\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/emilkirkegaard.dk\/en\/wp-json\/wp\/v2\/users\/17"}],"replies":[{"embeddable":true,"href":"https:\/\/emilkirkegaard.dk\/en\/wp-json\/wp\/v2\/comments?post=5898"}],"version-history":[{"count":4,"href":"https:\/\/emilkirkegaard.dk\/en\/wp-json\/wp\/v2\/posts\/5898\/revisions"}],"predecessor-version":[{"id":5903,"href":"https:\/\/emilkirkegaard.dk\/en\/wp-json\/wp\/v2\/posts\/5898\/revisions\/5903"}],"wp:attachment":[{"href":"https:\/\/emilkirkegaard.dk\/en\/wp-json\/wp\/v2\/media?parent=5898"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/emilkirkegaard.dk\/en\/wp-json\/wp\/v2\/categories?post=5898"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/emilkirkegaard.dk\/en\/wp-json\/wp\/v2\/tags?post=5898"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}