boot_tgr: Bootstrap Confidence Intervals for the Technology Gap Ratio

View source: R/bootstrap.R

boot_tgrR Documentation

Bootstrap Confidence Intervals for the Technology Gap Ratio

Description

Computes bootstrap confidence intervals for TGR estimates from a fitted metafrontier model. Supports both parametric (residual resampling) and nonparametric (case resampling) bootstraps.

Usage

boot_tgr(
  object,
  R = 999,
  type = c("parametric", "nonparametric"),
  level = 0.95,
  ci_type = c("percentile", "bca"),
  seed = NULL,
  progress = TRUE,
  ncores = 1L,
  ...
)

Arguments

object

a "metafrontier" object.

R

integer. Number of bootstrap replications (default 999).

type

character. "parametric" resamples from estimated error distributions; "nonparametric" resamples rows within groups with replacement.

level

numeric. Confidence level (default 0.95).

ci_type

character. "percentile" (default) or "bca" (bias-corrected and accelerated).

seed

optional integer seed for reproducibility.

progress

logical. Show progress bar (default TRUE).

ncores

integer. Number of CPU cores for parallel bootstrap (default 1, sequential). Requires the parallel package.

...

additional arguments passed to metafrontier.

Value

An object of class "boot_tgr" containing:

tgr_boot

R x n matrix of bootstrapped TGR values

tgr_original

original TGR estimates

ci

n x 2 matrix of observation-level confidence intervals

ci_group

data frame of group-level mean TGR intervals

R_effective

number of successful replications

R

requested number of replications

type

bootstrap type used

ci_type

CI type used

level

confidence level

Examples


sim <- simulate_metafrontier(n_groups = 2, n_per_group = 100,
                             seed = 42)
fit <- metafrontier(log_y ~ log_x1 + log_x2,
                    data = sim$data, group = "group",
                    meta_type = "stochastic")
boot <- boot_tgr(fit, R = 50, seed = 1)
print(boot)
confint(boot)



metafrontier documentation built on Aug. 19, 2026, 5:08 p.m.