Why Examine Bootstrap Stability?
A covariate selection procedure can produce one final model, but that model alone does not show how sensitive the choice was to the particular subjects observed. If a small change in the sample leads to a different set of selected covariates, the final model may be a fragile summary of the data. Bootstrap stability analysis makes this sensitivity visible by repeating the entire selection procedure in resampled data sets.
The target is not simply whether a covariate was selected once. It is how often the specified procedure selects it, and how variable its estimated effect is when selected. Those are descriptive measures of the behavior of the selection procedure under resampling. They do not, by themselves, establish that an effect is clinically important or provide a conventional confidence interval.
Resample Subjects and Repeat the Whole Procedure
In an NLME data set, subject \(i\) contributes a collection of observations, potentially at several times. Write that subject’s complete record as \(D_i\), including the response measurements, observation times, and covariates. If subjects are independent sampling units, a nonparametric bootstrap replicate draws \(n\) records \(D_i\) with replacement from the \(n\) observed subject records. All observations belonging to a drawn subject travel together. A subject drawn more than once contributes multiple copies of the complete record to that replicate.
This preserves the observed within-subject pattern and dependence rather than pretending that repeated measurements are independent subjects. If the sampling design requires strata or clusters, the resampling scheme must respect that design; the simple subject bootstrap assumes that the observed subjects are the appropriate independent units.
The selection procedure must be specified before resampling. For example, it may include a candidate covariate set, a fixed entry or retention rule, model fitting choices, and a rule for comparing models. In every replicate, repeat the same procedure from its starting point. Reusing the covariates selected in the original data, or only refitting the final model, does not measure the stability of selection.
The frequency \(\hat{\pi}_j\) is the observed proportion of bootstrap replicates selecting covariate \(j\). It estimates the selection probability under the empirical resampling distribution and the chosen algorithm. It is not the probability that the covariate is truly associated with the outcome. Selection frequencies are also specific to the candidate set, selection rule, model specification, and resampling scheme.
Record the candidate covariates, model-fitting rules, selection criterion, and handling of fit failures before generating replicates.
Draw \(n\) subject records with replacement, retaining each selected subject’s full longitudinal record.
Apply the same selection procedure to that replicate, starting with the same candidate set.
For each covariate, store whether it was selected and, if selected, its estimated effect and direction.
Calculate selection frequencies and selected-estimate summaries, then check convergence and sensitivity to the implementation.
Selection Frequencies and Their Interpretation
A high selection frequency indicates that the procedure often retains a covariate when the observed subjects are perturbed by bootstrap resampling. A low or intermediate frequency indicates that its selection depends more strongly on which subjects are represented. It is useful to report the number of successful replicates, the selection count, and the frequency, rather than only a qualitative label such as “stable.”
Bootstrap replicates are simulated from the observed data, so the frequency itself has Monte Carlo error from using a finite number \(B\). Conditional on the observed data and independent bootstrap draws, each \(I_{jb}\) is a Bernoulli indicator with success probability equal to the bootstrap selection probability. Thus the Monte Carlo standard error of \(\hat{\pi}_j\) is approximately \(\sqrt{\hat{\pi}_j(1-\hat{\pi}_j)/B}\). This quantifies numerical uncertainty in the estimated frequency, not sampling uncertainty about the underlying covariate effect.
Worked Example: Calculating Selection Frequencies
Suppose a hypothetical analysis repeats a fixed selection procedure in \(B=200\) subject-level bootstrap replicates. Age is selected in 142 replicates, albumin in 91, and sex in 48. These selections can overlap because a replicate can select more than one covariate.
For age, the selection frequency is \(142/200=0.710\), or 71.0%. For albumin it is \(91/200=0.455\), or 45.5%. For sex it is \(48/200=0.240\), or 24.0%. Under this procedure, age is selected more consistently than the other two candidates; the results do not show that age has a 71% probability of being a real effect.
For age, the approximate Monte Carlo standard error is \(\sqrt{0.710(1-0.710)/200}=\sqrt{0.0010295}=0.0321\), or 3.21 percentage points. This describes the precision of the reported frequency due to having only 200 bootstrap draws. It is not a confidence interval for an age effect.
Variability of the Estimated Effect
Selection frequency and coefficient variability answer different questions. The frequency measures how often the algorithm includes a covariate. The estimated-effect summary describes the estimates in replicates where it is included. Let \(\hat{\beta}_{jb}\) be the estimated coefficient for covariate \(j\) in replicate \(b\). If the covariate is selected in \(m_j=\sum_b I_{jb}\) replicates, the selected-estimate mean and sample standard deviation are
These summaries are conditional on the procedure selecting the covariate. They can show whether selected estimates are tightly grouped, widely spread, or sometimes opposite in sign. They are not automatically the standard error or confidence interval for the effect in a prespecified model: conditioning on selection changes which estimates are included, and selection itself is data-dependent. Report the selection frequency alongside the conditional estimates so readers can see how much of the bootstrap output those summaries represent.
Worked Example: Summarizing Selected-Effect Variability
In a small hypothetical demonstration with \(B=10\) replicates, a covariate is selected in six. Its six estimated effects, in units of log clearance per 10 kg increase in body weight, are \(0.18,\ 0.22,\ 0.25,\ 0.29,\ 0.31,\ 0.35\). The selection frequency is \(6/10=0.600\), or 60.0%.
The selected-estimate mean is \((0.18+0.22+0.25+0.29+0.31+0.35)/6=1.60/6=0.2667\) log-clearance units per 10 kg. The squared deviations from this mean sum to approximately \(0.01933\). Therefore the selected-estimate sample standard deviation is \(\sqrt{0.01933/(6-1)}=\sqrt{0.003866}=0.0622\) log-clearance units per 10 kg.
All six estimates are positive, but the selection frequency is only 60.0%. In this toy calculation, the direction is consistent among selected fits while inclusion is not. The conditional mean and standard deviation describe only the six selected fits; they should not be reported as though the covariate were selected in every replicate or as a conventional interval for its effect. Ten replicates are far too few for a reliable stability assessment.
Why the Bootstrap Frequency Has This Form
For a fixed observed data set, each independently generated bootstrap replicate either selects covariate \(j\) or does not. Treating those outcomes as Bernoulli draws with selection probability \(\pi_j\), the average indicator has expected value \(\pi_j\) and variance \(\pi_j(1-\pi_j)/B\). The standard deviation of this average is therefore \(\sqrt{\pi_j(1-\pi_j)/B}\), estimated by replacing \(\pi_j\) with \(\hat{\pi}_j\). This justifies the Monte Carlo standard error formula and clarifies its scope: it measures variability from the finite simulation, conditional on the original data and fixed selection algorithm.
Increasing \(B\) reduces this Monte Carlo error, but cannot repair a poorly specified covariate model, a selection rule that changes between replicates, or a bootstrap design that fails to match the independent sampling units. A frequency near 0.50 may be genuinely borderline, or its estimate may simply be imprecise because too few replicates were run. Report \(B\) and, when frequencies are central to a conclusion, assess whether increasing \(B\) materially changes them.
Worked Example: Resampling Longitudinal Subjects Correctly
Consider a hypothetical data set with four subjects, each contributing concentration measurements at three times. A bootstrap draw of four subject records is subject 2, subject 2, subject 4, subject 1. This replicate contains four subject units and twelve measurements, not four individual measurements chosen from the original twelve.
The two appearances of subject 2 are two bootstrap copies of that subject’s entire three-measurement trajectory, with its covariates copied along with it. In software, the copies must be treated as distinct bootstrap units so both contribute to fitting. Subject 3 is absent from this replicate. The selection procedure is then run on this replicate, just as on any other.
Resampling twelve measurements independently could separate observations from the same subject and falsely treat within-subject measurements as independent sampling units. The subject bootstrap instead preserves each observed trajectory as a unit. In a real application, four subjects would be too few for a credible stability analysis; the example only illustrates the resampling unit.
Diagnostics, Comparisons, and Limitations
A stability summary is only interpretable if the replicate fits and selection decisions are trustworthy. Track convergence failures, boundary estimates, and the number of successful replicates. If failures are common, the reported frequencies among successful fits may describe a selected subset of bootstrap samples rather than the intended procedure. State how failures were handled; do not silently count failed fits as covariates not selected. Investigate whether sparse categories or unusual resamples make particular candidate effects unidentifiable.
Also check that the procedure is genuinely held fixed. Changing the candidate set, model comparisons, or selection threshold across replicates makes the frequencies difficult to interpret. For categorical covariates, some replicates may contain too few observations in a level to estimate its effect; this is a substantive instability, not just a software nuisance. If the sampling design requires stratified resampling to preserve representation, state and justify that choice, since it changes the resampling distribution.
Bootstrap stability complements rather than replaces other evidence. A Wald test in a fixed full model assesses a coefficient relative to its estimated uncertainty under that specified model; it does not answer how often a selection algorithm would choose the covariate after resampling. Influence diagnostics examine sensitivity to particular influential subjects, whereas bootstrap stability summarizes sensitivity across many resampled data sets. Shrinkage-based selection and bootstrap selection frequencies also differ: one concerns the behavior of a penalized fitting rule, while the other summarizes repeated outputs of the chosen procedure.
The method has limits. It reflects the empirical distribution of the observed subjects, so it cannot reveal effects or subgroup patterns absent from the data. Correlated covariates may substitute for one another across replicates, producing low individual frequencies even when the same general information is repeatedly represented. A high frequency is not proof of causality, clinical relevance, or correct functional form. A low frequency is evidence of sensitivity for this procedure and data set, not proof that the covariate has no effect.
Common Mistake
A common error is to say, “The covariate was selected in 70% of bootstrap samples, so there is a 70% probability that its effect is real.” The calculation does not support that conclusion: 70% is the fraction of resamples in which a particular algorithm selected the covariate, conditional on the observed data and all modeling choices. It is not a posterior probability, a p-value, or an estimate of the probability that a scientific claim is true. Report it as a procedure-specific selection frequency and interpret it alongside effect estimates, model diagnostics, and subject-matter considerations.
Check Your Understanding
Answer each question, then compare your reasoning with the solutions.
- A data set contains repeated observations for each patient. What should ordinarily be resampled for a subject-level bootstrap, and why?
- A covariate is selected in 75 of 150 replicates. Calculate its selection frequency and interpret it correctly.
- Why should the selected-estimate standard deviation be reported alongside the selection frequency?
- What does an approximate Monte Carlo standard error describe, and what does it not describe?
Solutions. (1) Resample complete patient records, keeping all repeated observations and covariates together, because the patient is the independent sampling unit and within-patient observations are dependent. (2) The frequency is \(75/150=0.500\), or 50.0%. The specified procedure selected the covariate in half of the bootstrap replicates; this is not a 50% probability that the effect is real. (3) The frequency describes how often the effect is selected, while the selected-estimate standard deviation describes how dispersed its estimates are in fits that select it. Neither summary replaces the other. (4) It describes simulation error in the estimated selection frequency from using a finite number of bootstrap replicates, conditional on the observed data and selection procedure. It does not describe the sampling uncertainty of the covariate’s effect or the probability that the covariate is truly associated with the outcome.