Saturday, November 18, 2017

My First Python Script: Mapping US Residents Killed by Law Enforcement-

I have been mapping with QGIS (and ARCGIS) for almost 10 years. This project represents my first Python script--a map created by linking Python and QGIS with PYQGIS. For a separate project I have been mapping the number of U.S. residents killed by law enforcement. The data comes from the Mapping Police Violence project, which documents where police have killed residents, linking their name, county, and other information to the original news story where the victim's story was told.

Along with the mapping with Python, I have also generated an R script, pulling data from a repository and running a regression analysis on a total of about 30 demographic, economic and political variables. The strongest, yet most concise model is

Killed ← log(Population) - Employment + Poverty

Killed: Number of residents killed by police per county from 2013-Oct 2017
Population: The total number of people living in the county in 2015, US Census
Employment: Percent of the county employed from 2011-2015, American Community Survey, US Census
Poverty: Percent of the county living in poverty from 2011-2015, American Community Survey, US Census

According to a pseudo-R^2, these three dependent variables explain about 77% of the variation in the data. The model, and all DVs were significant to p<0.0001. Since the IV was a count variable, literally counting the number of victims per county, I used a negative binomial model. The results indicate just a slightly elevated risk of being killed by police in counties with larger populations, a decreased risk when employment is high, and an increased risk when poverty is high.

The data from Mapping Police Violence, while an amazing resource, needed extensive cleaning. I found 60 counties that did not match the states that were identified, or where no counties were listed. I manually found the correct counties through a Google search. (Edit: I have been informed that all of these issues have been corrected on the original Web site)

Saturday, October 14, 2017

Mapping Trump's Drop in Approval Rating by State

From January to September, Trump's approval ratings have dropped nationally. But more, they have dropped in every single state. Using data from this week's Morning Consult, which interviewed almost half a million registered voters, the state-level drop for Trump ranges from 11% (Louisiana) to 31% (Illinois). The map below was generated from first taking his approval ratings minus his disapproval ratings for January and September, then subtracting the January rating from September. This is shown in the first map.

In contrast, the second map shows that there are many states where Trump's approval is still above water. This ranges from Hawaii at a low (-33%) to Wyoming (-26%). Twenty-seven states have Trump underwater, and 23 above. Both of these maps were created using Quantum GIS.

Thursday, June 15, 2017

Two-Parent "Nuclear" Family Households in US Slavery

In 2011, Rick Santorum and Michelle Bachmann, along with many other GOP candidates, signed a "Marriage Vow" pledge that initially claimed that US slave children were largely raised in two-parent homes. In the article linked in this NPR/New Republic story by John McWhorter, he defends this claim. This claim recently reappeared in a student-faculty dispute, where the sociology professor's contract was not renewed, arguably due to posting threatening personal statements about the student on social media.

The professor in question apparently used a test-bank from a well-known marriage and family textbook, written by a well-established sociology researcher, Andrew Cherlin. While I could not find an online copy of Cherlin's textbook to quote, he has a trade book that makes the following claim: "Most slave children, [Gutman] contends, grew up in two-parent families" (2006, p102). As can be found elsewhere, for example on the blog of another marriage and family scholar, Philip Cohen, the test bank contained a question that asked about the structure of US slave families, and the 'correct' answer was "Most slave families were headed by two parents." The student objected to this answer, believing it to be untrue, and even created a presentation arguing her case that both the textbook and her professor were relying on outdated research (Cohen, above, quotes his own textbook, where he seems to affirm Cherlin's position, saying, about slave families "most children lived with both parents").

While I am not a marriage & family scholar, my reading of the recent peer-reviewed literature on this subject seems to confirm the student's position, contrary to Cherlin's claim in his textbook and the publisher's test-bank. What he refers to above has been deemed the "Gutman Thesis," since this revisionist perspective on slave families seems to come from Herbert Gutman's research (1976), and was supported by subsequent research by other scholars in the 1970s & 80s (Genovese, Blassingame, Jones, White, as referenced in Stevenson (1996)). However, by the 1990s, Gutman's ideas started to be challenged by a number of slavery scholars, and this more recent trend is not apparent in Cherlin's work, from what I can find.

