public string GetResultDescription(Experiment test) { double p; bool testAssumptionsUpheld = false; try { p = GetPValue(test, out testAssumptionsUpheld); } catch (Exception e) { return(e.Message); } StringBuilder builder = new StringBuilder(); if (!testAssumptionsUpheld) { builder.Append("Caution: the sample did not conform to the expected cell frequency condition! "); } ABAlternative best = test.GetBestAlternative(); ABAlternative worst = test.GetWorstAlternative(); builder.Append(String.Format(@" The best alternative you have is: [{0}], which had {1} conversions from {2} participants ({3}). " , best.Content , best.Conversions , best.Participants , best.PrettyConversionRate )); if (p == 1) { builder.Append("However, this result is not statistically significant."); } else { builder.Append(String.Format(@" This difference is <b>{0} likely to be statistically significant (p <= {2})</b>, which means you can be {1} that it is the result of your alternatives actually mattering, rather than being due to random chance. However, this statistical test can't measure how likely the currently observed magnitude of the difference is to be accurate or not. It only says ""better"", not ""better by so much"". " , //Percentages[p], ToPercentageString(p), Descriptions[p], p )); } return(builder.ToString()); }
public string GetResultDescription(Experiment test) { double p; bool testAssumptionsUpheld = false; try { p = GetPValue(test, out testAssumptionsUpheld); } catch (Exception e) { return e.Message; } StringBuilder builder = new StringBuilder(); if (!testAssumptionsUpheld) { builder.Append("Caution: the sample did not conform to the expected cell frequency condition! "); } ABAlternative best = test.GetBestAlternative(); ABAlternative worst = test.GetWorstAlternative(); builder.Append(String.Format(@" The best alternative you have is: [{0}], which had {1} conversions from {2} participants ({3}). " , best.Content , best.Conversions , best.Participants , best.PrettyConversionRate )); if (p == 1) { builder.Append("However, this result is not statistically significant."); } else { builder.Append(String.Format(@" This difference is <b>{0} likely to be statistically significant (p <= {2})</b>, which means you can be {1} that it is the result of your alternatives actually mattering, rather than being due to random chance. However, this statistical test can't measure how likely the currently observed magnitude of the difference is to be accurate or not. It only says ""better"", not ""better by so much"". ", //Percentages[p], ToPercentageString(p), Descriptions[p], p )); } return builder.ToString(); }
public string GetResultDescription(Experiment test) { double p; try { p = GetPValue(test); } catch (Exception e) { return e.Message; } StringBuilder builder = new StringBuilder(); //CF: This is wrong. The assumption for a two-proportion z-test is that each sample have at least 10 succeses AND 10 failures! //if (Alternatives[0].Participants < 10 || Alternatives[1].Participants < 10) if (test.Alternatives.Count(x => !x.SampleMeetsTestAssumtions) > 0) { builder.Append("Take these results with a grain of salt since your samples do not meet the required assumptions: "); } ABAlternative best = test.GetBestAlternative(); ABAlternative worst = test.GetWorstAlternative(); builder.Append(String.Format(@" The best alternative you have is: [{0}], which had {1} conversions from {2} participants ({3}). The other alternative was [{4}], which had {5} conversions from {6} participants ({7}). " , best.Content , best.Conversions , best.Participants , best.PrettyConversionRate , worst.Content , worst.Conversions , worst.Participants , worst.PrettyConversionRate )); if (p == 1) { builder.Append("However, this difference is not statistically significant."); } else { builder.Append(String.Format(@" This difference is <b>{0} likely to be statistically significant (p <= {2})</b>, which means you can be {1} that it is the result of your alternatives actually mattering, rather than being due to random chance. However, this statistical test can't measure how likely the currently observed magnitude of the difference is to be accurate or not. It only says ""better"", not ""better by so much"". ", //Percentages[p], ToPercentageString(p), Descriptions[p], p )); } return builder.ToString(); }
public string GetResultDescription(Experiment test) { double p; try { p = GetPValue(test); } catch (Exception e) { return(e.Message); } StringBuilder builder = new StringBuilder(); //CF: This is wrong. The assumption for a two-proportion z-test is that each sample have at least 10 succeses AND 10 failures! //if (Alternatives[0].Participants < 10 || Alternatives[1].Participants < 10) if (test.Alternatives.Count(x => !x.SampleMeetsTestAssumtions) > 0) { builder.Append("Take these results with a grain of salt since your samples do not meet the required assumptions: "); } ABAlternative best = test.GetBestAlternative(); ABAlternative worst = test.GetWorstAlternative(); builder.Append(String.Format(@" The best alternative you have is: [{0}], which had {1} conversions from {2} participants ({3}). The other alternative was [{4}], which had {5} conversions from {6} participants ({7}). " , best.Content , best.Conversions , best.Participants , best.PrettyConversionRate , worst.Content , worst.Conversions , worst.Participants , worst.PrettyConversionRate )); if (p == 1) { builder.Append("However, this difference is not statistically significant."); } else { builder.Append(String.Format(@" This difference is <b>{0} likely to be statistically significant (p <= {2})</b>, which means you can be {1} that it is the result of your alternatives actually mattering, rather than being due to random chance. However, this statistical test can't measure how likely the currently observed magnitude of the difference is to be accurate or not. It only says ""better"", not ""better by so much"". " , //Percentages[p], ToPercentageString(p), Descriptions[p], p )); } return(builder.ToString()); }