What We Talk About When We Talk About Effectiveness

The biological/scientific definitions of heredity and heritable differ slightly from the popular usage.  Lay people tend use it  to mean “how much is this caused by genes?”  In science, heredity is how closely people resemble their parents, divided by the total variation in the population.  Biological sex has almost zero heritability because knowing someone’s parents sex does not allow you to predict their own sex.*  Number of arms is barely heritable, because there’s almost no variation in number of arms among humans, and what variation exists is overwhelmingly caused by environment, not genetics.

A corollary to this is that a measure of heredity is only valid for the exact environment you measured it in.  If you plant a variety of seeds in identical pots and give them identical water and supplements, most variation will be due to genetics, and a small amount to chance (which will be counted as environment), so traits like height and time to flower will be highly heritable.  If you plant those same seeds in widely varying pots and vary the water and nutrients they get, a lot of the variation will be due to environment, and the heredity values of the same traits will be much lower.  Skin color in Norway is more heritable in the winter than in the summer, because teenagers deliberately tan more than their parents.

I have struggled before to make effectiveness estimates when the intervention’s usefulness depends on multiple factors.  Blood for car accident victims is only helpful in the context of emergency rooms and medical schools and sterile gauze.  Suicide hotlines require phones and electricity and suicidal people at a bare minimum, and active rescues require police and mental hospitals and often pharmaceutical research.  I think I’m just going to have to put effectiveness in the same category as heredity: the quantification is only valid for the environment in which it is measured.

I’ve worried before about Effective Altruism’s tendency to take the existing system as a given.  That was a reasonable simplification when the movement was first starting, and there was plenty of low hanging fruit that didn’t require more sophisticated analysis.  But I’m really happy to see organizations like the Open Philanthropy Project branch into studying how to change systems and how to measure the effectiveness of attempts to do so.

*Intersexuality confounds this a little but my impression is it’s mostly not a genetic issue, in part because intersex people generally have difficulty reproducing.

The Science of Blood Types

Yesterday I made an offhand remark that the Red Cross was so persistent in stalking me because I was O-.  Here’s why that’s important:

Your red blood cells can have two different proteins on them (A or B), or both, or neither.  If you receive a transfusion with red blood cells with a protein you don’t have, your immune system will mark it as a foreign invader and attack it.  If you get too much of these cells, you will die.  Parallel to this is another protein Rh factor, which you either have (Rh+) or you don’t (Rh-).  A- means you have A proteins, but not B or Rh factor.  If you are Rh- and receive Rh+ red blood cells, same problem.

foxindogs
You cannot bluff the immune sytem.

O- red blood cells have no immune-triggering proteins on it, and so can be given to anyone.  That makes O- blood extremely useful when you don’t have time to type a patient, or have limited carrying capacity.  Moreover, O- red blood cells are the only type O- patients can accept.  So O- is often the first to run out.

You might think this makes donations from AB+ people pointless, but that is not the case.  Their red blood cells are of limited use, but their blood plasma (which is the part that contains the antigens that trigger attacks on foreign matter) contains no antigens to any blood type.  Meanwhile everything looks like an invader to my O- plasma, and it will react accordingly.  This also means you can only do whole blood donations between complete type matches.  A B+ person can take my red blood cells, but would need plasma from someone else.

And that is why typed-matched blood is preferred and donations of all types are necessary.

Is Blood Donation Effective? (Yes)

Seattle is apparently not the only Effective Altruism group to talk about doing volunteering meetings, only to remember that the traits that make volunteering useful are almost antithetical to the traits that make it fun and doable to for a group on a drop-in basis.  I am kind of hoping that blood donation can bridge that gap.  So here’s my math on how effective donating blood is.  The Red Cross estimates a single donation can save three people, but what they mean is “a single donation can go to three different people.”  To get the actual value we need to see how many units of blood were donated and how many deaths they prevented.

