Cool Image Explaining Causation Vs. Correlation

Back in October, Brendan mentioned that some folks at Harvard were working on a new book for causal inference that unifies concepts from both the graphical models literature and the counterfactual reasoning literature.

So far, I’ve found the drafts they’ve posted online very accessible. In fact, I strted reading it after writing a few blog posts on PlanOut and what I’ve been learning from the social science causal inference literature, and this book has put things in terms similar to how I explain the concepts to myself.

One particularly cool insight is this very evocative image in their first chapter, used to describe the difference between causation and correlation:

[Read More]

Data Flow in PlanOut Programs

PlanOut programs have a simple syntax:

Program ::= Stmt*
Stmt ::=
| if <Bexpr> { <Stmt>* } else { <Stmt>* } <Stmt>*
| **id** <- <Expr> ; <Stmt>*
| return <Bexpr> ; <Stmt>*

Expr ::=
| <Aexpr> | <Bexpr> | <Cexpr> | <Sexpr>
| <Get>
| <ExternalGet>
| coalesce ( <Expr> , <Expr> )
| <Cexpr> [ <Expr> ]
| <RandomVariable>

RandomVariable ::=
| bernoulliTrial( p = <Aexpr> , unit = <Uexpr> ) | bernoulliTrial( p = <Aexpr> , unit = <Uexpr>, salt = <Sexpr> )
| weightedChoice( weights = <Cexpr> , choices = <Cexpr> , unit = <Uexpr>) | weightedChoice( weights = <Cexpr> , choices = <Cexpr> , unit = <Uexpr>, salt = <Sexpr> )
| uniformChoice( choices = <Cexpr> , unit = <Uexpr> ) | uniformChoice( choices = <Cexpr> , unit = <Uexpr> , salt = <Sexpr>)
| randomFloat ( min = <Aexpr> , max = <Aexpr> , unit = <Uexpr> ) | RandomFloat ( min = <Aexpr> , max = <Aexpr> , unit = <Uexpr> , salt = <Sexpr> )
| randomInteger ( min = <Aexpr> , max = <Aexpr> , unit = <Uexpr> ) | RandomInteger ( min = <Aexpr> , max = <Aexpr> , unit = <Uexpr> , salt = <Sexpr> )
| sample ( choices = <Cexpr> ) | sample ( choices = <Cexpr> , num_draws = <Aexpr> ) | sample ( choices = <Cexpr> , num_draws = <Aexpr> , unit = <Uexpr> ) 
[Read More]

Using Custom Javascript In Jekyll Blogs

I made the decision to port my blog over to a Github hosted Jekyll blog from a university-hosted Wordpress blog because I had no way to render custom Javascript in the Wordpress blog. In particular, I had wanted to be able to render interactive graphs using d3.

Unfortunately, I can’t just add a link to d3 in my _includes/head.html file and embed my Javascript directly in a mardown-ified blog post: Jekyll (or maybe Liquid?) strips out the Javascript. There is a workaround, but since the process is more than one step, I wanted to document how one includes custom Javascript in a Jekyll blog.

[Read More]

Simple Difference in Means

When inferring contrasts for a simple difference in means estimator for a (between subjects) PlanOut experiment, we take the unit of randomization to uniquely identify a subject. We also assume that the assignment of one unit does not affect the outcomes of other units. And finally, we assume that the parameter of interest can be determined by the variables in the PlanOut program, since these variables are subsequently read by an Internet application to determine the user experience.

Without more specific domain knowledge, we must treat each PlanOut script as a procedure parameterized by the unit of randomization (e.g., the userid) and the parameter of interest (i.e., the dependent variable in the analysis we will do at the end).

[Read More]