Signature
theta = (log(Delta) / sigma_W0)^2; x = d^2 - SE^2; boundx = max(abs(d - t_crit * SE), abs(d + t_crit * SE))^2; y = -theta * s2_WR; boundy = y * df_WR / chi2_95; critbound = x + y + sqrt((boundx - x)^2 + (boundy - y)^2); s_WR = sqrt(s2_WR); L_s = exp(-sqrt(theta) * s_WR); U_s = exp(sqrt(theta) * s_WR); BE_s = (critbound <= 0)
| Inputs | Definition | Unit |
|---|---|---|
Delta | Limit in theta, 1.25 for highly variable drugs and 1/0.9 for narrow therapeutic index drugs, which the FDA code types as 1.11111 | ratio |
sigma_W0 | Regulatory constant, 0.25 for highly variable drugs and 0.10 for narrow therapeutic index drugs | natural log units |
d | Estimated difference in log means, test minus reference, the SAS estimate | natural log units |
SE | Standard error of d, the SAS stderr | natural log units |
t_crit | 95th percentile of t on the degrees of freedom of the model for d, which yields the 90% interval of the SAS code | dimensionless |
s2_WR | Estimated within-subject variance of the log measure for the reference product | squared natural log units |
df_WR | Degrees of freedom of s2_WR, the SAS dfd | count |
chi2_95 | 95th percentile of the chi-square distribution on df_WR degrees of freedom, the SAS cinv(0.95,dfd) | dimensionless |
theta | Scaled average bioequivalence limit, the square of log(Delta) divided by sigma_W0 | dimensionless |
|---|---|---|
x | Squared difference in log means less the squared standard error, the SAS quantity x | squared natural log units |
boundx | Square of the larger absolute limit of the 90% interval for the log difference | squared natural log units |
y | Minus theta times the reference within-subject variance | squared natural log units |
boundy | Variance term scaled by its degrees of freedom over the upper chi-square quantile | squared natural log units |
critbound | 95% upper confidence bound of the reference-scaled criterion | squared natural log units |
s_WR | Square root of s2_WR | natural log units |
L_s | Lower limit on the ratio implied by the criterion at the estimated s_WR (derived) | ratio |
U_s | Upper limit on the ratio implied by the criterion at the estimated s_WR (derived) | ratio |
BE_s | Equals 1 (true) when critbound is at or below 0 and 0 (false) otherwise | binary indicator |
Function
Two one-sided tests and scaled limits function for bioequivalence
Maps a study's difference in log means, its standard error and the reference product's within-subject variability to the statistics behind a bioequivalence decision. It takes d, SE, t_crit and a pair of acceptance limits to the two one-sided t statistics, the reference coefficient of variation to the EMA widened limits for Cmax, the reference within-subject variance to the FDA reference-scaled upper bound, and two within-subject standard deviations to the FDA upper limit for their ratio. The 90% interval for the ratio is HE-FM-ANDA-001, the rounded check against 80.00% to 125.00% is HE-VT-ANDA-001, the crossover standard error is HE-FM-ANDA-002 and the post-entry generic price is HE-FM-ANDA-003; these live records are cited and not repeated. Notation follows the Bioequivalence article.
Computational function
Computational function for the FDA mixed scaling verdict on subject-level replicate data
Takes subject-level log Cmax or log AUC from a three-sequence partial replicate study (TRR, RTR, RRT) to the FDA mixed scaling verdict for a highly variable drug. It forms each subject's difference I between the test value and the mean of the two reference values, and D between the two reference values, as Appendix G does, and it fits the sequence means by least squares, which is the PROC GLM analysis of the FDA code. It then applies the mixed scaling rule of section III.C, the reference-scaled test of HE-FM-BIO-003 with the point estimate constraint when s_WR is at least 0.294, and otherwise the interval of HE-FM-ANDA-001 against the unscaled limits, the same decision as HE-FM-BIO-001. On the unscaled route the code keeps the d and SE of the model for I, a simplification chosen here (derived). Appendix G gives code for the scaled route only, and Appendix C gives PROC MIXED statements with Satterthwaite degrees of freedom for the unscaled analysis of a replicate crossover, so a submission's interval on that route can differ. The code does not apply the rounding of HE-VT-ANDA-001. The calculator line takes the sequence summaries, and the Excel, R and Python versions start from the subject table.
Inputs and outputs:
I_1,I_2andI_3are the sequence means of I;n_1,n_2andn_3the subjects per sequence;MS_IandMS_Dthe pooled within-sequence mean squares of I and D;t_critthe 95th percentile of t ondf_WR;df_WRthe total subjects less the number of sequences;chi2_95the 95th percentile of chi-square ondf_WR;Delta,sigma_W0,s_lim,L_0andU_0the constants 1.25, 0.25, 0.294, 0.80 and 1.25; outputsd,SE,s2_WR,s_WR,theta,GMR,GMR_L,GMR_U,x,boundx,y,boundy,critboundandBE_HVD, which is 1 when the verdict is bioequivalent. In the codeseq,T,R1andR2are equal-length vectors, one element per subject.Assumption: Each subject has one test value and two reference values on the natural log scale, and missing periods are not handled. The FDA code uses PROC MIXED for a fully replicate design, with degrees of freedom from that procedure, so this code is for the partial replicate design only. With no more subjects than sequences the R and Python stop with an error message and Excel returns #DIV/0!. With identical reference doses in every subject, s_WR is 0 and the unscaled route applies. A sequence with one subject is accepted and adds no degrees of freedom.
Worked example (Illustrative 12-subject study that passes only through scaling): Illustrative log values, one subject per entry, are sequence 1, T 4.52, R1 4.78, R2 4.14; sequence 1, T 4.33, R1 4.53, R2 4.79; sequence 1, T 3.92, R1 4.66, R2 4.56; sequence 1, T 5.51, R1 5.09, R2 5.01; sequence 2, T 5.35, R1 5.09, R2 4.94; sequence 2, T 4.81, R1 4.58, R2 4.70; sequence 2, T 5.06, R1 5.24, R2 4.86; sequence 2, T 4.48, R1 3.60, R2 4.13; sequence 3, T 4.32, R1 3.96, R2 4.38; sequence 3, T 5.64, R1 5.98, R2 5.07; sequence 3, T 4.89, R1 4.58, R2 4.77; sequence 3, T 4.40, R1 4.97, R2 4.39. s_WR is 0.33807, at or above 0.294, so the scaled route applies. critbound is minus 0.0149 and the ratio is 1.0716, so the verdict is bioequivalent, although the unscaled upper limit of 1.2881 is above 1.25.
I_1 = -0.125; I_2 = 0.2825; I_3 = 0.05; n_1 = 4; n_2 = 4; n_3 = 4; MS_I = 0.12092; MS_D = 0.22858; t_crit = 1.83311; df_WR = 9; chi2_95 = 16.91898; Delta = 1.25; sigma_W0 = 0.25; s_lim = 0.294; L_0 = 0.80; U_0 = 1.25; d = 0.06917; SE = 0.10038; s2_WR = 0.11429; s_WR = 0.33807; theta = 0.7967; GMR = 1.0716; GMR_L = 0.8915; GMR_U = 1.2881; x = -0.00529; boundx = 0.06410; y = -0.09105; boundy = -0.04844; critbound = -0.0149; BE_HVD = 1Worked example (Illustrative study on the unscaled route): Illustrative summaries of a second 12-subject study with low variability, an s_WR of 0.09325. The route is the unscaled interval, 1.0220 to 1.0599, inside the limits, so critbound does not decide the verdict.
I_1 = 0.02625; I_2 = 0.0425; I_3 = 0.05125; n_1 = 4; n_2 = 4; n_3 = 4; MS_I = 0.00118; MS_D = 0.01739; t_crit = 1.83311; df_WR = 9; chi2_95 = 16.91898; Delta = 1.25; sigma_W0 = 0.25; s_lim = 0.294; L_0 = 0.80; U_0 = 1.25; d = 0.04; SE = 0.00992; s2_WR = 0.0087; s_WR = 0.09325; theta = 0.7967; GMR = 1.0408; GMR_L = 1.022; GMR_U = 1.0599; x = 0.00150; boundx = 0.00338; y = -0.00693; boundy = -0.00368; critbound = -0.00168; BE_HVD = 1Excel: Enter each subject's three log values in columns and compute I as
=LogTest-(LogRefOne+LogRefTwo)/2and D as=LogRefOne-LogRefTwoin helper columns. Name the sequence blocks IDiffFirstSeq, IDiffSecondSeq, IDiffThirdSeq, RDiffFirstSeq, RDiffSecondSeq and RDiffThirdSeq. Then ResidualCF holds=COUNT(IDiffFirstSeq)+COUNT(IDiffSecondSeq)+COUNT(IDiffThirdSeq)-3, MeanSquareI holds=(DEVSQ(IDiffFirstSeq)+DEVSQ(IDiffSecondSeq)+DEVSQ(IDiffThirdSeq))/ResidualCF, MeanSquareD holds the same with the RDiff ranges, MeanDiffCF holds=(AVERAGE(IDiffFirstSeq)+AVERAGE(IDiffSecondSeq)+AVERAGE(IDiffThirdSeq))/3, SEDiffCF holds=SQRT(MeanSquareI*(1/COUNT(IDiffFirstSeq)+1/COUNT(IDiffSecondSeq)+1/COUNT(IDiffThirdSeq)))/3and RefSDCF holds=SQRT(MeanSquareD/2). With TQuantileCF=T.INV(0.95,ResidualCF)and ChiCF=CHISQ.INV(0.95,ResidualCF), the cell CritBoundCF holds=MeanDiffCF^2-SEDiffCF^2-(LN(1.25)/0.25)^2*RefSDCF^2+SQRT((MAX(ABS(MeanDiffCF-TQuantileCF*SEDiffCF),ABS(MeanDiffCF+TQuantileCF*SEDiffCF))^2-MeanDiffCF^2+SEDiffCF^2)^2+((LN(1.25)/0.25)^2*RefSDCF^2*(1-ResidualCF/ChiCF))^2), and VerdictCF holds=IF(RefSDCF>=0.294,IF(AND(CritBoundCF<=0,EXP(MeanDiffCF)>=0.8,EXP(MeanDiffCF)<=1.25),1,0),IF(AND(EXP(MeanDiffCF-TQuantileCF*SEDiffCF)>=0.8,EXP(MeanDiffCF+TQuantileCF*SEDiffCF)<=1.25),1,0)).R:
be_hvd <- function(seq, T, R1, R2, Delta = 1.25, s0 = 0.25, slim = 0.294, L0 = 0.8, U0 = 1.25) { I <- T-(R1+R2)/2; D <- R1-R2; m <- length(unique(seq)); df <- length(T)-m; if (df < 1) stop("more subjects than sequences are needed"); key <- as.character(seq); Im <- tapply(I, seq, mean); Dm <- tapply(D, seq, mean); ns <- tapply(I, seq, length); MSI <- sum((I-Im[key])^2)/df; MSD <- sum((D-Dm[key])^2)/df; d <- mean(Im); SE <- sqrt(MSI*sum(1/ns))/m; s2 <- MSD/2; tq <- qt(0.95, df); chi <- qchisq(0.95, df); th <- (log(Delta)/s0)^2; x <- d^2-SE^2; bx <- max(abs(d-tq*SE), abs(d+tq*SE))^2; y <- -th*s2; by <- y*df/chi; cb <- x+y+sqrt((bx-x)^2+(by-y)^2); sw <- sqrt(s2); gl <- exp(d-tq*SE); gu <- exp(d+tq*SE); be <- if (sw >= slim) cb <= 0 && exp(d) >= L0 && exp(d) <= U0 else gl >= L0 && gu <= U0; list(d = d, SE = SE, s2 = s2, sWR = sw, critbound = cb, GMR_L = gl, GMR_U = gu, BE = be) }Called with the first example's table, it returnssWR0.33807,critboundminus 0.01491 andBETRUE.Python:
def be_hvd(seq, T, R1, R2, Delta=1.25, s0=0.25, slim=0.294, L0=0.8, U0=1.25): from scipy.stats import t as tdist, chi2; from math import exp, log, sqrt; groups = sorted(set(seq)); df = len(T)-len(groups); assert df >= 1, 'more subjects than sequences are needed'; I = [a-(b+c)/2 for a, b, c in zip(T, R1, R2)]; D = [b-c for b, c in zip(R1, R2)]; gI = [[x for x, s in zip(I, seq) if s == g] for g in groups]; gD = [[x for x, s in zip(D, seq) if s == g] for g in groups]; mI = [sum(v)/len(v) for v in gI]; mD = [sum(v)/len(v) for v in gD]; ssI = sum((x-m)**2 for v, m in zip(gI, mI) for x in v); ssD = sum((x-m)**2 for v, m in zip(gD, mD) for x in v); d = sum(mI)/len(groups); SE = sqrt(ssI/df*sum(1/len(v) for v in gI))/len(groups); s2 = ssD/df/2; tq = float(tdist.ppf(0.95, df)); chi = float(chi2.ppf(0.95, df)); th = (log(Delta)/s0)**2; x = d**2-SE**2; bx = max(abs(d-tq*SE), abs(d+tq*SE))**2; y = -th*s2; by = y*df/chi; cb = x+y+sqrt((bx-x)**2+(by-y)**2); sw = sqrt(s2); gl = exp(d-tq*SE); gu = exp(d+tq*SE); be = (cb <= 0 and L0 <= exp(d) <= U0) if sw >= slim else (gl >= L0 and gu <= U0); return dict(d=d, SE=SE, s2=s2, sWR=sw, critbound=cb, GMR_L=gl, GMR_U=gu, BE=be)Needs SciPy. Called with the first example's table, it returnssWR0.33807,critboundminus 0.01491 andBETrue.Test (Illustrative table, upper bound): With the first example's table, CritBoundCF is compared with minus 0.0149. Expected result TRUE. FALSE shows a cell doubled (minus 0.0298) or halved (minus 0.0075), and MeanSquareD not halved, which gives minus 0.0775. Excel check
=ABS(CritBoundCF+0.0149)<0.0005Test (Illustrative table, reference standard deviation): With the same table, RefSDCF is compared with 0.33807. Expected result TRUE. FALSE shows a cell doubled (0.67614) or halved (0.16904), and the D differences centred on the overall mean in place of their sequence means (0.34862). Excel check
=ABS(RefSDCF-0.33807)<0.0002Common error (Taking the plain mean across unequal sequences): Taking the plain mean of I across all subjects equals the mean of sequence means only when the sequences are the same size. With sequences of 5, 4 and 3 subjects holding sequence means of minus 0.125, 0.2825 and 0.05, the plain mean is 0.0546 against 0.0692.
Common error (Using the unscaled interval as well as the scaled route): Above the threshold the scaled route replaces the unscaled interval for a highly variable drug. The first example's unscaled upper limit of 1.2881 would fail the study that the mixed scaling rule passes. For narrow therapeutic index drugs the unscaled limits are an added condition, as HE-AS-BIO-008 says.
Source: US Food and Drug Administration, Center for Drug Evaluation and Research. Statistical Approaches to Establishing Bioequivalence: Guidance for Industry. Silver Spring, MD: FDA; May 2026. Section III.C and Appendix G, steps 1 to 3 and the SAS statements for a partially replicate three-way design; Appendix C for the unscaled analysis of a replicate crossover.
d = (I_1 + I_2 + I_3) / 3; SE = sqrt(MS_I * (1 / n_1 + 1 / n_2 + 1 / n_3)) / 3; s2_WR = MS_D / 2; s_WR = sqrt(s2_WR); theta = (log(Delta) / sigma_W0)^2; GMR = exp(d); GMR_L = exp(d - t_crit * SE); GMR_U = exp(d + t_crit * SE); x = d^2 - SE^2; boundx = max(abs(d - t_crit * SE), abs(d + t_crit * SE))^2; y = -theta * s2_WR; boundy = y * df_WR / chi2_95; critbound = x + y + sqrt((boundx - x)^2 + (boundy - y)^2); BE_HVD = ((s_WR >= s_lim) and (critbound <= 0) and (GMR >= L_0) and (GMR <= U_0)) or ((s_WR < s_lim) and (GMR_L >= L_0) and (GMR_U <= U_0))
Try this function
Implementations
Excel
Reference-scaled upper bound in named cells
With the inputs in cells named RegulatoryDelta, RegulatorySigma, MeanLogDiff, SELogDiff, RefVariance and RefVarianceDF, the ten formulas after the quantiles return, in order, cells named ScaledTheta, XTerm, BoundX, YTerm, BoundY, CritBound, RefWithinSDFDA, ScaledLimitLower, ScaledLimitUpper and ScaledPassed. The first two formulas fill TQuantile, from a cell named ModelDF, and ChiSquareUpper. A blank RegulatorySigma returns #DIV/0! and a blank RegulatoryDelta returns #NUM!.
=T.INV(0.95,ModelDF); =CHISQ.INV(0.95,RefVarianceDF); =(LN(RegulatoryDelta)/RegulatorySigma)^2; =MeanLogDiff^2-SELogDiff^2; =MAX(ABS(MeanLogDiff-TQuantile*SELogDiff),ABS(MeanLogDiff+TQuantile*SELogDiff))^2; =-ScaledTheta*RefVariance; =YTerm*RefVarianceDF/ChiSquareUpper; =XTerm+YTerm+SQRT((BoundX-XTerm)^2+(BoundY-YTerm)^2); =SQRT(RefVariance); =EXP(-SQRT(ScaledTheta)*RefWithinSDFDA); =EXP(SQRT(ScaledTheta)*RefWithinSDFDA); =IF(CritBound<=0,1,0)
Assumptions
Highly variable drugs use mixed scaling with a point estimate constraint
Section III.C and Appendix G apply a partial or fully replicate crossover to AUC and Cmax. If s_WR is below 0.294 the two one-sided tests of HE-FM-BIO-001 apply. Otherwise critbound must be at or below 0 and the point estimate of the ratio must fall within 0.8000 to 1.2500. BE_s alone is therefore not the verdict; HE-CF-BIO-001 returns the full rule, with the simplification on the unscaled route that it states.
Narrow therapeutic index drugs pass three conditions
Section III.B and Appendix F use a fully replicate crossover and need three things for each measure, critbound at or below 0, the unscaled limits of 80.00% to 125.00%, and the upper limit in HE-FM-BIO-004 at or below 2.500.
Quantiles and variance estimate as in the FDA code
The code forms the limits in boundx from a 90% interval and boundy from cinv(0.95,dfd). s2_WR is half the residual mean square of the within-subject differences of the two reference doses, with the sum of squares formula in Appendix F step 1 and Appendix G step 1. Appendix G asks for at least four significant figures in the comparison with 0.
Implied limits jump at the scaling threshold
With Delta of 1.25 and sigma_W0 of 0.25 the implied limit constant is 0.8926, so the limits are 80.00% to 125.00% just below an s_WR of 0.294 and 76.92% to 130.01% at 0.294 (derived). The implied limits describe the criterion at the point estimate only, and critbound also carries the uncertainty in d and s2_WR.
Worked examples
Highly variable drug that meets the scaled criterion
Illustrative partial replicate study with 36 subjects in three sequences, so 33 degrees of freedom, a difference in log means of 0.05, an SE of 0.06 and a reference variance of 0.16. critbound is minus 0.0830, so the criterion is met. The implied limits are 69.98% to 142.91%.
Delta = 1.25; sigma_W0 = 0.25; d = 0.05; SE = 0.06; t_crit = 1.69236; s2_WR = 0.16; df_WR = 33; chi2_95 = 47.39988; theta = 0.7967; x = -0.0011; boundx = 0.02296; y = -0.12747; boundy = -0.08875; critbound = -0.0830; s_WR = 0.4; L_s = 0.6998; U_s = 1.4291; BE_s = 1
Highly variable drug that misses the scaled criterion
Illustrative study with the same degrees of freedom, a difference of 0.20, an SE of 0.08 and a reference variance of 0.10. The point estimate of 1.2214 lies inside the implied limits of 75.41% to 132.61%, but critbound is plus 0.0364 once the uncertainty is counted, so the criterion is missed.
Delta = 1.25; sigma_W0 = 0.25; d = 0.20; SE = 0.08; t_crit = 1.69236; s2_WR = 0.10; df_WR = 33; chi2_95 = 47.39988; theta = 0.7967; x = 0.0336; boundx = 0.11249; y = -0.07967; boundy = -0.05547; critbound = 0.0364; s_WR = 0.3162; L_s = 0.7541; U_s = 1.3261; BE_s = 0
Narrow therapeutic index drug at a reference standard deviation of 0.10
Illustrative fully replicate study with a difference of 0.01, an SE of 0.012, a reference variance of 0.01 and 34 degrees of freedom, using the code's Delta of 1.11111. The implied limits are 90.00% to 111.11%, the figures in the article, and critbound is minus 0.00767.
Delta = 1.11111; sigma_W0 = 0.10; d = 0.01; SE = 0.012; t_crit = 1.69092; s2_WR = 0.01; df_WR = 34; chi2_95 = 48.60237; theta = 1.1101; x = -0.000044; boundx = 0.000918; y = -0.011101; boundy = -0.007765; critbound = -0.00767; s_WR = 0.1; L_s = 0.9; U_s = 1.1111; BE_s = 1
Bound falls to the point value with no sampling uncertainty
A limiting case with illustrative inputs. With an SE of 0 and chi2_95 set equal to df_WR, boundx equals x and boundy equals y, so critbound is the point value of the criterion.
Delta = 1.25; sigma_W0 = 0.25; d = 0.10; SE = 0; t_crit = 1.69236; s2_WR = 0.09; df_WR = 33; chi2_95 = 33; theta = 0.7967; x = 0.01; boundx = 0.01; y = -0.0717; boundy = -0.0717; critbound = -0.0617; s_WR = 0.3; L_s = 0.7651; U_s = 1.3070; BE_s = 1
Common errors
Swapping the EMA constant and the FDA constant
The FDA highly variable drug constant implied by 1.25 and 0.25 is 0.8926, while the EMA constant is 0.760. At an s_WR of 0.40 the implied upper limit is 142.91% under the FDA constants and 135.53% under the EMA constant, and the EMA form has a cap that the FDA form lacks.
Reading the bound as the whole verdict for a highly variable drug
A precise study with an illustrative ratio of 1.40, an SE of 0.03, a reference variance of 0.36 and 33 degrees of freedom has a critbound of minus 0.0796, yet it fails, because the point estimate is above 1.2500.
Using the standard deviation in place of the variance
The variance term takes s2_WR. In the second worked example, entering 0.3162 in place of 0.10 moves critbound to minus 0.1084, which turns a miss of plus 0.0364 into an apparent pass.
Using the lower chi-square quantile
boundy uses the 95th percentile, the SAS cinv(0.95,dfd). CHISQ.INV at 0.05 on 33 degrees of freedom returns 20.87, which moves boundy to minus 0.2016 and critbound to minus 0.0506 in the first worked example.
Sources
FDA guidance on highly variable drugs and its Appendix G
US Food and Drug Administration, Center for Drug Evaluation and Research. Statistical Approaches to Establishing Bioequivalence: Guidance for Industry. Silver Spring, MD: FDA; May 2026. Section III.C, Statistical Method for Highly Variable Drugs, and Appendix G, Statistical Analysis for Reference-scaled Average BE for Highly Variable Drugs. The 0.294 threshold, the criterion with theta = (ln(1.25)/sigma_W0)^2 and sigma_W0 of 0.25, the formula for s_WR squared, the point estimate within 0.8000 to 1.2500, footnote 4 on Howe's Approximation I, and the SAS statements for x, boundx, y, boundy and critbound.
FDA guidance on narrow therapeutic index drugs and its Appendix F
US Food and Drug Administration, Center for Drug Evaluation and Research. Statistical Approaches to Establishing Bioequivalence: Guidance for Industry. Silver Spring, MD: FDA; May 2026. Section III.B, Statistical Method for Narrow Therapeutic Index Drugs, and Appendix F, Statistical Analysis for Reference-scaled Average BE for Narrow Therapeutic Index Drugs. Delta of 1/0.9 and sigma_W0 of 0.10, the fully replicate design, the need to pass both the scaled criterion and the unscaled limits, and SAS statements with theta=((log(1.11111))/0.1)**2.
Canonical Identity
Stable URI · Machine-readable · Resolvable · CC BY 4.0
