(a) A Phase III trial compares a new drug with placebo for preventing post-operative nausea; the control response rate is \(p_C = 0.45\) and a clinically meaningful new rate is \(p_T = 0.65\). (b) A trial compares an antihypertensive with placebo on change in SBP, with \(\sigma = 12\) mmHg and a meaningful difference \(\delta = 5\) mmHg. Find the required sample size per group.
To determine the per-group sample size for a dichotomous response (at \(\alpha = 0.05\), 80 % power) and a continuous response (at \(\alpha = 0.05\), 90 % power).
Applying it:
Blank working table:
| Response | \(n\) per group | With 10 % dropout |
|---|---|---|
| Dichotomous | ||
| Continuous |
(a) Dichotomous: \(\bar p = 0.55,\ \bar q = 0.45\); \(\sqrt{2\bar p\bar q} = 0.7036\), \(\sqrt{p_Tq_T + p_Cq_C} = \sqrt{0.2275 + 0.2475} = 0.6892\).
\(n = (1.96\times0.7036 + 0.842\times0.6892)^2/(0.20)^2 = (1.379 + 0.580)^2/0.04 = 3.838/0.04 = 95.9\).
(b) Continuous: \(n = 2(144)(1.96 + 1.282)^2/25 = 288\times10.51/25 = 121.1\).
| Response | \(n\) per group | With 10 % dropout |
|---|---|---|
| Dichotomous | 96 (192 total) | 107 (214 total) |
| Continuous | 122 (244 total) | 136 (272 total) |
power.prop.test(p1 = 0.65, p2 = 0.45, sig.level = 0.05, power = 0.80)$n # dichotomous
power.t.test(delta = 5, sd = 12, sig.level = 0.05, power = 0.90)$n # continuous
[1] 95.94245
[1] 122.0139
R agrees with the hand working: 95.9 rounds up to 96 per group. For the continuous endpoint R uses the t distribution, so it gives 122.0 where the normal approximation gives 121.1; both round up to 122.
The trial needs 96 subjects per group for the dichotomous endpoint and 122 per group for the continuous endpoint (107 and 136 respectively after allowing for 10 % dropout).
In a diabetes trial the outcome is glycaemic control (HbA1c < 7 %; 1 = yes) for \(n = 80\) patients, with predictors \(X_1\) = treatment (1 = new drug), \(X_2\) = baseline HbA1c and \(X_3\) = age. Fit a multiple logistic regression and interpret the odds ratios.
| Patient | Y | \(X_1\) | \(X_2\) | \(X_3\) |
|---|---|---|---|---|
| 1 | 1 | 1 | 8.2 | 52 |
| 2 | 0 | 0 | 9.1 | 61 |
| 3 | 1 | 1 | 7.8 | 45 |
| … | … | … | … | … |
| 80 | (full data set of 80 patients) | |||
To estimate the logistic model \(\ln\!\frac{p}{1-p} = \beta_0 + \beta_1X_1 + \beta_2X_2 + \beta_3X_3\), obtain adjusted odds ratios and assess each predictor.
Applying it:
glm(..., family = binomial)).Blank working table:
| Variable | \(\hat\beta\) | SE | OR | 95 % CI | p |
|---|---|---|---|---|---|
| Intercept | — | — | |||
| Treatment (\(X_1\)) | |||||
| Baseline HbA1c (\(X_2\)) | |||||
| Age (\(X_3\)) |
Illustrative fitted results:
| Variable | \(\hat\beta\) | SE | OR | 95 % CI | p |
|---|---|---|---|---|---|
| Intercept | 5.82 | 1.94 | — | — | 0.003 |
| Treatment (\(X_1\)) | 1.24 | 0.52 | 3.46 | (1.25, 9.57) | 0.017 |
| Baseline HbA1c (\(X_2\)) | −0.89 | 0.25 | 0.41 | (0.25, 0.67) | <0.001 |
| Age (\(X_3\)) | −0.04 | 0.02 | 0.96 | (0.92, 1.00) | 0.046 |
model <- glm(Control ~ Treatment + BaselineHbA1c + Age, data = trial_data, family = binomial)
exp(cbind(OR = coef(model), confint(model))) # odds ratios + CI
library(ResourceSelection); hoslem.test(trial_data$Control, fitted(model)) # goodness of fit
library(pROC); roc(trial_data$Control, fitted(model))$auc # c-statistic
The new drug roughly triples the odds of glycaemic control (OR = 3.46, p = 0.017) after adjustment; higher baseline HbA1c lowers the odds by 59 % per 1 % (OR = 0.41, p < 0.001); age has a small borderline effect (OR = 0.96, p = 0.046).
A 2×2 crossover trial compares a test (A) and reference (B) formulation in 20 volunteers (10 sequence AB, 10 sequence BA); the endpoint is \(C_{\max}\) (ng/mL). Test the treatment, period and carry-over effects. The within-subject differences (P1 − P2) are: AB: 2.4, 2.8, 1.5, 3.1, 1.1, 3.3, 2.2, 1.8, 1.6, 2.5; BA: −2.3, −1.8, −2.3, −2.1, −2.3, −2.1, −1.8, −2.3, −2.3, −2.3.
To estimate the treatment effect from the within-subject differences and test for a carry-over effect.
Applying it:
Blank working table:
| Sequence | \(n\) | \(\bar d_i\) | \(s_i\) |
|---|---|---|---|
| AB | |||
| BA | |||
| Treatment effect / t / p | |||
| Sequence | \(n\) | \(\bar d_i\) | \(s_i\) |
|---|---|---|---|
| AB | 10 | 2.23 | 0.72 |
| BA | 10 | −2.16 | 0.21 |
| Treatment effect / t / p | 2.195 ng/mL / 9.22 / < 0.001 | ||
Treatment effect \(= (2.23 - (-2.16))/2 = 2.195\); pooled \(\hat\sigma_d = 0.533\), \(SE = 0.533\times0.4472 = 0.238\), \(t = 2.195/0.238 = 9.22\) (df 18); 95 % CI \(= 2.195 \pm 2.101\times0.238 = (1.695, 2.696)\).
Carry-over (Grizzle): mean \((P_1 + P_2)\) = 96.63 (AB) vs 93.94 (BA), difference 2.69; the two-sample \(t\) on subject totals gives \(t = 1.37,\ p = 0.19\) — no significant carry-over, so the within-subject analysis is valid.
d_AB <- c(2.4,2.8,1.5,3.1,1.1,3.3,2.2,1.8,1.6,2.5)
d_BA <- c(-2.3,-1.8,-2.3,-2.1,-2.3,-2.1,-1.8,-2.3,-2.3,-2.3)
(mean(d_AB) - mean(d_BA)) / 2 # treatment effect
t.test(d_AB, d_BA, var.equal = TRUE) # test
Formulation A gives a significantly higher \(C_{\max}\) than B by \(2.195\) ng/mL (\(t = 9.22,\ p < 0.001\), 95 % CI 1.70–2.70), with no carry-over effect (\(p = 0.19\)).
A Phase III parallel trial compares Drug A and Drug B (50 patients each) on change in HbA1c (%): Drug A mean −1.82 (SD 0.95), Drug B mean −1.24 (SD 1.02). Also, glycaemic control (HbA1c < 7 %) is achieved by 32/50 on A and 21/50 on B. Analyse both endpoints.
To compare the mean HbA1c change (two-sample \(t\)-test, effect size, CI) and the control rates (chi-square, odds ratio).
Applying it:
Blank working table:
| Analysis | Statistic | p |
|---|---|---|
| Two-sample t (ΔHbA1c) | ||
| Chi-square (control rate) | ||
| Odds ratio | — |
Continuous: \(s_p^2 = (49\times0.9025 + 49\times1.0404)/98 = 0.9714,\ s_p = 0.9856\); \(t = -0.58/(0.9856\times0.2) = -2.94\) (df 98, p = 0.004); 95 % CI \(= -0.58 \pm 1.984\times0.1971 = (-0.971, -0.189)\); Cohen's \(d = -0.588\).
Categorical: \(\chi^2 = 100(32\times29 - 18\times21)^2/(50\times50\times53\times47) = 4.86\) (df 1, p = 0.028); OR \(= (32\times29)/(18\times21) = 2.45\).
| Analysis | Statistic | p |
|---|---|---|
| Two-sample t (ΔHbA1c) | t = −2.94, d = −0.59 | 0.004 |
| Chi-square (control rate) | χ² = 4.86 (df 1) | 0.028 |
| Odds ratio | 2.45 | — |
t.test(HbA1c_change ~ Drug, data = parallel_data, var.equal = TRUE)
chisq.test(matrix(c(32,18,21,29), nrow = 2, byrow = TRUE))
fisher.test(matrix(c(32,18,21,29), nrow = 2, byrow = TRUE)) # exact OR
Drug A gives a significantly greater HbA1c reduction (difference 0.58 %, p = 0.004, medium-to-large effect \(d = -0.59\)) and a higher control rate (64 % vs 42 %, \(\chi^2 = 4.86,\ p = 0.028\), OR = 2.45).
Six randomised trials compare aspirin with placebo for preventing cardiovascular events. Pool the odds ratios, assess heterogeneity and evaluate publication bias.
| Trial | n (Aspirin) | Events | n (Placebo) | Events |
|---|---|---|---|---|
| trial1 | 3171 | 148 | 3168 | 186 |
| trial2 | 2035 | 109 | 2037 | 142 |
| trial3 | 2530 | 183 | 2540 | 212 |
| trial4 | 3402 | 209 | 3395 | 251 |
| trial5 | 5139 | 298 | 5127 | 347 |
| trial6 | 4401 | 265 | 4405 | 302 |
To compute the pooled odds ratio (inverse-variance fixed effect), the heterogeneity statistics \(Q\) and \(I^2\), and check for publication bias.
Applying it:
Blank working table:
| Trial | OR | ln(OR) | SE | Weight (%) |
|---|---|---|---|---|
| trial1–6 | ||||
| Pooled OR / Q / I² | ||||
For trial1: \(a = 148,\ b = 3023,\ c = 186,\ d = 2982\); \(\text{OR} = (148\times2982)/(3023\times186) = 0.785\), \(\ln\text{OR} = -0.242\), \(SE = 0.113\).
| Trial | OR | ln(OR) | SE | Weight (%) |
|---|---|---|---|---|
| trial1 | 0.785 | −0.242 | 0.113 | 12.7 |
| trial2 | 0.755 | −0.281 | 0.131 | 9.4 |
| trial3 | 0.856 | −0.155 | 0.105 | 14.7 |
| trial4 | 0.820 | −0.199 | 0.097 | 17.3 |
| trial5 | 0.848 | −0.165 | 0.082 | 24.4 |
| trial6 | 0.870 | −0.139 | 0.087 | 21.5 |
| Pooled OR / Q / I² | 0.832 (95 % CI 0.768–0.900) / Q = 1.23 (p = 0.94) / I² = 0 % | |||
Pooled \(\ln\text{OR} = -0.184 \Rightarrow \text{OR} = 0.832\). Since \(Q = 1.23 < df = 5\), \(\hat\tau^2 = 0\) and the random-effects estimate equals the fixed-effect one. Egger's test (intercept \(-0.42,\ p = 0.65\)) shows no publication bias; the funnel plot is symmetric.
library(meta)
metabin(event.e = c(148,109,183,209,298,265), n.e = c(3171,2035,2530,3402,5139,4401),
event.c = c(186,142,212,251,347,302), n.c = c(3168,2037,2540,3395,5127,4405),
studlab = paste0("trial", 1:6), sm = "OR", method = "MH")
# forest(...) ; funnel(...) ; metabias(..., method = "egger")
Aspirin reduces cardiovascular events: pooled OR = 0.832 (95 % CI 0.768–0.900, p < 0.001) — about a 17 % reduction in odds. Heterogeneity is negligible (\(I^2 = 0\%\)) and there is no evidence of publication bias, so the pooled estimate is robust.