The most recent data I could find was the 2011 National blood Collection and Utilization Survey Report (PDF), which couldn’t make it harder to do this kind of calculation if it tried.  They were extremely loose with what “unit” referred to, so I’m going to stick with the whole and red blood cell transfusions, so my numbers are consistent.  There were 15,721,000 units collected, of which 14,589,000 were deemed usable.  13,785,000 were used, of which 37,000 were directed to a specific patient, and 65,000 were self-donations, which are less effective for various reasons.  The collections numbers don’t call out general vs. specific donations and the numbers are small, so I’ll just use the total number used.  If some blood donations are also generating plasma and white cells in addition to the red blood cells counted here, that would only increase effectiveness.

A single donation is one pint.  Health and Human Services fails to define what they mean by unit, but it appears to mean “whatever you get from one donation after some filtering“, so let’s assume it’s 1:1.  The average recipient receives 2.75 units.  If you assume each person who received a transplant would otherwise die (supported by this sourceless FAQ), that means each donation saves ~1/3 of a life (discounting for donations that are rejected).  Using GiveWell’s $5,000/life number, that’s still equivalent to donating $1,667.   That is overstating the case, because some portion of recipients (I can’t find out how many) have diseases like sickle cell anemia that require chronic transfusions, and the fair thing is to count their lifetime transfusion count, not their per treatment count.  To get an upper bound I’ll use the Red Cross’s number that a car accident victim can use up to a 100 pints of blood, which means each donor saves 1% of that life, which is equivalent to $50 to an extremely effective charity.

But the question isn’t “what is the average value of donated blood?” but “what is the marginal value of your potential donation?”  I can’t find any direct numbers for this, but we have the following evidence:

  • Very little blood is thrown out.
  • People are spending lots of time and money developing artificial blood substitutes.  Despite this there are no generally accept substitutes for blood’s oxygen-carrying capacity.
  • The Red Cross spends a lot of time and money harassing people to donate.  They called my parents’ house for years after my one donation (I’m O-).
  • Some blood is able to reach the “too old” state, but then used to ill effect, indicating lumpy supply or demand.  Unless you can predict demand spikes you should use the average efficacy.  If you can predict demand spikes, there are probably more effective things to do with that power.

So I’m just going to use the average effectiveness as the marginal effectiveness for now.

What are the costs to the donor of donating?  The one time I donated it was high because I slept for the next two days.  If you’re my friend Elena who went into shock after donating, it cost you days and several thousand dollars in ER visits.  So it is probably not worth it for either of us to donate.  But for a typical person with no side effects, it’s plausibly useful.  If it’s replacing work time, then effectiveness depends on their hourly wage.  Multiple websites list the time to donate as 60-90 minutes, which translates to a minimum psuedowage of $33/hour and a maximum of $1667.  The average hourly American wage is $24/hour, although I would estimate the average wage of people earning to give as somewhat higher than that.  So that’s extremely plausible on its face.  But if the time isn’t coming out of work, and is made rewarding to the participant, blood donation is hugely effective.  This suggestions that an event that induced people to donate without replacing work would be effective, more so if it could be made into a positive experience.  So a blood donation event could be a huge win for an EA event.

[Side note: if you decide to do this yourself, I would recommend donating anywhere but the Red Cross if at all possible.  I’m going to try for Bloodworks NW, because if I get enough people they will send a truck and we can make it an actual party]

Bloody cupcakes
Do not GIS “blood donation party” with safesearch off

How Tests Improve Code Structure pt 2

I’ve always admired Test Driven Development and longed for it from afar, but never had a chance to use it until I was on my own project.  Most times when you crave something this intently it’s a let down, but no, this is every bit as fun as I thought it would be and more.  It’s so relaxing, and it takes so much less mental RAM.  I won’t go back to any other way.

I keep trying to explain why it is better and exactly how it made it obvious what I needed to do, but everything I write comes out boring and I don’t think it explained it anyway.  Let’s try an analogy.  You know how when you attempt a big cleaning project the middle looks worse than if you’d never started?  And if you misjudge your energy level it stays that way, and then gets worse because you’re still living your life?  Or maybe you misjudged the amount of space something required and your plan becomes unworkable, at which point you can improvise or revert?  That’s what regular coding feels like to me.  You don’t know if something’s working until it’s all working.

