PHAR-251 · Lesson 6 of 12 · 23 min
Biostatistics for pharmacists
▶ Video coming soon A video version of this lesson is on the way.
At the fictional Thornbury Regional Hospital, the pharmacy and therapeutics committee is reviewing a new lipid-lowering drug. The manufacturer's slide reads: reduces major cardiovascular events by 25 percent. A committee member who is a family physician asks the pharmacist presenting the review a simple question: out of how many? The pharmacist, Tomasz Achterberg-Nwosu, has done the arithmetic. In the pivotal trial, over about three years, major events occurred in 12 of every 100 people on placebo and 9 of every 100 on the new drug. The relative reduction is indeed 25 percent; the absolute reduction is 3 percentage points, and about 34 people would need to take the drug for three years for one of them to avoid an event. Both numbers are true. Only one of them tells the committee what it is buying.
Statistics are the language in which clinical evidence is written. A pharmacist does not need to calculate a Cox regression, but must be able to read one: to know what a p-value does and does not mean, to interpret a confidence interval, to translate relative effects into absolute ones, and to recognize the common ways that numbers mislead. This lesson covers those essentials. It assumes the arithmetic of Pharmacy Calculations and complements the fuller treatment of statistical methods in Biostatistics for Public Health.
Types of data
The type of data determines how it is summarized and which statistical tests apply.
- Nominal data are categories without order, such as blood type or whether an event occurred. A variable with two categories, such as alive or dead, is called binary or dichotomous.
- Ordinal data are ordered categories where the gaps between categories are not necessarily equal, such as a pain rating of none, mild, moderate or severe, or a functional scale.
- Continuous data are measured on a scale with equal intervals, such as blood pressure, weight or serum concentration. Interval data have no true zero (temperature in degrees Celsius), while ratio data do (weight, concentration).
- Time-to-event data record how long it takes for an event to occur, such as time to first heart failure admission, and must handle participants who leave the study or reach its end without the event, called censoring.
Many trials convert continuous measures into binary ones, such as blood pressure controlled or not. This makes results easy to communicate but discards information and depends on the chosen cut-off.
Describing data
Continuous data are summarized by a measure of central tendency and a measure of spread. For data that are roughly symmetric, the mean and standard deviation are used; in a normal distribution about 68 percent of values lie within one standard deviation of the mean and about 95 percent within two. For skewed data, such as length of hospital stay, where a few long stays pull the mean upward, the median and the interquartile range, the range containing the middle half of values, are better summaries.
Do not confuse the standard deviation, which describes the variability of individual values, with the standard error of the mean, which describes the precision of the estimated mean and shrinks as the sample grows. Reports sometimes present the standard error because it is smaller and makes data look tidier.
Hypothesis testing and p-values
A trial typically starts with a null hypothesis, that there is no difference between treatments, and an alternative hypothesis, that there is a difference. The p-value is the probability of observing a difference at least as large as the one seen, if the null hypothesis were true. A small p-value means that the observed result would be surprising if there were truly no difference.
By convention, a threshold called alpha, usually 0.05, is set in advance. If the p-value falls below alpha, the result is called statistically significant. Several misreadings are common and important:
- The p-value is not the probability that the null hypothesis is true, nor the probability that the result is due to chance.
- Statistical significance does not mean clinical importance. A very large trial can find a statistically significant difference too small to matter to patients.
- A p-value above 0.05 does not prove there is no difference. Absence of evidence is not evidence of absence; the trial may simply have been too small.
- The 0.05 threshold is a convention, not a law of nature. A p-value of 0.049 and one of 0.051 represent nearly identical evidence.
The American Statistical Association's 2016 statement on p-values made these points formally and urged researchers to report effect sizes and confidence intervals rather than relying on significance alone.
Errors, power and sample size
Two kinds of error are possible. A type I error, or false positive, concludes that a difference exists when it does not; its probability is alpha. A type II error, or false negative, misses a real difference; its probability is called beta. Power, equal to one minus beta, is the probability that the trial will detect a difference of a specified size if it truly exists. Trials are commonly designed for 80 or 90 percent power.
The sample size calculation, which should appear in the methods section, combines alpha, power, the expected event rate or variability, and the smallest difference the investigators consider worth detecting. If that assumed difference is unrealistically large, the trial will be underpowered for realistic effects, and a non-significant result means little. When reading a negative trial, check whether it achieved its planned sample size and whether the observed event rate matched the assumption.
| Truly a difference | Truly no difference | |
|---|---|---|
| Trial finds a significant difference | Correct (power, 1 minus beta) | Type I error (alpha), false positive |
| Trial finds no significant difference | Type II error (beta), false negative | Correct |
Confidence intervals
A confidence interval gives a range of values for the true effect that are compatible with the data. A 95 percent confidence interval is constructed so that, across many repeated studies, 95 percent of such intervals would contain the true value. Practically, the interval shows both the size of the effect and the precision of the estimate.
Confidence intervals carry more information than p-values. For a difference between groups, the null value is zero; for a ratio such as a relative risk, the null value is one. If the 95 percent interval excludes the null value, the result is statistically significant at the 0.05 level. A narrow interval means a precise estimate; a wide interval means uncertainty. An interval that includes both a clinically important benefit and no effect at all tells you the trial cannot distinguish between them.
Confidence intervals are also how non-inferiority is judged. For a harmful outcome expressed as a relative risk, the new drug is declared non-inferior if the upper limit of the confidence interval lies below the prespecified margin. If the whole interval also lies below one, the new drug is superior as well.
Measures of effect for binary outcomes
Most drug trials report binary outcomes, such as whether a participant had a heart attack. Several measures describe the difference between groups, and they can give very different impressions of the same result. Let the event rate in the control group be CER and in the experimental group EER.
- Relative risk, or risk ratio (RR), is EER divided by CER. An RR of 0.75 means the risk in the treated group is three quarters of the risk in the control group.
- Relative risk reduction (RRR) is one minus RR, or the difference in rates divided by CER. An RR of 0.75 corresponds to an RRR of 25 percent.
- Absolute risk reduction (ARR) is CER minus EER, the simple difference in event rates. It depends on the baseline risk.
- Number needed to treat (NNT) is one divided by the ARR, rounded up to the next whole number. It is the number of people who must be treated for a stated time to prevent one additional event.
- For harms, the absolute risk increase and the number needed to harm (NNH) are calculated the same way.
Worked problem
Translating the Thornbury result
In the hypothetical trial, major cardiovascular events over three years occurred in 120 of 1,000 participants on placebo and 90 of 1,000 on the new drug. Calculate the RR, RRR, ARR and NNT.
Show solution
- CER is 120 divided by 1,000, which is 0.12. EER is 90 divided by 1,000, which is 0.09.
- RR is 0.09 divided by 0.12, which is 0.75.
- RRR is 1 minus 0.75, which is 0.25, or 25 percent.
- ARR is 0.12 minus 0.09, which is 0.03, or 3 percentage points.
- NNT is 1 divided by 0.03, which is 33.3, rounded up to 34, over three years.
Answer: RR 0.75, RRR 25 percent, ARR 3 percentage points, NNT 34 over three years. The relative reduction sounds large; the absolute benefit for an individual is modest, and must be weighed against harms and cost.
The same relative risk reduction yields very different absolute benefits in people at different baseline risk. If the drug reduces relative risk by 25 percent, a person with a 40 percent three-year risk gains an ARR of 10 percentage points (NNT 10), while a person with a 4 percent risk gains 1 percentage point (NNT 100). This is why guidelines often base treatment decisions on absolute risk, and why relative results from a high-risk trial population cannot be applied without thought to low-risk patients.
Odds ratios and hazard ratios
The odds of an event are the number with the event divided by the number without it. The odds ratio (OR) compares odds between groups. Odds ratios are the natural output of case-control studies and logistic regression. When events are rare, the odds ratio is close to the relative risk; when events are common, the odds ratio exaggerates the effect compared with the relative risk, a point to remember when an OR is presented as though it were an RR. In the Thornbury example, the odds on the drug are 90 divided by 910, about 0.099, and on placebo 120 divided by 880, about 0.136, giving an OR of about 0.73, close to the RR of 0.75 because events are fairly uncommon.
The hazard ratio (HR) comes from time-to-event analysis, usually a Cox proportional hazards model. It compares the instantaneous rate of the event in the two groups over the follow-up period. An HR of 0.80 means that, at any given time, the treated group has events at about 80 percent of the rate of the control group, assuming the ratio is roughly constant over time. Time-to-event results are often shown as Kaplan-Meier curves, which plot the proportion of participants still free of the event over time; curves that separate early and stay apart suggest a consistent effect, while curves that cross suggest the effect changes over time.
Continuous outcomes
For continuous outcomes, the effect is usually the mean difference between groups, with its confidence interval: for example, a reduction in systolic blood pressure of 5 mm Hg more than placebo. To judge whether a difference matters, compare it with the minimal clinically important difference, the smallest change that patients perceive as beneficial. When studies use different scales for the same concept, such as different depression rating scales, meta-analyses may use a standardized mean difference, which expresses the difference in standard deviation units.
Choosing statistical tests
Pharmacists do not usually choose tests, but recognizing whether the right one was used helps judge a paper. As a broad guide, continuous data that are roughly normal are compared with t-tests for two groups or analysis of variance for more; skewed continuous or ordinal data with non-parametric tests such as the Mann-Whitney U test; categorical data with the chi-square test or, for small numbers, Fisher's exact test; and time-to-event data with the log-rank test and Cox regression. Paired data, such as before-and-after measurements in the same people or crossover trials, need paired versions of these tests. Regression models adjust for several variables at once and are central to observational research, as the next lessons show.
| Data type | Two independent groups | Paired or matched | Effect measure reported |
|---|---|---|---|
| Continuous, roughly normal | Unpaired t-test | Paired t-test | Mean difference |
| Continuous skewed, or ordinal | Mann-Whitney U test | Wilcoxon signed-rank test | Median difference |
| Binary | Chi-square or Fisher's exact test | McNemar's test | RR, ARR, OR |
| Time to event | Log-rank test; Cox regression | Stratified methods | Hazard ratio |
Multiplicity and subgroups
Each statistical test carries a chance of a false positive. When a trial tests many outcomes, time points or subgroups, the chance that at least one is significant by chance alone rises quickly: with twenty independent tests at alpha 0.05, a false positive somewhere is more likely than not. Trials address this by prespecifying a single primary outcome, using hierarchical testing in which secondary outcomes are tested only if the primary is significant, or adjusting the significance threshold.
Subgroup analyses ask whether the effect differs between groups such as men and women or older and younger participants. They are useful for generating hypotheses but notoriously unreliable. Credible subgroup effects are prespecified with a stated direction, are few in number, are supported by a significant test for interaction rather than separate p-values in each subgroup, are biologically plausible and are consistent across studies. A famous illustration is the ISIS-2 trial of aspirin after heart attack, in which investigators, asked to report subgroups, showed that participants born under the astrological signs of Gemini or Libra appeared not to benefit, a deliberately absurd finding that made the point.
A brief note on diagnostic test statistics
Drug information questions sometimes involve laboratory or screening tests. Sensitivity is the proportion of people with a condition who test positive; specificity is the proportion without it who test negative. Positive and negative predictive values tell you how likely a positive or negative result is to be correct, and they depend heavily on how common the condition is in the population tested. A test with good sensitivity and specificity can still produce mostly false positives when used in a low-prevalence population. Likelihood ratios combine sensitivity and specificity into a single measure that can be applied to a patient's pre-test probability.
Common mistakes
MistakeA p-value of 0.03 means there is a 3 percent chance the result is due to chance.
InsteadIt is the probability of data at least this extreme if the null hypothesis were true, not the probability that the null is true.
MistakeA non-significant result proves that two treatments are the same.
InsteadThe trial may have been underpowered; look at the confidence interval for the range of compatible effects.
MistakeA 25 percent relative reduction means 25 of every 100 patients benefit.
InsteadConvert to absolute terms using the baseline risk; the ARR and NNT describe benefit per patient treated.
MistakeOdds ratios and relative risks are interchangeable.
InsteadThey are close only when events are rare; with common events the OR exaggerates the effect.
Summary and key terms
- Data type, whether nominal, ordinal, continuous or time-to-event, determines summaries and tests.
- A p-value is the probability of data at least as extreme as observed if there were no true difference; significance is not importance.
- Power depends on sample size, event rates and the assumed effect; underpowered trials cannot rule out real differences.
- Confidence intervals show effect size and precision and are used to judge non-inferiority.
- RR and RRR describe relative effects; ARR and NNT describe absolute effects and depend on baseline risk.
- Odds ratios exaggerate relative risk when events are common; hazard ratios compare event rates over time.
- Multiple comparisons and subgroup analyses generate false positives unless prespecified and tested for interaction.
- p-value
- The probability of a result at least as extreme as observed, assuming the null hypothesis is true.
- Confidence interval
- A range of values for the true effect that are compatible with the observed data.
- Power
- The probability that a study will detect a specified true effect; one minus beta.
- Type I error
- Concluding that a difference exists when it does not; a false positive.
- Type II error
- Failing to detect a difference that exists; a false negative.
- Relative risk (RR)
- The event rate in the treated group divided by the event rate in the control group.
- Absolute risk reduction (ARR)
- The control event rate minus the treated event rate.
- Number needed to treat (NNT)
- One divided by the ARR; the number treated for a stated time to prevent one event.
- Hazard ratio (HR)
- The ratio of event rates over time between groups, from time-to-event analysis.
- Minimal clinically important difference
- The smallest change in an outcome that patients perceive as beneficial.
Practice problems
Work each problem on paper first, then reveal the answer to check.
In a trial, an event occurs in 20 percent of controls and 15 percent of treated participants. Give the RR, RRR, ARR and NNT.
Show answer
RR 0.75; RRR 25 percent; ARR 5 percentage points; NNT 20.
A 95 percent confidence interval for a relative risk is 0.70 to 1.05. Is the result statistically significant?
Show answer
No; the interval includes 1, the null value for a ratio.
Why might an odds ratio overstate the effect compared with a relative risk?
Show answer
When events are common, odds diverge from risks, so the OR is further from 1 than the RR.
What four elements are combined in a sample size calculation?
Show answer
Alpha, power, the expected event rate or variability, and the minimum important difference.
Name three features of a credible subgroup effect.
Show answer
Prespecified with direction, few subgroups tested, significant interaction test, biological plausibility, consistency across studies.
Lesson quiz · 5 questions
Score 60% or more to complete this lesson.
Create a free account to save your progress, take quizzes and earn a certificate.