Why the Number of Visits Changes the Summary
A biomarker database often contains one row per measurement, not one row per patient. If some patients contribute many more rows than others, the average across rows gives those patients more influence. This can matter even when every recorded value is accurate: the pooled mean may describe the average visit, rather than the average patient.
The distinction is important when the scientific question concerns patients equally. For example, a summary intended to represent the average biomarker level across patients should not quietly give more weight to patients who are monitored more often. Whether that weighting changes the answer depends on how visit counts are related to biomarker levels.
The simple formula treats each patient's biomarker as constant over the window, or as a patient-level summary replicated across that patient's visits. It isolates the effect of unequal visit counts. With changing measurements, the pooled mean instead sums the actual visit-specific values; the same unequal-contribution concern remains, but a single \(Y_i\) no longer captures every feature of the data.
Deriving the Size-Weighted Mean
In a finite cohort, the visit-pooled mean is obtained by adding each patient's value once for every visit they contributed, then dividing by the total number of visits. Thus each patient receives weight \(N_i/\sum_j N_j\), rather than the equal weight \(1/m\). The weights are nonnegative and sum to one.
A useful population version makes the source and direction of the difference especially clear. Suppose a randomly selected patient has biomarker value \(Y\) and visit count \(N\), with \(E[N]>0\) and finite expectations for the quantities below. The mean biomarker value contributed per visit in the population is the visit-weighted mean \(E[NY]/E[N]\). The identity \(E[NY]=E[N]E[Y]+\operatorname{Cov}(N,Y)\) gives:
This identity is a derivation, not a claim that every finite cohort's ratio equals a ratio of expectations. It says that the population visit-weighted mean exceeds the patient mean when visit count and biomarker value have positive covariance, falls below it when that covariance is negative, and agrees with it when the covariance is zero. The sign alone does not determine the size of the difference; the scale of the covariance and the average visit count both matter.
The identity is defined for a patient population in which \(Y\) is meaningful for every patient, including patients with \(N=0\). Such a patient contributes no visit to the pooled mean. If zero-visit patients are left out of the data, the observed cohort may not represent the intended patient population; the formula does not make unobserved biomarker values appear.
Worked Example: More Visits at Higher Biomarker Levels, Despite More Patients at Lower Levels
Consider a hypothetical population of 100 patients. There are 60 patients with \(Y=1\) unit and one visit each, and 40 patients with \(Y=4\) units and four visits each. The patient-weighted mean gives each of the 100 patients equal influence:
There are \(60(1)=60\) recorded visits from the lower-value group and \(40(4)=160\) from the higher-value group. The pooled mean is therefore:
The visit-pooled mean is \(3.182-2.20=0.982\) units above the patient mean. Although more patients have the lower value, patients with the higher value contribute more visits per person, so they account for 160 of the 220 records. This is positive size bias relative to the equal-patient target.
Different Visit Patterns, Different Directions
Unequal counts do not automatically push the pooled mean upward. What matters is the relationship between visit frequency and biomarker value, not whether the counts vary at all. The next examples show a downward shift and a case where unequal counts leave the mean unchanged.
Worked Example: More Visits at Lower Biomarker Levels
In a different hypothetical population, 50 patients each have \(Y=2\) units and four visits, while 50 patients each have \(Y=6\) units and one visit. The patient mean is:
The first group contributes \(50(4)=200\) visits, and the second contributes \(50(1)=50\) visits. Hence:
The pooled mean is \(1.20\) units below the patient mean. The lower-value patients make up half the patients but 200 of the 250 records, so the visit-pooled summary is pulled toward their biomarker level.
Worked Example: Unequal Counts Without a Shift in the Mean
Suppose there are four equally sized groups of 25 patients each: two groups have biomarker values of 1 unit and two have values of 5 units. Within each biomarker value, one group has one visit per patient and the other has three visits per patient. Thus each value is paired with both visit counts equally often.
The patient mean is \([25(1)+25(1)+25(5)+25(5)]/100=3.00\) units. For the pooled mean, the two groups with value 1 contribute \(25(1)+75(1)=100\) units across 100 visits. The two groups with value 5 contribute \(25(5)+75(5)=400\) units across 100 visits. Therefore:
This arithmetic shows a shift, so it is not an example of equal means; the groups were not balanced in total visit contribution across the two values because each value's two visit counts create 100 visits per value, but the numerical group contributions yield 100 and 400, giving mean 2.50, whereas the patient mean is 3.00. Equal contributions in number of visits do not imply equal weighted averages of unequal values? Here, 100 visits at value 1 and 100 at value 5 do imply \((1+5)/2=3\); the total contribution at value 5 is 500, not 400. Correcting the arithmetic, the value-5 groups contribute \(25(1)(5)+25(3)(5)=125+375=500\) units across 100 visits. The pooled mean is:
In this balanced example the patient mean and pooled mean agree, even though visit counts vary fourfold. Within each biomarker value, the average count is the same: two visits per patient. Thus there is no net association between count and value in this population, and the unequal counts alone do not produce a shift.
Assumptions, Interpretation, and Practical Checks
The calculations above rely on a clearly defined target and observation window. The patient-weighted target treats patients equally, and \(N_i\) counts the biomarker records that enter the pooled calculation during that same window. Each included record contributes one measurement. In the simple examples, all records from a patient carry the same \(Y_i\); when values vary within a patient, the visit-level sum must use those actual values instead. Counts must not be confused with follow-up time, and a patient with no recorded visit cannot contribute a measured value to the pooled mean.
The pooled statistic is not inherently wrong. It answers a different descriptive question: what is the average recorded biomarker value across visits? It becomes misleading when it is interpreted as the average patient value without checking the weighting. The earlier material on inverse-intensity weighting covers a method for addressing informative visit processes; here the aim is to recognize the basic weighting mechanism, not to select or fit a correction model.
A useful diagnostic is to construct one row per patient with a patient-level biomarker summary and visit count, then compare the distribution of counts across the range of biomarker summaries. If high-value patients tend to have more visits, a pooled mean can be pulled upward; if low-value patients tend to have more, it can be pulled downward. This check is descriptive rather than proof of a particular visit mechanism. It also cannot establish the biomarker values of patients who were never observed.
A second check is to calculate both summaries on the same defined set of patients and window. A substantial difference is a direct warning that the visit-level result is not interchangeable with the equal-patient result. Standard errors also require care: multiple visits from the same patient are not independent patient replicates. Treating every visit as a separate independent patient can overstate the effective sample size, even apart from the weighting difference in the mean.
| Summary | Contribution from patient \(i\) | Question it describes |
|---|---|---|
| Patient-weighted mean | One equal patient weight | What is the average value across patients? |
| Visit-pooled mean | Weight proportional to \(N_i\) | What is the average value across recorded visits? |
| Visit-level analysis with patient clustering | Visit records retained, dependence accounted for | How do visit-level outcomes relate to predictors, allowing for within-patient dependence? |
The last approach addresses dependence in an analysis, but clustering alone does not change a visit-weighted target into an equal-patient target. Likewise, equal weighting may not be the scientifically relevant choice if the intended question is explicitly about visits or service use. State the target first, then decide whether visit weighting matches it.
Common Pitfall and Limitations
- Wrong reasoning: “There are more patients at the lower biomarker value, so the pooled mean must be lower.” Patient counts alone do not determine a visit-pooled mean. Correction: multiply each patient's value by their visit count, sum those contributions, and divide by the total number of visits.
- Assuming unequal visit counts always cause bias. Unequal counts can coexist with a zero covariance between \(N\) and \(Y\). The pooled and patient means then agree in the population formula, as the balanced example illustrates.
- Calling every difference bias without naming the target. A visit-pooled mean is appropriate for an average across visits. It is biased only relative to a different target, such as the equal-patient mean.
- Overgeneralizing the constant-value example. If biomarker levels change within a patient, count weighting alone may not summarize the full mechanism. The timing and values of the individual records matter, and the simple covariance formula for one \(Y_i\) is not a complete longitudinal model.
Size-biased sampling is a limitation of treating visit records as if they were a simple sample of patients. The formula explains the basic mechanism, but does not by itself identify why visits are frequent, handle informative dropout, or recover values for unobserved patients. Those issues require additional assumptions and methods.
Check Your Understanding
Answer each question, then compare your reasoning with the solutions.
- In the first worked example, how many visits came from patients with \(Y=4\), and why did the pooled mean exceed the patient mean?
- Suppose every patient has the same visit count \(c>0\). Show why the visit-pooled and patient-weighted means agree.
- A population has \(E[N]=3\), \(E[Y]=5\) units, and \(\operatorname{Cov}(N,Y)=-1.5\) visits-units. Find the visit-weighted mean.
- Can variation in visit counts produce no difference between the two population means? State a condition and explain.
- Why is it incorrect to interpret a visit-pooled mean automatically as the average patient biomarker value?
Solutions. (1) The 40 patients each contributed four visits, so they contributed \(40(4)=160\) visits. Their higher biomarker value therefore received more weight, raising the pooled mean to \(3.182\) units versus \(2.20\) units across patients. (2) If all \(N_i=c\), then \(\bar{Y}_{\mathrm{visit}}=\sum_i cY_i/\sum_i c= c\sum_iY_i/(mc)=\bar{Y}_{\mathrm{patient}}\). (3) By the covariance identity, the visit-weighted mean is \(E[Y]+\operatorname{Cov}(N,Y)/E[N]=5-1.5/3=4.50\) units. (4) Yes. If \(\operatorname{Cov}(N,Y)=0\), then \(E[NY]/E[N]=E[Y]\), even if \(N\) varies. (5) The pooled mean weights each patient in proportion to their number of visits, whereas the patient mean gives each patient equal weight; they answer different questions unless the weighting happens not to change the mean.