An outline of this transition away from Gutman can be seen as early as 1995 in Stevenson's "Black Family Structure in Colonial and Antebellum Virginia: Amending the Revisionist Perspective." By this point, data had already appeared which contradicted Gutman, and a consensus had begun to form that the pre-Gutman picture of slave families was better supported, specifically, the position that since slave-owners did not recognize the legality of slave families, and typically did not even believe that Blacks could form emotional family bonds, there was no incentive to protect slave families. Rather, there was every incentive to break up slave families when it was profitable to sell fathers to other slave owners, or as soon as the children were considered old enough to be removed from their mothers care, often around 10-years old.

Cracks started to form early around Gutman's framing of slave families. A 1980 dissertation by Crawford (Quantified Memory), in an examination of narratives from interviews of ex-slaves, only 51% recalled being born into "two-parent, consolidated family households" (quoted in Malone, Sweet Chariot, 1992). Crawford finds that in smaller plantations (15 or fewer slaves), single-parent homes were closer to 75% of families. (Malone goes on to cite Fogle, who apparently had misrepresented Crawford's work, claiming far more two-parent families under slavery).

Similarly, in 1986, Kulikoff's, Tobacco and Slaves makes the following claims based on his research:

  • 357-59 "Because spouses of African-born slaves were usually separated, African mothers reared their Afro-American children with little help from their husbands. ... First, planters kept women and their small children together but did not keep husbands and teenage children with their immediate family."
  • 369 "Nearly half of all the Afro-Americans owned by four large planters resided in households that included both parents and at least some of their children. More than half of the young children on all four plantations lived with both parents."
  • 371 "Only 18 percent of the blacks on small units in Prince George’s County in 1776 lived in two-parent households. … More than two-fifths of the youths ten to fourteen years of age lived away from parents and siblings. … Although slave fathers played a major role in rearing their children on large units, they were rarely present on smaller farms. … Children under ten years almost always lived with their mothers, and more than half on large plantations lived with both parents.. Between ten and fourteen years of age, large numbers of children left their parents’ homes."
  • 373 "The fact that about 54 percent of all slaves in single-slave households in Prince George’s in 1776 were between seven and fifteen years of age suggests that children of those ages were typically forced to leave home. Young blacks were most frequently forced from large plantations to smaller farms."
These statements are supported by multiple data tables. Two different tables support Crawford's claim above, that large plantations had more stable two-parent families, hovering around 45%, while smaller plantations had far lower rates of two-parent households, only around 18%. Additionally, reiterating what was quoted above, the tables show that there were children who lived on their own in households, especially children 10-14 years of age, where 15% on large plantations lived in households with no other family members present.

These findings are supported by Malone, 1992, in Sweet Chariot. She explicitly contradicts Gutman, et al's, research, saying

  • 254 "Revisionist literature of the 1970s and 1980s on the slave family projected the supposition now frequently reflected in college textbooks that most slaves in the United States lived in families consisting of both parents with their children. This idea developed in part from a misreading of slave family-household studied that analyzed only the composition of simple families rather than that of the entire community. If one looks solely at simple families instead of the households making up the entire social body, then a majority of those slaves in families did live in two-parent nuclear units under normal circumstances. But such an approach obscures the fact that at many points in their lives slaves were not part of a standard nuclear family but functioned as solitaires or as a member of other household types. It also fails to perceive the holistic nature of slave society"

Stevenson (1996), in Life in Black and White, continues the attack on the Gutman Thesis with more contemporary data:

  • 161 "Even when the physical basis for a nuclear family among slaves—the presence of a husband, wife, and their children—existed, as it did for a significant minority, this type of family did not function as it did for free people, whether blacks in precolonial Africa or whites in the American South. Slave family life, in particular, differed radically from those of local whites of every ethnicity or class. … Virginia law, for example, did not recognize, promote, or protect the nuclear slave family or slave patriarchy. In fact, the only legal guideline for slave families did much to undermine these concepts …. Since ‘husbands’ had no legal claim to their families, they could not legitimately command their economic resources or offer them protection from abuse or exploitation."
  • 208 "Despite scholarly speculation to the contrary, even the largest local slaveholdings often did not translate into monogamous couples or nuclear core families who resided together on a daily basis."
  • 212 Regarding Stevenson's research on various slave-owning families in Virginia in the late 1700s-early 1800s, including George Washington, "as many as 74 percent of those slave families with children did not have fathers present on a daily basis—46 percent of the slave mothers had abroad husbands, while 28 percent were ‘single’ or had no identifiable spouses. ... 71 percent of his slave mothers lived with their children, but had no husband present."