I’ve been cleaning up my apartment lately, including getting rid of things I don’t want and rearranging things I have so they are more accessible/easier to find/take less space.  And I am being very careful not to do that.  I pick tasks that can be done incrementally.  If I want to move things from cabinet A to cabinet B, things in cabinet B get moved to cabinet C first.  But cabinet C doesn’t have to be their permanent home, just a pareto improvement over the old one.  I have consolidated three dressers into 1 + some other storage bins.  I will probably rearrange those storage bins and the remaining dresser as I learn more about how the current arrangement works, but I was never going to be able to plan that out ahead of time anyway.    This way I never get stuck halfway through, out of energy or realizing my plan is unworkable.

That is what TDD feels like to me.  You might technically be writing and erasing a lot more code, but the mental effort is so much less.  Every step leaves you a little bit better off, and you can concentrate your efforts on one problem at a time.

I was really unimpressed with the android tutorials I saw.  I did Udacity’s, which is officially recommended by Google, but didn’t provide reference code or a way to check your project, so if something didn’t work you didn’t know where the error was. That’s bad enough when it’s a technology you’re well versed in, but with a new tech you don’t have any debugging tools.  It’s like trying to learn a foreign grammar by having it explained to you in its own language, when you don’t even have any vocabulary yet, except your brain hasn’t been crafted by millions of years of evolution to do it.  There are other tutorials, but most of them were written for the now-deprecated Eclipse IDE.  Translating from one IDE or build system is not a big deal when you’re familiar with at least one of them, but at the beginning you don’t even know what to Google.  That’s why you’re doing a tutorial. It’s even more fun with Android because it uses a bunch of very common Java tools but requires slightly different usage than everything else.

So what I actually did was do Udacity long enough to know how to make baby’s first project, come up with a concept that I was pretty sure I could subdivide into google-able problems, and then did so, one at a time.  I learned testing basically from scratch, because the two tutorials that covered it required me to know a ton of abstract android architecture, and none of it was explained well enough to mean anything unless you had already coded.  “Make minor changes until you understand the permutations” is how every programmer I know learns, and yet no class teaches this way.

All of which leads me to believe a test-driven tutorial could be really useful.  I’m picturing a project with a few very simple UI elements, and a series of commented out tests.  Users would uncomment the tests one at a time, in order.  The test would fail. The error message would be informative, maybe there would be a few suggestions for how to solve it.  Then they would research on their own until they found a solution.  They would know they had done it right because the test would be passing. Plus they’d learn testing tools at the same time, and those are extremely useful.  This may be my next project.

TDD got me all of the features I wanted in HungerTracker 0.2 except notifications.  I’m still poking at it, but notifications require a deep understanding of several concepts I’ve entirely ignored until now, and need several moving parts to work together to verify any of them.  So here’s version 0.2, which has a greatly improved button layout and a scrollable list that shows as many or as few entries as actually exist.

Review: Neanderthal Man

As a narrative about how science works, this is pretty strong.  I got it as part of my new policy of not reading emotionally intense books right before bed, and while it didn’t produce the post reading anxiety that, say, that book about slavery did, it was pretty exciting and pushed my bedtime back quite a bit.

The actual science, I’m not sure about.  He’s doing molecular biology without any background in basic bio, so he says things like “I didn’t know insects were animals.” on his first day as a zoology professor (he’s since realized his error) or “Can we really say they’re the same species just because they fertily interbreed.” in his book, on biology, that people paid him actual money to publish.  Yes, we can say that because that is exactly what species means.

I’m also a little confused by how they determined humans and neanderthals interbred.  It seems like they’re using the same data to calibrate the technique they’re using to sequence the DNA, the degradation rate of DNA, the contamination rate of the sample, when humans and neanderthals diverged, and when/how much they interbred.  He also doesn’t make a good distinction between when he’s talking about junk DNA (which is not subject to selection pressure, so is a pretty good molecular clock) and when he’s talking about genes (which is, and so it’s difficult to distinguish inheritance from the same source, interbreeding, and convergent evolution).

