def to_csv
      CSV.generate do |csv|
        hypothesis_names = hypotheses.map { |h| h.name }
        hypothesis_totals = hypotheses.map { |h| hypothesis_counts[ h.name ] || 0 }

        csv << [ nil ] + hypothesis_names
        csv << [ 'total' ] + hypothesis_totals

        goals.each do |g|
          goal_totals = hypotheses.map { |h| goal_counts[ g.name ][ h.name ] || 0 }
          csv << [ g.name ] + goal_totals
        end
      end
    end
def to_csv
      CSV.generate do |csv|
        hypothesis_names = hypotheses.map { |h| h.name }
        hypothesis_totals = hypotheses.map { |h| hypothesis_counts[ h.name ] || 0 }

        csv << [ nil ] + hypothesis_names
        csv << [ 'total' ] + hypothesis_totals

        goals.each do |g|
          goal_totals = hypotheses.map { |h| goal_counts[ g.name ][ h.name ] || 0 }
          csv << [ g.name ] + goal_totals
        end
      end
    end
Experiment#to_csv
 Generates a CSV representing the experiment results
  * header row of hypothesis names
  * row of total subject count per hypothesis
  * goal rows of subject count per hypothesis