<% unless goal.nil? %> <% experiment_class = "experiment experiment_with_goal" %> <% else %> <% experiment_class = "experiment" %> <% end %> <% experiment.calc_winning_alternatives %>

Experiment: <%= experiment.name %> <% if experiment.version > 1 %>v<%= experiment.version %><% end %> <% unless goal.nil? %>Goal:<%= goal %><% end %> <% metrics = @metrics.select {|metric| metric.experiments.include? experiment} %> <% unless metrics.empty? %> Metrics:<%= metrics.map(&:name).join(', ') %> <% end %>

<% if goal.nil? %>
<%= experiment.start_time ? experiment.start_time.strftime('%Y-%m-%d') : 'Unknown' %> <%= erb :_controls, :locals => {:experiment => experiment} %>
<% end %>
<% total_participants = total_completed = total_unfinished = 0 %> <% experiment.alternatives.each do |alternative| %> <% total_participants += alternative.participant_count %> <% total_unfinished += alternative.unfinished_count %> <% total_completed += alternative.completed_count(goal) %> <% end %>
Alternative Name Participants Non-finished Completed Conversion Rate
Finish
<%= alternative.name %> <% if alternative.control? %> control <% end %> <%= alternative.participant_count %> <%= alternative.unfinished_count %> <%= alternative.completed_count(goal) %> <%= number_to_percentage(alternative.conversion_rate(goal)) %>% <% if experiment.control.conversion_rate(goal) > 0 && !alternative.control? %> <% if alternative.conversion_rate(goal) > experiment.control.conversion_rate(goal) %> +<%= number_to_percentage((alternative.conversion_rate(goal)/experiment.control.conversion_rate(goal))-1) %>% <% elsif alternative.conversion_rate(goal) < experiment.control.conversion_rate(goal) %> <%= number_to_percentage((alternative.conversion_rate(goal)/experiment.control.conversion_rate(goal))-1) %>% <% end %> <% end %>
<%= confidence_level(alternative.z_score(goal)) %>
<%= number_to_percentage(round(alternative.p_winner(goal), 3)) %>%
<% if experiment.has_winner? %> <% if experiment.winner.name == alternative.name %> Winner <% else %> Loser <% end %> <% else %>
<% end %>
Totals <%= total_participants %> <%= total_unfinished %> <%= total_completed %> N/A N/A N/A