What is the Group Jackknife?
The group jackknife is a resampling technique that estimates the variance of any statistic. This is done by
- Choosing a number of groups, e.g.
. - Dividing the dataset into multiple subsets (groups) by dropping one group at a time, e.g., each subset has 59 groups.
- Systematically recalculating the statistic of interest on each subset (replicate estimate)
- Calculating the variance of each replicate.
The idea is that the variance of the replicates varies the same way as the true estimate. Therefore, the group jackknife variance is an estimate of the variance of the statistic of interest.
Why is it useful?
- Universal Applicability: It works for almost any estimator—whether you are calculating a simple total, a ratio, or coefficients in a regression model—without needing to derive a separate mathematical formula for the variance of each.
- Computational Efficiency: In large datasets, running the standard “delete-one” Jackknife is often impossible (e.g., repeating a calculation 1,000,000 times for 1 million rows). The Grouped Jackknife reduces this to a manageable number (e.g., just
or
repetitions), drastically speeding up processing time. - Respects Complex Survey Design: If your data was collected using clusters (e.g., surveying all students in 50 randomly selected schools), you cannot treat students as independent. The Grouped Jackknife allows you to delete an entire cluster (one school) at a time, preserving the correlation structure within the data.
Estimate of total from a survey sample
This is the formulation for the total from a survey sample.
![]()
![]()
Group Jackknife
- Drop a group, or set the weights to 0 for that group to create the subset.
- Update the weights:

- Calculate the replicate statistic:

![Rendered by QuickLaTeX.com \[\text{Var}_{jk}(\hat{Y}) = \frac{G-1}{G} \left( 1-\frac{n}{N} \right) \sum_{g=1}^{G} \left( \hat{Y}_{g} - \bar{Y}_{\cdot} \right)^2\]](https://gradientdescending.com/wp-content/ql-cache/quicklatex.com-f48b3aebb0f49d83241325371894ebb5_l3.png)
![]()
is the number of groups
is the estimate of the g-th group removed
is the mean of the group replicates: 
is an approximation of ![]()
The group Jackknife is convenient since the same variance estimation formula can be applied to any subgroup of the data or estimator, e.g. mean, proportion, etc.
Example in R
library(tidyverse)
# group jackknife ---------------------------------------------------------
# Create data frame
# parameters
N <- 2500
sample_prop<- 0.25
n <- N*sample_prop
p <- 0.2
# make population data frame
data_pop <- tibble(
id = 1:N,
y = sample(c(0, 1), N, replace = TRUE, prob = c(1-p, p))
)
# randomise weights
wt <- rgamma(n, shape = N/n-1)+1
# take sample
data <- data_pop |>
sample_n(n) |>
mutate(wt = wt/sum(wt)*N)
# check sum of weights
sum(data$wt)
hist(wt, breaks = 30)
# Calculate the true variance
# True estimate
Y_true <- sum(data_pop$y)
# Sample estimate
y_hat <- sum(data$wt * data$y)
# S2 and s2
S2 <- sum((data_pop$y - mean(data_pop$y))^2)/(N-1)
s2 <- sum((data$y - sum(data$y * data$wt)/sum(data$wt))^2)/(n-1)
var_Y_true <- N^2*S2/n
var_Y_hat <- N^2*s2/n
# Assign Groups
# We randomly assign every row to one of 10 groups
n_groups <- 60
data$group_id <- sort(1:nrow(data) %% n_groups + 1)
# data$group_id <- sample(data$group_id)
# Initialize container for the group estimates
jk_group_Y <- numeric(n_groups)
# Loop through each group (Delete-a-Group)
Wt <- matrix(wt, nrow = n, ncol = n_groups)
# drop a group by setting the weight to 0
for(g in 1:n_groups) {
Wt[data$group_id == g,g] <- 0
}
# Adjust weights
# Since we removed 1/60th of the data, we must scale up the remaining
# weights by g / (g - 1) so they represent the full population.
Wt <- Wt * (n_groups / (n_groups - 1))
# Calculate the weighted total for the replicates
jk_group_Y <- colSums(Wt * data$y)
# Calculate Grouped Jackknife Variance
# Formula: ((g-1)/g) * Sum of Squares
# Note: The multiplier is (g-1)/g, which is the inverse of the standard JK multiplier.
jk_mean <- mean(jk_group_Y)
jk_ss <- sum((jk_group_Y - jk_mean)^2)
jk_var <- ((n_groups - 1) / n_groups) * jk_ss
# Output results
cat(
paste(" True Total Estimate: ", round(sum(data_pop$y), 2)), "\n",
paste("Sample Total Estimate: ", round(sum(data$y * data$wt), 2)), "\n\n",
paste("True Variance: ", round(var_Y_true, 2)), "\n",
paste("Grouped JK Variance: ", round(jk_var, 2)), "\n\n",
paste("True SE: ", round(sqrt(var_Y_true), 2)), "\n",
paste("Grouped JK SE: ", round(sqrt(jk_var), 2)), "\n"
)

