| Title: | Delete-d Jackknife for Point and Interval Estimation |
|---|---|
| Description: | This function generates jackknife samples by systematically leaving out d observations from the original dataset. It performs statistical estimation on each jackknife sample and computes jackknife statistics, including coefficients, bias correction, standard errors, and confidence intervals. \n The methodology builds upon the foundational work of Quenouille (1956) <doi:10.2307/2332914> and Tukey (1958) <doi:10.1214/aoms/1177706647> with extensions for dependent data following Shi (1988) <doi:10.1016/0167-7152(88)90011-9> |
| Authors: | S. Mohanasundaram [aut, cre] (ORCID = 0000-0003-4639-9419) |
| Maintainer: | S. Mohanasundaram <[email protected]> |
| License: | GPL (>= 3) |
| Version: | 2.0.0 |
| Built: | 2026-06-08 08:03:07 UTC |
| Source: | https://github.com/mohanasundarams/jackknifer |
This function creates jackknife samples from the data by sequentially removing d observations from the data, and calculates the estimates by the specified function and its bias, standard error, and confidence intervals.
jackknife( statistic, d = 1, data, conf = 0.95, numCores = detectCores(), weight = FALSE, hat_values = NULL, residuals = NULL, X = NULL, p = NULL )jackknife( statistic, d = 1, data, conf = 0.95, numCores = detectCores(), weight = FALSE, hat_values = NULL, residuals = NULL, X = NULL, p = NULL )
statistic |
a function returning a vector of estimates to be passed to jackknife |
d |
Number of observations to be deleted from data to make jackknife samples. The default is 1 (for delete-1 jackknife). |
data |
Data frame with dependent and independent independent variables specified in the formula |
conf |
Confidence level, a positive number < 1. The default is 0.95. |
numCores |
Number of processors to be used |
weight |
Logical, TRUE for weighted jackknife standard error of regression estimates. Default weight = FALSE |
hat_values |
Vector of hat values (leverages) from the model. Required if 'weight = TRUE |
residuals |
Vector of residuals from the model. Required if |
X |
Model matrix. Required if |
p |
Number of predictors in the model. Required if |
A list containing a summary data frame of jackknife estimates with bias, standard error. t-statistics, and confidence intervals, estimate for the original sample and a data frame with estimates for jackknife samples.
Quenouille, M. H. (1956). Notes on Bias in Estimation. Biometrika, 43(3/4), 353-360. doi:10.2307/2332914
Tukey, J. W. (1958). Bias and Confidence in Not-quite Large Samples. Annals of Mathematical Statistics, 29(2), 614-623. doi:10.1214/aoms/1177706647
Shi, X. (1988). A note on the delete-d jackknife variance estimators. Statistics & Probability Letters, 6(5), 341-347. doi:10.1016/0167-7152(88)90011-9
jackknife.lm() which is used for jackknifing in linear regression.
library(future) plan(multisession) # Initialize once per session # For linear regression coefficients jk_results <- jackknife( statistic = function(sub_data) coef(lm(mpg ~ wt + hp, data = sub_data)), d = 2, data = mtcars, conf = 0.95) print(jk_results)library(future) plan(multisession) # Initialize once per session # For linear regression coefficients jk_results <- jackknife( statistic = function(sub_data) coef(lm(mpg ~ wt + hp, data = sub_data)), d = 2, data = mtcars, conf = 0.95) print(jk_results)
This function creates jackknife samples from the data by sequentially removing d observations, calculates the correlation, and estimates bias, standard error, and confidence intervals.
jackknife.cor(data, d = 1, conf = 0.95, numCores = parallel::detectCores())jackknife.cor(data, d = 1, conf = 0.95, numCores = parallel::detectCores())
data |
A data frame with two numeric columns. |
d |
Number of observations to delete (default: 1). |
conf |
Confidence level (default: 0.95). |
numCores |
Number of processors (default: |
A list of class "jackknife" containing estimates, bias, standard error, and confidence intervals.
Quenouille (1956), Tukey (1958), Shi (1988).
j.cor <- jackknife.cor(cars, d = 2, numCores = 2) summary(j.cor)j.cor <- jackknife.cor(cars, d = 2, numCores = 2) summary(j.cor)
This function creates jackknife samples from the data by sequentially removing d observations from the data, fits models linear regression model using the jackknife samples as specified in the formula and estimates the jackknife coefficients bias standard error, standard error and confidence intervals.
jackknife.lm(formula, d = 1, data, conf = 0.95, numCores = detectCores())jackknife.lm(formula, d = 1, data, conf = 0.95, numCores = detectCores())
formula |
Simple or multiple linear regression formula with dependent and independent variables |
d |
Number of observations to be deleted from data to make jackknife samples. The default is 1 (for delete-1 jackknife). |
data |
Data frame with dependent and independent independent variables specified in the formula |
conf |
Confidence level, a positive number < 1. The default is 0.95. |
numCores |
Number of processors to be used |
A list containing a summary data frame of jackknife estimates with bias, standard error. t-statistics, and confidence intervals, linear regression model of original data and a data frame with coefficient estimates of jackknife samples.
Quenouille, M. H. (1956). Notes on Bias in Estimation. Biometrika, 43(3/4), 353-360. doi:10.2307/2332914
Tukey, J. W. (1958). Bias and Confidence in Not-quite Large Samples. Annals of Mathematical Statistics, 29(2), 614-623. doi:10.1214/aoms/1177706647
Shi, X. (1988). A note on the delete-d jackknife variance estimators. Statistics & Probability Letters, 6(5), 341-347. doi:10.1016/0167-7152(88)90011-9
lm() which is used for linear regression.
## library(jackknifeR) jk <- jackknife.lm(mpg ~ wt + hp, d = 2, data = mtcars, numCores = 2) summary(jk)## library(jackknifeR) jk <- jackknife.lm(mpg ~ wt + hp, d = 2, data = mtcars, numCores = 2) summary(jk)
This function creates jackknife samples from the data by sequentially removing d observations from the data, fits models linear regression model using the jackknife samples as specified in the formula and estimates the jackknife coefficients bias standard error, standard error and confidence intervals.
jackknife.lm.weighted( formula, d = 1, data, conf = 0.95, numCores = detectCores() )jackknife.lm.weighted( formula, d = 1, data, conf = 0.95, numCores = detectCores() )
formula |
Simple or multiple linear regression formula with dependent and independent variables |
d |
Number of observations to be deleted from data to make jackknife samples. The default is 1 (for delete-1 jackknife). |
data |
Data frame with dependent and independent independent variables specified in the formula |
conf |
Confidence level, a positive number < 1. The default is 0.95. |
numCores |
Number of processors to be used |
A list containing a summary data frame of jackknife estimates with bias, standard error. t-statistics, and confidence intervals, linear regression model of original data and a data frame with coefficient estimates of jackknife samples.
Quenouille, M. H. (1956). Notes on Bias in Estimation. Biometrika, 43(3/4), 353-360. doi:10.2307/2332914
Tukey, J. W. (1958). Bias and Confidence in Not-quite Large Samples. Annals of Mathematical Statistics, 29(2), 614-623. doi:10.1214/aoms/1177706647
Shi, X. (1988). A note on the delete-d jackknife variance estimators. Statistics & Probability Letters, 6(5), 341-347. doi:10.1016/0167-7152(88)90011-9
lm() which is used for linear regression.
## library(jackknifeR) jk_weighted <- jackknife.lm.weighted(mpg ~ wt + hp, d = 2, data = mtcars) summary(jk_weighted)## library(jackknifeR) jk_weighted <- jackknife.lm.weighted(mpg ~ wt + hp, d = 2, data = mtcars) summary(jk_weighted)