Let be the number allocated to each arm and test equality of the two reconviction probabilities, with a specified target difference as the alternative. For equal independent binomial arms, put , , and . Under the null the rejection boundary for is approximately ; under the planning alternative its mean is and variance is . statistical power 0.8 is obtained approximately by requiring
Thus the sample size for comparing two proportions is
where , for a two-sided test, or for a prespecified one-sided superiority test. With and , this simplifies to
For illustration only, at this gives 35 per arm, 70 total, for a two-sided test, or 27 per arm, 54 total, for a one-sided test. No unique numerical count is specified until alpha and sidedness are fixed. These are normal planning approximations; an exact requirement can be checked by summing the probabilities, from the two independent binomial distributions, of all tables in an exact test's rejection region and increasing until statistical power is at least 0.8.
This calculation detects a treatment difference when the effect equals the proposed target. It does not promise 80% statistical power to establish that the reduction is at least that target via a confidence bound when the true effect lies exactly at the target boundary. Such a different testing objective needs a separately specified null and planning alternative. Complete follow-up and ascertainment by intention-to-treat analysis are also required.
There is a time-window discrepancy in the printed request: the probabilities supplied concern 26 weeks after sentence, whereas this part asks about 26 weeks after release. The prison data specify only the first 14 post-release weeks. The literal release-based comparison is not numerically identified without further follow-up risks and a common time origin for both arms.
For the intended common 26-week sentence-based endpoint, plan specifically for a 12% relative reduction from . Then , and . At 50% statistical power, , so the rare-event collaboration size at half power is
Each system contributes 10,000 participants per arm. Therefore
At , this is five systems for a two-sided test, or four systems for a prespecified one-sided test. For the two-sided calculation the required size is approximately 49,681 per arm, giving a 100,000-participant collaborative design after rounding to whole systems.
The 12% planning reduction is not the reduction implied by part (c): versus gives 10.2%. If one instead powers that calculated effect, the corresponding formula is , giving seven systems at two-sided 5%. Rounding the first mortality estimate to changes the latter answer to eight systems, so it should not be silently substituted into the 12% calculation. All these counts assume independent individual outcomes and the common sentence-based window; the time-origin alignment of clinical endpoints is essential.
A simple hypothesis specifies the entire probability distribution. A critical region is the set of observations for which the null hypothesis is rejected. The size of a statistical test is , which reduces to for a simple hypothesis. The power function is as a function of the true parameter or distribution. At a specified alternative, the Type II error probability is , the chance of failing to reject a false null hypothesis. The Type I error probability is the corresponding rejection probability under the null hypothesis.
The Neyman-Pearson lemma says that, for two simple hypotheses, a test rejecting where , accepting where , and if necessary randomizing on equality to achieve prescribed size , has maximal statistical power among tests of size at most . Conversely a most powerful test can be taken in this likelihood ratio form, up to equality sets and null sets.
Here the likelihood ratio for is
Its value is infinite at , which has probability zero under both continuous distributions. Large likelihood ratios correspond to small . Thus the best critical region is , where
There is no boundary randomization to worry about. The complete answer is
For the minimum sum of errors in a simple hypothesis test, write the error sum as . At each observation its smaller contribution is obtained by rejecting exactly where . This proves optimality over all tests, including randomized ones, rather than just optimizing within an assumed family. Here it gives , and therefore
The minimum error sum is . This criterion weights the two error probabilities equally; it does not impose a conventional significance level.
Assume equal allocation of independent offenders to each arm and a two-sided statistical test of significance level . Write for P30 and for initial community-service assignment, with and . The two event counts have independent binomial distributions. Under the stated alternative, the difference of sample proportions is approximately a normal distribution with mean and variance
The pooled two-proportion test has approximate upper rejection threshold at the planning rates, where is the standard normal quantile. To obtain statistical power against a positive difference, place the alternative mean alternative-standard-errors above that threshold:
Solving yields the usual sample size for comparing two proportions:
per arm, rounded upwards, with total sample size . This targets the dominant rejection tail under the planning alternative; an exact power calculation can include the very small opposite-tail probability or use the binomial distributions directly.
For illustration, at , and , giving . Thus
For a prespecified one-sided test, replace by . The calculation assumes complete endpoint ascertainment, independent individual allocation and that the two initial-policy rates are appropriate; losses or clustered allocation would require corresponding design adjustments.
Mortality requires its own sample size calculation, rather than using the much commoner reconviction endpoint. Under the same specified exposure assumptions, the P30 schedule has 30 prison days, 30 high-risk post-release days, and 300 ordinary days. Its integrated hazard is
Hence its 360-day death probability is . For initial community-service assignment the preceding mixture gives . The absolute risk difference is therefore only about , or 16.8 fewer deaths per 10,000 initial assignments. The person-time approximation gives 145 versus 128 deaths per 10,000, a difference of 17.
As an illustrative design target, take two-sided significance level , statistical power and equal individual allocation. Apply the sample size for comparing two proportions formula with these mortality probabilities:
It gives about 74,600 participants per arm, or 149,200 altogether; using the simpler exposure approximations gives about 73,130 per arm. At 30,000 sentences per year, even if every offender were eligible and enrolled, this requires roughly five years of recruitment and another year to complete the final cohort's follow-up.
For scale, one year's equally allocated cohort has 15,000 per arm, with roughly 216 expected deaths after P30 and 191 after community-service assignment. The standard error of the risk difference is about , so the expected standardized separation is only about , below the usual two-sided 5% critical value. A one-year trial would consequently have poor statistical power for this mortality difference.
Thus mortality discrimination is much more demanding than reconviction discrimination. National recruitment and reliable linkage to death records could make a multiyear study feasible, but restricted eligibility, incomplete follow-up, or lower recruitment would lengthen it. A trial sized only for the 4-percentage-point reconviction difference would not provide a precise mortality comparison. The numerical conclusion depends on the supplied daily hazards, custody schedules, and the chosen power and significance targets; the prompt does not specify a mortality design target of its own.
Use equal allocation and a conventional two-sided 5% comparison of independent proportions. The assumed risks are and , giving target difference . Put and let be the number per arm.
The null critical difference is approximately . Under the alternative, the difference has standard deviation . For 80% statistical power, the target difference must exceed the critical difference by alternative standard deviations. Solving gives the sample size for comparing two proportions
This is about per arm, or altogether. Rounding for planning:
The rare-event Poisson approximation gives a similar answer. This assumes the stated baseline risk applies, no endpoint loss, and no attenuation by treatment contamination. The two-sided convention is explicit: a one-sided 5% test would require fewer participants.
Let the prior odds be , so . The Type I error gives , while the statistical power gives . By Bayes' theorem,
This is a posterior probability of the null, not the false-positive probability conditional on the null. The distinction is the base-rate effect in a positive study.
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.
The clinical interview produced far fewer events, so the trial may have had substantially less statistical power for that measurement than for the screening-scale threshold. Its intervention-versus-control difference is less striking: the crude event proportions are about and , based on only 37 diagnoses altogether. A concise abstract may therefore have emphasized the more statistically convincing screening result. These are possible explanations, not evidence of the authors' motives.
Nevertheless, a prespecified primary measure should not disappear merely because its result is less favourable. Selective outcome reporting could make the evidence seem more consistent across primary measurements than it is. A reasonable abstract should at least acknowledge the clinical result and its uncertainty, while distinguishing a positive screen from a diagnosis. Limited space can justify brevity, but not a misleading implication that both primary measures provide the same evidence.
The unexpectedly low clinical prevalence also merits investigation, including the telephone interview's implementation, timing, recruitment and diagnostic definition. A meta-analysis of different studies is not automatically a like-for-like reference population; its higher pooled percentage does not by itself establish measurement failure in this trial.
Use a concurrent comparison: test the same specimens for both cocaine and mephedrone, rather than treating the historical cocaine percentage as an exactly known 2010 parameter. Assume representative sampling of privates, effectively independent specimens, stable underlying rates during the sampling period, and sufficiently accurate assays. I use a two-sided 5% test of equal positive-test probabilities, with 80% statistical power at and . This is a design to distinguish the rates at a twofold alternative; a significance test does not prove that their ratio is exactly two.
The paired design needs the joint positive-test distribution. For specimen , write and . Put and
Then and . Under equal marginal rates, the two discordant outcomes have equal probabilities; conditional on the total number of discordant specimens, their split is a fair binomial distribution. This gives the McNemar test. Its large-sample version rejects for a sufficiently large absolute difference between the discordant counts, divided by their estimated standard deviation.
For planning, suppose simultaneous positives are negligible, so . Under the alternative the difference in positive counts has mean and standard deviation ; the approximate upper null rejection boundary is . Requiring 80% upper-tail rejection probability gives the paired binary sample size calculation
Add the mephedrone assay to about 5,000 existing tests, roughly ten weeks at 500 per week. An exact conditional-power calculation under the negligible-overlap model gives about at 4,707 specimens and at 5,000, so the rounding also compensates for the conservative discrete test. If positivity for the two drugs were independent within a specimen, , giving a very similar requirement of about 4,676. For the stated marginal rates, , so negligible overlap is a conservative variance choice within this approximation. Substantial co-use reduces the discordant proportion and changes the necessary size. Repeated tests on the same person, unit-level clustered data or inaccurate assays can instead reduce effective information and require more specimens.
A pre-specified one-sided 5% comparison would use in place of and require about 3,708 specimens before allowing for discreteness under the negligible-overlap assumption. These are different testing conventions. Treating the historical 1% as fixed would give a one-sample calculation, but would ignore uncertainty or changes in the actual 2010 cocaine rate.
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.
Under the usual normal linear model for independent orchard means with common error variance, the treatment ratios have null F-distributions with denominator six statistical degrees of freedom. Their upper-tail P-values are approximately
Use the unrounded ratios when evaluating these P-values. Thus none of spray, pruning or their interaction term is significant at a 5% significance level. Spray gives modest evidence if a 10% significance level was chosen in advance, but this is not strong evidence.
Failure to reject does not establish absence of treatment effects. Only two orchards per combination and six residual statistical degrees of freedom leave considerable uncertainty and potentially low statistical power. The table alone cannot give the direction or magnitude of individual effects: that requires treatment means. These model-based F-tests also rely on appropriate orchard allocation and comparable residual variation; they should not be interpreted as unconditional conclusions from the table alone.
Put . Independence gives a likelihood ratio
Since , this is strictly increasing in . A threshold chosen between its values at and gives precisely the stated upper-tail critical region, so it is a likelihood-ratio test.
The sum has a Poisson distribution with mean . Thus the size of a statistical test and its statistical power at are
For the grouped-area problem, let , , . The null log likelihood, up to data-only constants, is
The maximum-likelihood estimate is , giving fitted means and in the two groups. Under the alternative, the fitted group means are and .
Use the increasing generalized likelihood-ratio test convention , consistent with the printed positive . The exponential and factorial factors cancel, yielding the likelihood-ratio test of area-proportional Poisson means
Terms with zero count are interpreted as ; if , take . If the inverse ratio is used, the reported test statistic is instead .
Under the null, the regular large-sample Wilks theorem approximation is : the alternative has two rate parameters and the null one. The value far exceeds the usual critical value, about , and has approximate tail probability . Thus reject proportionality of the expected counts to area: the two groups show evidence of different territory densities. The statistic alone does not say which group has greater density; that requires versus . For small counts, an exact conditional test uses under the null instead of the asymptotic calibration.
The same affine transformation of the normal distribution gives
Its variance stays one while its mean moves positively. This is the exact alternative distribution used to calculate statistical power. The square, if used instead, has a noncentral chi-squared distribution with one degree of freedom and noncentrality .
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.