Lots of very smart people with much more information and training in this area than I have seem to be okay with his conclusions, so I assume this is one of those things where he is simplifying, and I know enough to know that he is missing something but not enough to fill in the gaps myself.  But if you are not in that uncanncy valley, it’s very well written and entertaining.

Being a cyborg proves more boring than anticipated.

Barack Obama recently announced doubling funding to fight antibiotic resistance, which would be more impressive if there wasn’t a significant step that cost the government nothing: ban use of antibiotics for livestock, which currently account for 80% of antibiotics produced.  Hell, taxing use of antibiotics in livestock would reduce the problem and generate revenue.  Representative Louise Slaughter has introduced a bill to (more or less) do this for five years running and it has gone absolutely no where.  So this feels a little like California introducing water restrictions on people while saying nothing about agricultural use, which coincidentally is 80% of their water use.

But maybe Obama’s new money will go to one of the lesser contributors towards antibiotic resistance: people who don’t finish their prescriptions.  Researchers are studying a new microchip that sends a signal when it is being digested.  They’re using it for severely mentally ill patients, who for various reasons sometimes have trouble staying on their meds (good luck to the first schizophrenic to explain to their new doctor that their old doctor tracked their medication by making them swallow computer chips), but what if we used them for antibiotics?

This isn’t a simple solution.  To have it do any good you have to either punish people for not finishing them (which is extremely hard on low income people) or pay them for finishing (hello terrible incentives).  People who split prescriptions are often trying to save themselves the doctor’s visit more than the cost of the medication itself, and this doesn’t address that.  But it seems like we ought to be able to do something with this.

How Tests Improve Code Structure pt 1

Hunger Tracker needs to persist data past the closing of the app.  Knowing nothing about Android I googled “android write to file” and used the first reasonable looking thing that came up.  This was sufficient to let me write to and read a file, which was good enough for a first try and powerful enough for me to release version 0.1.  But as I planned the next step I ran into problems.  The read function I found required me to specify the number of chars I wanted in advance.  I couldn’t spot the end of the file so I grabbed a fixed number of entries every time.  I could extract the data as strings but couldn’t figure out how to make a proper scrolling list (even though I’d done one in the Udacity tutorial).  Attempts at fixes felt muddled and high friction, which is usually a sign I’m afraid of losing data, either to a hard drive failure or to a introducing a bug and failing to detect it.

Step 1 in fixing this was setting up my github account so I had proper version control.  Step 2 was testing.  I spent a long while figuring how to properly test the kind of android class I was using (“android unit testing” being a surprisingly unhelpful search term), and then some basic tests of “The text fields that should be there, are they there?”.

The next step was to test the data storage.  But I couldn’t figure out how to unit test that.  If I tested whether the app was writing to the correct file I needed to look for the exact same file.  But that means updating the test every time I change the name of the file, which I didn’t want to do.  Plus seeing if the correct thing is written to it is ugly.  Tests should be atomic (meaning it doesn’t matter what order you run them in), but the file is persistent, meaning I either need to clear it every time or factor in what previous tests have done.  Plus I would have to shape the test around the exact storage format the app was using, but again that means making the test dependent on an implementation detail.  I could trigger writing and then reading and make sure the display element was correct, but that’s testing two different things and a unit test should only test one.

What I finally worked out was that the handling of persistent data was not actually a core function of HungerTracker’s MainActivity.  What I needed to do was separate out those functions into a separate class, and then use mock objects to make sure the expected calls were made.  E.g. instead of the app writing to a file and the test looking at the exact file and verifying the writing, the app calls the HungerTrackerWriter object.  The test swaps out the real HungerTrackerWriter with a fake one, and monitors that the expected call is made.  This leaves the HungerWriter proper tests blissfully unaware of the implementation details while still verifying that the app is doing what was expected.

