Use equal individual allocation, a two-sided 5% test as in part (a), 80% power, complete four-week ascertainment and the supplied fatal-overdose endpoint. Then , , and . Substituting into the sample size for comparing two proportions gives
Rounding upward for equal allocation gives
The corresponding expected endpoint counts are about 148 in the control arm and 103 in the active arm. The one-third eligibility proportion affects how many prisoners must be screened, not the number of eligible participants randomized; at full consent and eligibility ascertainment, roughly three times this randomized total would need screening. Loss to follow-up, nonadherence or a changed baseline mortality risk would require a separate design adjustment.
The wording needs an endpoint qualification. The supplied risk is death from overdose, and the proposed effect concerns preventing those deaths. It does not give the incidence of all overdoses. Thus the calculation above sizes fatal overdoses, the intended endpoint supported by the data. For a literal 30% reduction in all overdoses, the unknown baseline incidence must replace in the formula, with . This is the endpoint-specific rare-event sample size issue: the same fatal risk can coexist with many nonfatal rates. For example gives about 29525 per arm, whereas gives about 2838; knowing only the fatal rate cannot determine that latter sample size.
Specify the expected control-group event probability at the chosen follow-up time, the intervention probability or smallest clinically important absolute reduction to detect, the primary test's significance level and whether it is one- or two-sided, the desired statistical power, and the allocation ratio. Statistical power is the probability of rejecting the null hypothesis under that specified alternative; its complement is the Type II error probability.
For two independent binary-outcome groups, these probabilities determine the response variances needed by the sample-size calculation. Also specify how much loss to follow-up is anticipated when converting the required evaluable sample into a recruitment target. Here the design is balanced and the stated primary significance level is . A target statistical power such as or and the anticipated event probabilities cannot be recovered from the sample size alone, so they should not be invented. The recruitment inflation allows for attrition rather than changing the target effect.
Under the one-test-per-day interpretation, A spreads surveillance across all five days and is operationally straightforward, but uses only five tests per week and does not guarantee morning/afternoon representation. Within each day its uniform choice avoids systematically selecting a particular batch. B uses six tests, guarantees representation of both production periods, and spreads the selected batches over the week's production, though some weekdays can receive no test. C also uses six tests and may minimize the cost of collecting samples, but concentrates them on one randomly selected day.
If batches produced on the same day share contamination risks, C's six observations are positively correlated and provide less information than six dispersed batches. A simple equal-cluster-size approximation has design effect , where is within-day intraclass correlation; its effective sample size is consequently smaller than six when . C can also miss intermittent problems occurring on other days.
I would prefer B for estimating and comparing batch contamination rates, assuming positive within-day correlation and no overriding collection-cost advantage for C. It combines slightly more testing than A with explicit production-period coverage and avoids C's concentration on a single day. A is a reasonable alternative when regular daily surveillance is the priority. All three are legitimate probability samples with the stated inclusion probabilities; the preference concerns precision and coverage, not a claim that C is intrinsically biased. Their relative efficiency is not universal without a model for production variability and costs.
The Wald statistic has law . Write for continuation. By the normal cumulative distribution function,
The final sample size per arm is , so
It lies between and , increasing with the treatment effect: a more promising treatment is more likely to reach full enrollment. Total expected recruitment over both arms is twice this expression. Equality at the futility boundary has probability zero under the normal model.
At stage 1, the maximum-likelihood estimators of the two normal arm means are their sample means. Their difference estimates the treatment effect:
Each arm has patients and variance , so independence across arms gives
The quantity is the Fisher information for the mean difference when the common variance is known. The PDF's preliminary expression uses for the variance denominator, although indexes arms and is not defined. The stage-specific sample size is ; the calculation uses this intended reading, consistent with the specified per-arm recruitment and the later weighted estimator. Fresh stage-2 patients are independent of stage-1 patients in the usual trial model; the cumulative stage means themselves are not independent across stages.
First agree the scientific question and primary response variable. Ask the vet about the disease's course, the proposed mechanism and duration of each treatment, the eligible population, baseline severity, and what outcome and follow-up time would represent worthwhile improvement. Is the disease transmissible, is recovery reversible, and can treating one cow affect another's outcome? These answers determine whether a crossover design is credible, whether the experimental unit should be a cow or a whole herd, and whether individual randomization would leave interference between groups. Agree welfare and rescue arrangements with the vet when deciding which comparisons are feasible; the statistical plan cannot determine these from an unfamiliar disease name.
Second agree feasible allocation and adequate independent replication. Discuss numbers of available cows and herds, variation in the chosen outcome, a scientifically meaningful treatment difference, and the desired statistical power. Use these to plan sample size, rather than choosing a number solely from convenience. Discuss herd, lactation stage and initial severity as potential blocks in experimental design, then specify randomization, comparable management, concealed allocation and blinded outcome assessment where feasible. Repeated milk or health records from the same cow are observational units, not extra independent experimental units; pseudoreplication would give misleading standard errors. Availability of enough independent cows or herds, together with expected variation, governs the precision actually achievable.
Let denote a quantile of the standard normal distribution. Reject when . The statistical power at the specified positive effect is
Equating this to and using gives . Thus, for the usual target ,
Rounding up ensures at least the target statistical power. This normal-mean sample size calculation assumes a positive integer sample size; if a requested power is at most , every positive sample size already exceeds that target for , and one should not square a negative quantile sum to impose an unnecessary lower bound.
For , the optimum is . The supplied two-sided sample size formula gives
so round upward to patients in each new-treatment arm and take . The analyzed total is therefore
Allowing for ten percent attrition requires
patients to be recruited.
For equal arm size , write at the clinically relevant alternative. A one-sided level- Wald test rejects when , and its approximate statistical power is
Equating this to gives the per-arm sample size
rounded up. If the design uses a null-based critical standard error but an alternative standard error , the corresponding more general formula is
Prior probability Created 2026-09-24 Updated 2026-10-14
Prior probability describes uncertainty before the current observations are incorporated. For a statistical parameter , a prior distribution assigns probabilities to its possible ranges, conditional on background information and a statistical model. A continuous prior density specifies these probabilities through integration:
Here the probability density function is relative to Lebesgue measure ; a discrete prior distribution instead uses a probability mass function and sums. Density at one point is not the probability of that point. A nonnegative kernel with infinite total mass is an improper prior, whose use requires a separate check of posterior propriety.
For the coin model in Bayesian statistics, the beta distribution has prior density on . Its mean is and its variance is . It favors moderate heads probabilities without ruling out values near zero or one. For example,
The prior curve in Bayesian posterior makes this preference visible; moment matching for a beta prior explains how to choose a beta distribution from a desired mean and variance.
A prior distribution lets earlier evidence or elicited knowledge contribute to statistical inference when the current sample size is limited. It also exposes assumptions that can be checked by prior elicitation and a prior predictive check. Before the same eight heads and two tails, a uniform prior would give posterior mean , compared with under : the observations do not uniquely determine a Bayesian posterior. Even a uniform prior makes a choice of parameter coordinates; its child article explains why changing coordinates can destroy uniformity.
For equal independent binomial samples, the displayed normal-approximation size per group targets a two-sided significance level and power at specified alternative rates, with . Its first variance term sets the null critical value and its second the alternative distribution. A numerical sample size is not determined by an effect ratio alone; power, sidedness, allocation and baseline rates must also be specified. Rare-event discreteness and clustered designs can materially change the achieved power.
Sampling fraction 2026-10-14
The sampling fraction is the sample size divided by the finite population size. In simple random sampling, it determines how much the finite population correction reduces the variance relative to .
Simple random sampling Created 2026-10-07 Updated 2026-10-14
Here simple random sampling means a random unordered subset of exactly distinct labels from , with every size- subset equally likely. The sample size is fixed in advance, , and sampling without replacement prevents duplicate units. This is SRSWOR; some texts also use "simple random sampling" for independent uniform draws with replacement, which is a different design.[ref]
Every label has inclusion probability , but equal inclusion probabilities alone are insufficient. For example, from six labels choose either or with probability . Each label is included with probability , yet eighteen of the twenty size-three subsets are impossible: this is a two-group cluster sampling design. Unequal probability sampling deliberately changes inclusion probabilities, often to improve precision for a particular estimand, and generally requires an appropriately weighted estimator rather than the plain sample mean.
Consider the original mathematical population with labelled values , and let . The fifteen equiprobable subsets, followed by their sample means, are
Their sample means sum to , giving expected value . Their squared deviations from sum to , giving variance . This is an enumeration over hypothetical selections from six stipulated numbers, not measured survey data.
Figure 1.
All fifteen size-two subsets and all thirty-six ordered replacement outcomes from six labelled values
. Details.
With independent uniform sampling with replacement, the ordered outcomes each have probability . The two orders and are distinct outcomes, and is now possible. Forgetting order does not make the resulting unordered multisets equiprobable: has probability but has probability . The thirty-six sample means still have expected value , but their squared deviations sum to , giving variance . Avoiding duplicate labels improves precision for this fixed population.
Statistical inference Created 2026-09-24 Updated 2026-10-13
Statistical inference uses observed data and a statistical model to learn about unknown features of the process that generated them. In a parametric statistical model, write : the probability distribution depends on an unknown statistical parameter . An estimand specifies the target, such as a mean or a difference of means. A statistic is a function of the observations; an estimator is a statistic used to estimate the target. Uppercase denotes the random data before observation, while lowercase denotes their realized values.
Three questions lead to different outputs. Statistical estimation asks which target value the observations suggest. A confidence interval asks for a range produced by a procedure with calibrated coverage probability. A hypothesis test asks whether the observations depart sufficiently from a specified null hypothesis to enter its rejection region. These outputs complement one another: an estimated effect size describes magnitude, while a standard error describes the sampling distribution of an estimator. A p-value describes a tail probability under the null hypothesis.
The appeal of statistical inference is that it turns variable observations into reproducible uncertainty statements. In the normal mean confidence interval with known variance below, a sample mean of has standard error : both the estimated shift and its precision matter. The calibration depends on the statistical model, including independence and the specified probability distribution. Increasing sample size improves precision under those assumptions; it does not repair a systematically misleading sampling procedure. Bayesian inference provides another framework, using a prior distribution and a likelihood function to obtain a posterior distribution.
A clinical trial comparison must define a common time origin and observation window for both assigned treatments. A probability measured from allocation cannot be replaced by one measured from a later treatment-dependent release or discharge. The latter may describe a different time interval and a selected population. A numerical sample size cannot be obtained by silently treating those probabilities as interchangeable.
The two-sample Kolmogorov-Smirnov test compares two empirical distribution functions from independent samples, each internally independent and identically distributed, under the null hypothesis that their underlying probability distributions coincide. Both curves are estimated from data, so calibration depends on both sample sizes; the usual asymptotic scaling is . Tied data can be handled by an appropriate permutation test under the required exchangeability, rather than by assuming the untied continuous-null law.[ref]