Function to calculate the lower CI, upper CI, percentages and counts, and significance of difference from one or multiple baseline percentages, given supplied confidence level using
calculate_binom_baseline(data_df, baseline_female, confidence_level = 0.95)dataframe in output from reshape_for_binomials
containing the columns: female, male, which contain the integer counts of
males and females respectively and must be a numeric vector greater than 0.
female baseline in percentage from baseline.
confidence level to use for significance calculation, default is 0.95
This function returns a dataframe with additional columns than the input one:
lower_CI = lower confidence level of confidence interval expressed as a percentage
upper_CI = upper confidence level of confidence interval expressed as a percentage
lower_CI_count = lower confidence level of confidence interval expressed as a count
upper_CI_count = upper confidence level of confidence interval expressed as a count
significance = flag indicating whether difference of female percentage with baseline percentage is significant for the row in consideration. It has values "significant" or "" if not.