Continuing to build on this research, Burke (2010), in On Slavery's Border: Missouri's Small Slaveholding Households, 1815-1865, the following conclusion is drawn from this state sample:

  • 226 "In the five counties studied, only 28 percent of slaveholdings in 1850 and 27 percent in 1860 comprised just slave women or slave women and children alone. In fact, a full 47 percent of slaveholdings in 1850 and 50 percent of slaveholdings in 1860 had in residence both male and female adults. … a great number of abroad and single women resided in slaveholdings with slave men who were not their husbands. Many of the men living with abroad women may have been related in ways other than marriage; they were fathers, brothers, and sons."

Finally, in a current textbook, Cole (2016), Race and Family: A Structural Approach, summarizes many of the researchers quotes above, saying,

  • 189-90 "[Kulikoff] in one account of interviews with former slaves, 82 percent mentioned their mothers' presence in their childhood, but only 42 percent recalled consistent contact with their fathers. Hence, the master, not the father, was frequently viewed as the provider for the family. ... 47 percent of families on large plantations were nuclear, as opposed to only 18 percent on small plantations. Crawford (1980) reported that single-parent families were 50 percent more prevalent on plantations with 15 or fewer slaves."

The most current research seems to contradict the claims of those who argue that slave families were largely composed of two-parent households. But beyond the specific data claims, there is also a question as to why the original claim was made. While, on the one hand, it may simply be a case of "following the data where it leads," an important principle of scientific research, the persistence of these claims, particularly the removing of these claims from their original research contexts, seem to derive from a perspective of wanting to minimize the devastation of slavery, and in doing so, would seem to lend credibility to those in society who want to argue positions that facilitate racist beliefs and claims.

Monday, June 12, 2017

Chrome: Disabling Autoplay Video/Audio

Chrome, a Google product, which used to have may user-friendly features, has progressively removed those features. One example is their removal of the feature to disable videos that automatically play when you open certain web sites. It was a broad feature that turned off plug-ins until you manually click on them to make them play. Several other browsers still have this feature, and a perusal of the mass number of complaints about this from an internet search, show that Chrome users are simply switching to those other browsers, such as Firefox (for Windows) and Safari (for Apple/Mac).

I HATE ads in general, particularly overlays & popups that prevent you from seeing a web page until you click on something to get rid of it, and any video/audio that automatically plays. As a former IT professional, forcing users to click on a popup/overlay to get rid of it is a GREAT way to download malware to computers, which is why I continually had to remind the staff in the departments where I tried to keep their computers safe, to NEVER EVER EVER click on any pop-ups, no matter how benign they seemed. I follow my own advice--if I can't "escape" out of a pop-up/overlay, I simply leave that site permanently. It's a horrible web design practice. I have 5 different ad/pop-up/overlay blockers installed as extensions to prevent these issues, and together they tend to work pretty well:

  • ScriptSafe
  • BehindTheOverlay
  • AdBlock
  • Adblock Plus
  • Ads Blocker for Facebook
But another pernicious issue is the videos/audio that automatically plays when you open web sites. The volume is usually incredibly loud, and frequently scares both me and my dogs. It's also obnoxious because I'm usually listening to music or TV, and sometimes miss whatever is happening on my show or the news. After having to reinstall Windows from scratch due to a crash, I had to find and reinstall all of the programs that prevented autoplay--none of the internet searches were helpful. For example, most sites claimed "Disable HTML5 Autoplay" stop those videos. It stops maybe half of them. Some sites, like CNN and USA Today, try multiple times in multiple ways to force you to watch videos--you can watch the web site continually try to reload as it fights with all of the various extensions designed to prevent video, popups and overlays.