[Technical details: somewhere I read that the android junit framework handled mocks easily. This was something of an exaggeration. It has built in mocking for a lot of Android specific classes, but nothing for user created classes. There are many well regarded Java mocking libraries, none of which provided comprehensive instructions that worked for me. Apparently they integrate weirdly with Android? My first round of mocking was hand-written, just so I could work on test code. I never did get the best regarded library, Mockito, working, but I eventually cobbled together a set of build instructions that made EasyMock work]

You might think that making that big a change in order to make something more testable is the tail wagging the dog, but as I was doing it something magic happened.  Those problems with reading exactly as many entries as there were and putting them in a list (as opposed to reading exactly 10 and dumping them in a string) were suddenly much easier to conceptualize.  What seemed so muddled when it was part of HungerTracker was suddenly easy to think about when it was part of HungerTrackerWriter.

If you are super curious, here is the code before the refactor, here is the code after, and here is the test code with mocks.

Prostaglandin, omega-3s, and health

My cat has lost weight since going on a special “I’m inbred and my kidneys don’t want to kidney” diet.  He’s also wheezing a lot.  My vet has recommended fish oil to get him some extra calories, and to fight the wheezing, if the wheezing is something something allergy something something prostaglandin.  She didn’t explain it very well, so I’m consulting with Dr. Internet.

Prostaglandins are lipids that send signals from a cell to itself or its close neighbors.  Prostaglandins take their name from the prostate gland, signifying the fact that they are produced and have effects in almost every tissue of the body.  This is what happens when you name things after the first place they’re discovered.  “Local signalling” covers a lot of ground, including constricting blood vessels, dilating blood vessels, inducing a fever, making you more sensitive to pain, digestive muscle contraction, digestive muscle relaxation, airway contraction, and airway relaxation.  So they could definitely either cause or cure my cat’s wheezing.

What about fish oil?  Prostaglandins are made from fats, but less so from omega-3 than any other fat, and their prostaglandins are less active than others.  Fish oil is rich in omega-3s, but it’s not the only source, as soylent has been working so diligently to demonstrate.  That’s an argument for swapping omega-6 for omega-3, but it doesn’t mean adding additional omega-3s will be any help.  What is an argument for straight up supplementation is that all fats are converted to prostaglandins by the same enzyme, which exists in limited quantities regardless of the amount of fat available.  Omega-3’s slow conversion rate effective blocks the conversion of the more inflammatory omega-6s.  So while I don’t see any reason fish oil would do better than other sources of omega-3s, this certainly seems like a plausible treatment with limited downsides.

Now is as good a time as any for a general omega-3 vs. omega-6 lesson.  3 and 6 are different in ways I can’t be bothered to look up because it doesn’t matter; your body absolutely needs both of these to survive.  Presumably we adapted, more or less, to whatever ratio was available in the evolutionary relevant time period.  Unfortunately 6s have a much longer half life than 3s before going rancid, and everything in our modern food system pushes this- olive oil bred for shelf life, cows are fed grains, which have more omega-6s than grown plants because they don’t want their seed energy going bad either.  The end result is that the intake ratio of omega-6:omega-3 is extremely different than what our bodies expect, and this causes various problems, like maybe prostaglandin-mediated allergies and inflammation (source).

Video Games for Good

Extra Credits is a video series on game design and the game industry.  It has interesting insights I don’t see elsewhere, but it is also… low density.  You could compress most episodes into a single written paragraph and lose nothing.  I tend to watch them when being told the same thing over and over with completely unnecessary accompanying graphics is calming, rather than annoying, which isn’t very often, so I only just caught this video on whether games can induce empathy.

If you are not in the mood to be reassuringly talked down to, they helpfully provide a summary:

Many studies have investigated whether or not there is a link between video games and violence, but few have looked at the bigger picture. What is the correlation between video games and empathy? Since games put us, as players, in the role of characters who are not ourselves, asking us to understand their situation and the problems that they face, they have the potential to teach us about how to empathize with others. While many gamers have anecdotal evidence about games that made them feel a character’s pain, there’s a disappointing lack of formal studies into that side of the question.

Examples: This War of Mine, Cart Life

