Grouped Bernoulli failure counts (source code)

= Grouped Bernoulli failure counts
{title2=$\widehat p=\sum_jX_j/(mq)$}

With $m$ groups of $q$ trials and common marginal failure <probability> $p$, each count $X_j$ has <expectation> $qp$, so the displayed estimate is unbiased without assuming <independence> within groups. <independent> individual trials give <variance> $p(1-p)/(mq)$. If only groups are <independent>, estimate the <variance> instead by $s_X^2/(mq^2)$, retaining within-group dependence. Equal marginal <probabilities> alone do not justify a binomial <confidence interval>.