Another approach is to disable Flash and Javascript. This tends to work, combined with Disable HTML5 Autoplay, but sites like CNN subvert this by using javascript for everything--for example, when I completely turned off javascript, the main CNN page would not load anything at all. So I successfully turned of the autoplay videos, but I also couldn't use the site since the text news or even headlines wouldn't load either.

SOLUTION: Unfortunately, there were no silver bullet extensions that successfully turned off all autoplay videos, and no "settings" in the most recent version of Chrome that allow you to turn off autoplay. The only way I was able to solve this problem was to uninstall Chrome and find an older version, pre-55. I found Chrome 54 from SlimJet.com. I did the following, all from Settings --> Advanced Settings --> Privacy --> Content Settings:

  1. Check "Block third-party cookies and site data"
  2. Javascript: "Do not allow any site to run JavaScript" (an option appears in the URL tab of each site that you can mark as exceptions to this rule--it's incredibly handy)
  3. Handlers: "Do not allow any site to handle protocols"
  4. Plugins: "Let me choose when to run plugin content"
  5. Pop-ups: "Do not allow any site to show pop-ups"
  6. Location: "Do not allow any site to track your physical location"
  7. Notifications: "Do not allow any site to show notifications"
  8. Unsandboxed plugin access: "Do not allow any sites to use a plugin to access your computer"
  9. You get the idea--I basically turned off absolutely everything in the "Privacy" section

Wednesday, May 10, 2017

Windows 10 Updates Nag Screen Hijack

Windows has always loved to hijack your computer because Gates wants to micromanage your life. Previous versions would automatically update your computer, whatever you were doing, no matter how important it was (such as being in the middle of a class lecture, thus interrupting all 60 students for a 30-minute update, thus forcing you to cancel your lecture). However, you used to be able to change some well-hidden settings and turn off automatic updates, so that you could update your computer when it was convenient. Not so with Windows 10. There is no way to actually just completely turn them off. I have googled many times, and tried all the tricks to get this turned off, and while my automatic updates are *mostly* turned off, I still occasionally get an overlay screen that covers my desktop that won't let me do anything else until I click my acknowledgement that I must restart my computer. I'm not forced to restart my computer right then, but the overlay lockout keeps happening until I do. This is unacceptable.

The only thing I've found that works is to disable the permissions on the files with variations of the name "MusNotification." Here is a screenshot of a computer search (using Locate) to find all instances of these files. Every couple of months I have to redo this, since Microsoft seems to realize the original files have been disabled, so finds someplace new to put them, and it starts over.

The procedure I used to do this was to right click each file to open "Properties" then "Security" then "Advanced." First, I took ownership away from "TrustedInstaller" and gave ownership to "Users." Sometimes that still doesn't allow me access to change permissions, because the file is inheriting the permission from elsewhere, requiring me to click "disable inheritance." Once that is done, I have to go into each of the Permission entries, and "Deny" full control to all of them: TrustedInstaller, System, All Application Packages & All Restricted Application Packages. I also changed Administrator and Users to "Read only" (not Read & Execute). This is tedious, since you have to do this for all of the MUS Notification & MusNotificationUX instances, and the list grows every couple of months.

Other things I've tried, some of which partially help, are the following

  1. Go into "Services" and "Windows Update"--I can "disable" this option, but then I can't manually update the computer--I have to go back in and re-enable this service for me to update my computer. This is not acceptable.
  2. Metered connection--there is a procedure to change the wireless properties, to change how my computer monitors my wireless connection, seeing it as a "metered connection," and thus doesn't automatically download updates. However, this ended up messing with My Outlook e-mail, so couldn't use this.
  3. Going into Group Policy (some versions of Windows 10 don't have this), and upating ConfigAutoUpdate but this didn't seem to work for me--others had better luck.

Some more information about this is at Superuser.com

Saturday, May 6, 2017

House ACHA Vote, May 4--GOP Win %

On May 4th, the House finally passed a version of the Obamacare repeal with the slimmest of margins--they needed 216 votes, they got 217. All Democrats voted against it, predictably, but 20 Republicans also voted against it. I was interested to see the 2016 election results in their districts.

The GOP House win % ranges for those who voted against the AHCA, were from 48.5% (TX-23) to 71.3% (KY-04). In TX-23, Willie Hurd won by a hair--the Libertarian got almost 5%, so the Democrat was almost able to win the district. Clinton won that district by over 3%. The next lowest GOP win was Coffman, CO-06, with 50.2%, who easily beat the Democrat since the Libertarian took 5%. However, Clinton & Obama won this district the last 3 elections.

On average, the House Republicans who voted against the AHCA won their district with a 59.4% margin, and Clinton's win margin was 45.4%. Nationally, Republicans who won their districts got 63.4%, and Clinton lost those districts at 38.4%. So while the GOP House members who voted against the AHCA had tighter win margins than other Republicans, it was not as close as I expected.

Another possible explanation seems to be the number of people that would lose healthcare coverage from the AHCA. The Center for American Progress crunched the CBO estimates for the original AHCA proposal (which failed), estimating how many people in each congressional district would lose coverage.

In fact, this result is the opposite of what I predicted. Of the 20 Republicans that voted against the AHCA, on average, about 49,580 citizens would lose coverage in those districts, compared to an estimated 53,413 who would lose coverage in all of the other GOP-held districts. In Democrat held districts, that number jumps to 57,317 coverage loss per district.

The CAP even breaks down those who would lose coverage by group: non-elderly (adults, children, disabled & Medicaid expansion), Medicaid-elderly, Employer-sponsored, and "Exchanges & Other Coverage." There were slightly more elderly covered under Medicaid who would lose coverage in the districts of the GOP who voted against the AHCA (1,880) versus the rest of the GOP-held districts (1,842), but this difference seems negligible. I found similar results for the "Employee-sponsored" losses (17,635 vs 16,240) and the "Exchanges & Other Coverage" losses (7,150 vs 6,044).

Either there is a problem with the data, or the Republicans in these districts had other reasons for voting against the AHCA.

Sunday, April 9, 2017

Filibuster by Senate Minority Party

The filibuster's history is interesting to visualize. The graph below shows three variables, all along a timeline that extends back to 1917: the number of filibusters (cloture motions filed), the President's party, and the Senate minority party. Recently the GOP Senate "went nuclear" by getting rid of the filibuster for Supreme Court nominees. In addition to the standard rhetoric of obstructionism by the Senate party in charge when the minority party resists, the GOP's defense of this maneuver also involved blaming Democrats for "starting it," in the first case with the Reagan SCOTUS nominee, Robert Bork, in 1987, and then later when Democrats got rid of the filibuster for federal judges in November 2013. There is a false equivalence in both of these arguments.

For the case of Bork, the GOP argument would only be valid if Democrats obstructed all of Reagan's nominees and if the obstruction was long party lines. However, neither of those are the case. Previously, Reagan's nomination of Sandra Day O'Connor passed the Senate with a 99-0 vote, his elevation of William Rehnquist passed 65-33, his nomination of Antonin Scalia passed 98-0, and finally Anthony Kennedy passed with 98-0. The vote for Bork was not rejected along party lines--6 Republicans voted against him, and 2 Democrats voted for him.

To the issue of Democrats getting rid of the federal judge filibuster at the end of 2013, the data shows that this was the result of an exploding number of filibusters by Republicans. The historical record shows that Republicans blocked the Obama agenda at every level of government, including their obstructionism to approve federal judges and other appointees. This pattern began shortly after Obama took office in 2009, continued throughout his presidency, of course culminating in the GOP refusal to allow Obama's SCOTUS pick of Merrick Garland to even come up for a vote after the death of Antonin Scalia.

All of this behavior was literally unprecedented. As the graph below shows, for most of the 1900s, the use of the filibuster was relatively low--typically less than 10 cloture motions filed per year, and many years there were none filed. This began to change in the 1970s. In 1975, the Senate made it easier for cloture to be filed--reducing the percentage from 2/3 (67 votes) to 3/5 (60 votes). The 1960s was a tumultuous era, the peak of the Civil Rights movement--the higher threshold for filibuster likely kept them to a minimum, but even still, there were very few filibusters during that decade.

In the late 1960s, Nixon & Reagan's "Southern Strategy" successfully changed the way that the public voted for Democrats and Republicans--the South transitioned from a Democrat stronghold to a Republican stronghold. Therefore, on the graph, I begin coloring the cloture motion bars blue (Democrat) or red (GOP) in 1968, but do not assign party prior to that (the 2001-2002 Senate is uncolored--control went back and forth due to a Senate tie). Since it is the minority party that filibusters, the color of the bars represent the minority party (ie, the 1969-1970 Senate was Democrat controlled--Republicans were therefore the minority, so the bar is colored red). The background color represents the party of the president (blue for Democrat, red for Republican). There s a gradual increase in filibusters from 1970s-early 2000s. The big jump first occurs in the late 2000s when Democrats were in control of the Senate at the end of the Bush years--conservative Republicans were filibustering Democratic Senate legislation, as well as opposing much of their own president's (Bush) agenda, such as the expansion of Medicare and immigration.

This significantly changed once Obama was elected. As the graph shows, Republicans as the minority in the Senate filibustered twice as much as had ever been seen before (2013-2014), eventually leading to Democrats getting rid of the filibuster for the one issue of allowing federal judges to be approved.

Tuesday, February 28, 2017

The Rise and Fall of Milo

While I am loathe to bring more attention to Milo Yiannopoulos, I will do so simply as a way to blog something for the month. I noticed how quickly his name entered my consciousness, and how quickly it left. Surely he is far more important than I recognize, since I hadn't heard of him before the incident with Leslie Jones, which caused Twitter to ban him. I won't recapitulate his long history of targeting and abusing vulnerable populations. What is interesting is how a Google image of his "trending" has but 3 peaks, and otherwise is fairly flat-lined.

One notices the first small peak that occurs in July 2016. This is when Twitter banned him for hate speech and inciting violence. The second peak in early February 2017, is when he cancelled a Berkeley, CA paid speaking engagement at the university because he apparently became frightened by some snowflakes. Shortly thereafter he appeared on the Bill Maher debacle, where he caught the attention of a Canadian teenager who disapproved of the provocateur's earlier history of supporting pedophiles, and she decided to take down the Breitbart editor by reminding the public about those prior comments (which were always available on the interwebs, were one inclined to do some googling). Milo's sugar-daddies (Breitbart, CPAC, and Simon & Schuster) decided he was no longer able to please them, so they cut him loose.

Milo, not satisfied with a graceful bow-out, decided to very publicly become what he had preached against to win his earlier acclaim--a "victim" of circumstances beyond his control, psychically injured by abusive people. While I can sympathize with his situation, what will certainly take years of concerted effort from which to heal, I cannot now suddenly accept that his years of abuse of other people is justified by claiming "victims become victimizers." The irony is so delicious. His fame and supporters loved the fact that he lashed out at people who were weak and oppressed by a patriarchal, heterosexist, racist system. The stigmatization that comes from not falling into line within this system is brutal, not only psychologically, but physically and materially. Yiannopoulos intentionally pretended none of this damaging reality existed. Now that he has been cut out by the gatekeepers of this system, he claims the system is victimizing him and has begun shifting the blame elsewhere. He falls into the camp of those who love and vigorously support a system from which they benefit, but which creates fundamental and profound inequalities for others--until he no longer benefits, he himself has become the 'other.' Now he suddenly finds flaws with the system and wants some support. Granting such at this stage would seem to make his life far too easy compared to the evil he has perpetrated.

Sunday, February 5, 2017

Median Family Income by County: 1950-2012

I was interested in geographical economic capital flows in the U.S., but had no idea how to search for it, since Googling for "United States," "geography" and "capital" just kept giving me the state capitols. So with some inspiration from some FB friends, I grabbed some Census data, spent 2 days hand-transcribing some old PDFs from the pre-computer era, and created this GIF. It's median family income by county from 1950-2012. From what I can tell, there is no county-level data prior to this. I could be wrong, feel free to correct me. The red are the poorest areas that year, and the green are the richest areas.

I used QGIS to make the maps, Excel to manipulate the data, OpenOffice to bring the Excel data into a format QGIS could use, and Paint Shop Pro, Animation Shop to make the GIF.