I didn’t think anything of it until a week later at my Effective Altruism meetup, when we were discussing egalitarianism/maximization.  In a nutshell, EA believes that all lives are equally valuable, so if you can save two lives for $n each or one life for $2n, the most moral thing to do is to save the two lives.  Phrased that way I don’t understand how it’s at all controversial, but in practice it comes up against many people’s instinctive priorities.  For some, passing over a homeless person to give to GiveDirectly doesn’t just give them fewer warm-fuzzies, it feels actively immoral.  Someone at the meeting suggested it was a matter of empathy- people naturally feel more empathy the more often they see someone, or the more they have in common with them.

This is  of course obvious, which is why so many charities try to up the empathy you feel for their beneficiaries, by implying you’re helping a particular person when you’re not, or just sending a letter with a few heartwarming stories of all the injured dogs they’ve saved that year.*  They do it because it get donations, but it’s very hard not to slide into poverty porn. I find those examples really manipulative, but I loved the ability to choose out specific recipients when donating to Modest Needs so clearly I’m just as susceptible.

This is where I thought of that Extra Credits video.  What if instead of telling people how awful extreme poverty is, we gave them a video game demonstrating both the difficulties poor people faced and the resources they used?  Some things I would like to include:

  • Trade offs, trade offs, trade offs.  Do you invest in your child’s schooling or new farming equipment?
  • Bee Sting theory– demonstrating how it is easy to do the right long term thing when you have a few problems, but when too much is wrong sometimes palliatives are all you can manage.
  • The importance of social capital.  The poor (both in the US and the 3rd world) get a lot of criticism for spending so much on alcohol and ceremonies, but the fact is that that builds social relationships that can be crucial later on.  This doesn’t mean spending a lot on booze and parties is optimal, but that the change must come at a societal level.
  • How many well intentioned NGOs fail.  E.g. my continuing hate for the play pump.
  • Ideally you’d like to convey the scope of preventable deaths.  I don’t know how to do that respectfully.  You could do something like Shelter or The Oregon Trail, where you go in knowing some characters will die and the goal is to save as many as possible, but that seems a little horrifically callous.

I have several ideas for how to do this.  You could do the trade offs with a choice mechanism like that of Depression Quest or Long Live the Queen.  Soha Kareem has has apparently done some great work with video games to express her experience of microaggressions and sexual abuse.

EA strikes me as having a real comparative advantage when it comes to producing video games, relative to other charitable movements.  And by “real comparative advantage”, I mean “lots of programmers”.**  None are games programmers specifically, but it might be a skill worth picking up.

*Pro-tip for my local humane society: this may not work as well on cat owners as you were hoping.

**We were up to two non-programmers at the last meeting.  High five.

100% Food versus Soylent

I really, really wanted to like 100% food.  It has so much going for it- made of actual grown food, high protein variants, convenient portable single serve containers, shipping time measured in days rather than months… Unfortunately, it is inedible.

And if I’m saying inedible, it must be pretty bad.  I drink Soylent at room temperature, and for a long time didn’t bother mixing up the little protein clumps that formed (although once I realized how easy to clean my blender was, I did mix it).  As I write this I’m consuming my smoothie with a spoon because I put in too many chia seeds and it turned into a gel.  I cannot drink 100% food.  I ordered the six-variant mixer (chocolate/plain and regular/high protein/low carb), but I’ve only managed to try two (one low carb, one regular) and one of those was a mere pinch.  Extremely diluted the taste is tolerable, but still leaves this unbelievably gross oil aftertaste/film in your mouth.  I won’t drink it and you can’t make me.

The single serve containers were a disappointment too. There’s not enough room in them to really shake up the mix, so you end up with a lot of dry mix protected by a layer of wet mix.  So 100% food’s only real selling point is that it ships quickly.

I’m not 100% happy with Soylent.  I would really prefer fewer digestible carbs and more protein and fiber, but that’s addressable with some flax seeds and additional protein powder.  I would also love it if they shipped in < 3 months, and didn’t tell me they were going to ship a month before they did.  But it is better than starving to death, which is more than I can say for 100% food.