Type: | Package |
Title: | Statistical Inference in High Dimensional Regression |
Version: | 2.1.0 |
Description: | The goal of SIHR is to provide inference procedures in the high-dimensional generalized linear regression setting for: (1) linear functionals <doi:10.48550/arXiv.1904.12891> <doi:10.48550/arXiv.2012.07133>, (2) conditional average treatment effects, (3) quadratic functionals <doi:10.48550/arXiv.1909.01503>, (4) inner product, (5) distance. |
License: | GPL-3 |
Encoding: | UTF-8 |
RoxygenNote: | 7.3.1 |
URL: | https://zywang0701.github.io/SIHR/ |
BugReports: | https://github.com/zywang0701/SIHR/issues |
Imports: | CVXR, glmnet, stats |
Suggests: | knitr, rmarkdown, R.rsp |
VignetteBuilder: | knitr, R.rsp |
NeedsCompilation: | no |
Packaged: | 2024-04-24 18:11:49 UTC; zw425 |
Author: | Zhenyu Wang [aut], Prabrisha Rakshit [aut], Tony Cai [aut], Zijian Guo [aut, cre] |
Maintainer: | Zijian Guo <zijguo@stat.rutgers.edu> |
Repository: | CRAN |
Date/Publication: | 2024-04-24 18:40:04 UTC |
Inference for difference of linear combinations of the regression vectors in high dimensional generalized linear regressions
Description
Computes the bias-corrected estimator of the difference of linear combinations of the regression vectors for the high dimensional generalized linear regressions and the corresponding standard error.
Usage
CATE(
X1,
y1,
X2,
y2,
loading.mat,
model = c("linear", "logistic", "logistic_alter"),
intercept = TRUE,
intercept.loading = FALSE,
beta.init1 = NULL,
beta.init2 = NULL,
lambda = NULL,
mu = NULL,
prob.filter = 0.05,
rescale = 1.1,
verbose = FALSE
)
Arguments
X1 |
Design matrix for the first sample, of dimension |
y1 |
Outcome vector for the first sample, of length |
X2 |
Design matrix for the second sample, of dimension |
y2 |
Outcome vector for the second sample, of length |
loading.mat |
Loading matrix, nrow= |
model |
The high dimensional regression model, either |
intercept |
Should intercept(s) be fitted for the initial estimators
(default = |
intercept.loading |
Should intercept term be included for the
|
beta.init1 |
The initial estimator of the regression vector for the 1st
data (default = |
beta.init2 |
The initial estimator of the regression vector for the 2nd
data (default = |
lambda |
The tuning parameter in fitting initial model. If |
mu |
The dual tuning parameter used in the construction of the
projection direction. If |
prob.filter |
The threshold of estimated probabilities for filtering observations in logistic regression. (default = 0.05) |
rescale |
The factor to enlarge the standard error to account for the finite sample bias. (default = 1.1) |
verbose |
Should intermediate message(s) be printed (default =
|
Value
A list consists of plugin estimators, debiased estimators, and confidence intervals. For logistic regression, it also returns those items after probability transformation.
est.plugin.vec |
The vector of plugin(biased) estimators for the
linear combination of regression coefficients, length of |
est.debias.vec |
The vector of bias-corrected estimators for the linear
combination of regression coefficients, length of |
se.vec |
The vector of standard errors of the bias-corrected estimators,
length of |
prob.debias.vec |
The vector of bias-corrected estimators after probability
transformation, length of |
prob.se.vec |
The vector of standard errors of the bias-corrected
estimators after probability transformation, length of |
Examples
X1 <- matrix(rnorm(100 * 5), nrow = 100, ncol = 5)
y1 <- -0.5 + X1[, 1] * 0.5 + X1[, 2] * 1 + rnorm(100)
X2 <- matrix(rnorm(90 * 5), nrow = 90, ncol = 5)
y2 <- -0.4 + X2[, 1] * 0.48 + X2[, 2] * 1.1 + rnorm(90)
loading1 <- c(1, 1, rep(0, 3))
loading2 <- c(-0.5, -1, rep(0, 3))
loading.mat <- cbind(loading1, loading2)
Est <- CATE(X1, y1, X2, y2, loading.mat, model = "linear")
## compute confidence intervals
ci(Est, alpha = 0.05, alternative = "two.sided")
## summary statistics
summary(Est)
Inference for weighted quadratic functional of difference of the regression vectors (excluding the intercept term) in high dimensional generalized linear regressions.
Description
Inference for weighted quadratic functional of difference of the regression vectors (excluding the intercept term) in high dimensional generalized linear regressions.
Usage
Dist(
X1,
y1,
X2,
y2,
G,
A = NULL,
model = c("linear", "logistic", "logistic_alter"),
intercept = TRUE,
beta.init1 = NULL,
beta.init2 = NULL,
split = TRUE,
lambda = NULL,
mu = NULL,
prob.filter = 0.05,
rescale = 1.1,
tau = c(0.25, 0.5, 1),
verbose = FALSE
)
Arguments
X1 |
Design matrix for the first sample, of dimension |
y1 |
Outcome vector for the first sample, of length |
X2 |
Design matrix for the second sample, of dimension |
y2 |
Outcome vector for the second sample, of length |
G |
The set of indices, |
A |
The matrix A in the quadratic form, of dimension
|
model |
The high dimensional regression model, either |
intercept |
Should intercept(s) be fitted for the initial estimators
(default = |
beta.init1 |
The initial estimator of the regression vector for the 1st
data (default = |
beta.init2 |
The initial estimator of the regression vector for the 2nd
data (default = |
split |
Sampling splitting or not for computing the initial estimators.
It take effects only when |
lambda |
The tuning parameter in fitting initial model. If |
mu |
The dual tuning parameter used in the construction of the
projection direction. If |
prob.filter |
The threshold of estimated probabilities for filtering observations in logistic regression. (default = 0.05) |
rescale |
The factor to enlarge the standard error to account for the finite sample bias. (default = 1.1) |
tau |
The enlargement factor for asymptotic variance of the
bias-corrected estimator to handle super-efficiency. It allows for a scalar
or vector. (default = |
verbose |
Should intermediate message(s) be printed. (default =
|
Value
est.plugin |
The plugin(biased) estimator for the quadratic form
of the regression vectors restricted to |
est.debias |
The bias-corrected estimator of the quadratic form of the regression vectors |
se |
Standard errors of the bias-corrected estimator,
length of |
Examples
X1 <- matrix(rnorm(100 * 5), nrow = 100, ncol = 5)
y1 <- -0.5 + X1[, 1] * 0.5 + X1[, 2] * 1 + rnorm(100)
X2 <- matrix(rnorm(90 * 5), nrow = 90, ncol = 5)
y2 <- -0.4 + X2[, 1] * 0.48 + X2[, 2] * 1.1 + rnorm(90)
G <- c(1, 2)
A <- matrix(c(1.5, 0.8, 0.8, 1.5), nrow = 2, ncol = 2)
Est <- Dist(X1, y1, X2, y2, G, A, model = "linear")
## compute confidence intervals
ci(Est, alpha = 0.05, alternative = "two.sided")
## summary statistics
summary(Est)
Inference for weighted inner product of the regression vectors in high dimensional generalized linear regressions
Description
Inference for weighted inner product of the regression vectors in high dimensional generalized linear regressions
Usage
InnProd(
X1,
y1,
X2,
y2,
G,
A = NULL,
model = c("linear", "logistic", "logistic_alter"),
intercept = TRUE,
beta.init1 = NULL,
beta.init2 = NULL,
split = TRUE,
lambda = NULL,
mu = NULL,
prob.filter = 0.05,
rescale = 1.1,
tau = c(0.25, 0.5, 1),
verbose = FALSE
)
Arguments
X1 |
Design matrix for the first sample, of dimension |
y1 |
Outcome vector for the first sample, of length |
X2 |
Design matrix for the second sample, of dimension |
y2 |
Outcome vector for the second sample, of length |
G |
The set of indices, |
A |
The matrix A in the quadratic form, of dimension
|
model |
The high dimensional regression model, either |
intercept |
Should intercept(s) be fitted for the initial estimators
(default = |
beta.init1 |
The initial estimator of the regression vector for the 1st
data (default = |
beta.init2 |
The initial estimator of the regression vector for the 2nd
data (default = |
split |
Sampling splitting or not for computing the initial estimators.
It take effects only when |
lambda |
The tuning parameter in fitting initial model. If |
mu |
The dual tuning parameter used in the construction of the
projection direction. If |
prob.filter |
The threshold of estimated probabilities for filtering observations in logistic regression. (default = 0.05) |
rescale |
The factor to enlarge the standard error to account for the finite sample bias. (default = 1.1) |
tau |
The enlargement factor for asymptotic variance of the
bias-corrected estimator to handle super-efficiency. It allows for a scalar
or vector. (default = |
verbose |
Should intermediate message(s) be printed. (default =
|
Value
est.plugin |
The plugin(biased) estimator for the inner product
form of the regression vectors restricted to |
est.debias |
The bias-corrected estimator of the inner product form of the regression vectors |
se |
Standard errors of the bias-corrected estimator,
length of |
Examples
X1 <- matrix(rnorm(100 * 5), nrow = 100, ncol = 5)
y1 <- -0.5 + X1[, 1] * 0.5 + X1[, 2] * 1 + rnorm(100)
X2 <- matrix(rnorm(90 * 5), nrow = 90, ncol = 5)
y2 <- -0.4 + X2[, 1] * 0.48 + X2[, 2] * 1.1 + rnorm(90)
G <- c(1, 2)
A <- matrix(c(1.5, 0.8, 0.8, 1.5), nrow = 2, ncol = 2)
Est <- InnProd(X1, y1, X2, y2, G, A, model = "linear")
## compute confidence intervals
ci(Est, alpha = 0.05, alternative = "two.sided")
## summary statistics
summary(Est)
Inference for linear combination of the regression vector in high dimensional generalized linear regression
Description
Inference for linear combination of the regression vector in high dimensional generalized linear regression
Usage
LF(
X,
y,
loading.mat,
model = c("linear", "logistic", "logistic_alter"),
intercept = TRUE,
intercept.loading = FALSE,
beta.init = NULL,
lambda = NULL,
mu = NULL,
prob.filter = 0.05,
rescale = 1.1,
verbose = FALSE
)
Arguments
X |
Design matrix, of dimension |
y |
Outcome vector, of length |
loading.mat |
Loading matrix, nrow= |
model |
The high dimensional regression model, either |
intercept |
Should intercept be fitted for the initial estimator
(default = |
intercept.loading |
Should intercept term be included for the loading
(default = |
beta.init |
The initial estimator of the regression vector (default =
|
lambda |
The tuning parameter in fitting initial model. If |
mu |
The dual tuning parameter used in the construction of the
projection direction. If |
prob.filter |
The threshold of estimated probabilities for filtering observations in logistic regression. (default = 0.05) |
rescale |
The factor to enlarge the standard error to account for the finite sample bias. (default = 1.1) |
verbose |
Should intermediate message(s) be printed. (default =
|
Value
est.plugin.vec |
The vector of plugin(biased) estimators for the
linear combination of regression coefficients, length of
|
est.debias.vec |
The vector of bias-corrected estimators for the linear
combination of regression coefficients, length of |
se.vec |
The vector of standard errors of the bias-corrected estimators,
length of |
proj.mat |
The matrix of projection directions; each column corresponding to a loading of interest. |
Examples
X <- matrix(rnorm(100 * 5), nrow = 100, ncol = 5)
y <- -0.5 + X[, 1] * 0.5 + X[, 2] * 1 + rnorm(100)
loading1 <- c(1, 1, rep(0, 3))
loading2 <- c(-0.5, -1, rep(0, 3))
loading.mat <- cbind(loading1, loading2)
Est <- LF(X, y, loading.mat, model = "linear")
## compute confidence intervals
ci(Est, alpha = 0.05, alternative = "two.sided")
## summary statistics
summary(Est)
Inference for quadratic forms of the regression vector in high dimensional generalized linear regressions
Description
Inference for quadratic forms of the regression vector in high dimensional generalized linear regressions
Usage
QF(
X,
y,
G,
A = NULL,
model = c("linear", "logistic", "logistic_alter"),
intercept = TRUE,
beta.init = NULL,
split = TRUE,
lambda = NULL,
mu = NULL,
prob.filter = 0.05,
rescale = 1.1,
tau = c(0.25, 0.5, 1),
verbose = FALSE
)
Arguments
X |
Design matrix, of dimension |
y |
Outcome vector, of length |
G |
The set of indices, |
A |
The matrix A in the quadratic form, of dimension
|
model |
The high dimensional regression model, either |
intercept |
Should intercept be fitted for the initial estimator
(default = |
beta.init |
The initial estimator of the regression vector (default =
|
split |
Sampling splitting or not for computing the initial estimator.
It take effects only when |
lambda |
The tuning parameter in fitting initial model. If |
mu |
The dual tuning parameter used in the construction of the
projection direction. If |
prob.filter |
The threshold of estimated probabilities for filtering observations in logistic regression. (default = 0.05) |
rescale |
The factor to enlarge the standard error to account for the finite sample bias. (default = 1.1) |
tau |
The enlargement factor for asymptotic variance of the
bias-corrected estimator to handle super-efficiency. It allows for a scalar
or vector. (default = |
verbose |
Should intermediate message(s) be printed. (default =
|
Value
est.plugin |
The plugin(biased) estimator for the quadratic form of the
regression vector restricted to |
est.debias |
The bias-corrected estimator of the quadratic form of the regression vector |
se |
Standard errors of the bias-corrected estimator,
length of |
Examples
X <- matrix(rnorm(100 * 5), nrow = 100, ncol = 5)
y <- X[, 1] * 0.5 + X[, 2] * 1 + rnorm(100)
G <- c(1, 2)
A <- matrix(c(1.5, 0.8, 0.8, 1.5), nrow = 2, ncol = 2)
Est <- QF(X, y, G, A, model = "linear")
## compute confidence intervals
ci(Est, alpha = 0.05, alternative = "two.sided")
## summary statistics
summary(Est)
Confidence Intervals for Bias-corrected Estimators
Description
generic function
Usage
ci(
object,
probability = FALSE,
alpha = 0.05,
alternative = c("two.sided", "less", "greater"),
...
)
Arguments
object |
An object of class |
probability |
Whether returns CI with probability transformation or not
(default= |
alpha |
Level of significance to construct confidence interval (default=0.05) |
alternative |
Indicates the alternative hypothesis to construct confidence interval and must be one of "two.sided" (default), "less", or "greater". |
... |
arguments to pass down |
Confidence Intervals for Bias-corrected CATE Estimators
Description
Computes confidence intervals for bias-corrected estimators; Each row corresponds to a loading.
Usage
## S3 method for class 'CATE'
ci(
object,
probability = FALSE,
alpha = 0.05,
alternative = c("two.sided", "less", "greater"),
...
)
Arguments
object |
An object of class 'CATE', a result of a call to 'CATE' |
probability |
Whether returns CI with probability transformation or not
(default= |
alpha |
Level of significance to construct confidence interval (default=0.05) |
alternative |
Indicates the alternative hypothesis to construct confidence interval and must be one of "two.sided" (default), "less", or "greater". |
... |
arguments to pass down |
Value
A matrix with columns giving lower and upper confidence limits for bias-corrected estimators.
Examples
## Not run:
## -- Continuing the CATE(.) example:
out <- ci(Est)
out
## End(Not run)
Confidence Intervals for Bias-corrected Dist Estimators
Description
Computes confidence intervals for bias-corrected estimator
Usage
## S3 method for class 'Dist'
ci(
object,
probability = FALSE,
alpha = 0.05,
alternative = c("two.sided", "less", "greater"),
...
)
Arguments
object |
An object of class 'Dist', a result of a call to 'Dist' |
alpha |
Level of significance to construct confidence interval (default=0.05) |
alternative |
Indicates the alternative hypothesis to construct confidence interval and must be one of "two.sided" (default), "less", or "greater". |
... |
arguments to pass down |
Value
A vector giving lower and upper confidence limits for bias-corrected estimator
Examples
## Not run:
## -- Continuing the Dist(.) example:
out <- ci(Est)
out
## End(Not run)
Confidence Intervals for Bias-corrected InnProd Estimators
Description
Computes confidence intervals for bias-corrected estimator
Usage
## S3 method for class 'InnProd'
ci(
object,
probability = FALSE,
alpha = 0.05,
alternative = c("two.sided", "less", "greater"),
...
)
Arguments
object |
An object of class 'InnProd', a result of a call to 'InnProd' |
alpha |
Level of significance to construct confidence interval (default=0.05) |
alternative |
Indicates the alternative hypothesis to construct confidence interval and must be one of "two.sided" (default), "less", or "greater". |
... |
arguments to pass down |
Value
A vector giving lower and upper confidence limits for bias-corrected estimator
Examples
## Not run:
## -- Continuing the InnProd(.) example:
out <- ci(Est)
out
## End(Not run)
Confidence Intervals for Bias-corrected LF Estimators
Description
Computes confidence intervals for bias-corrected estimators; Each row corresponds to a loading.
Usage
## S3 method for class 'LF'
ci(
object,
probability = FALSE,
alpha = 0.05,
alternative = c("two.sided", "less", "greater"),
...
)
Arguments
object |
An object of class 'LF', a result of a call to 'LF' |
probability |
Whether returns CI with probability transformation or not
(default= |
alpha |
Level of significance to construct confidence interval (default=0.05) |
alternative |
Indicates the alternative hypothesis to construct confidence interval and must be one of "two.sided" (default), "less", or "greater". |
... |
arguments to pass down |
Value
A matrix with columns giving lower and upper confidence limits for bias-corrected estimators.
Examples
## Not run:
## -- Continuing the LF(.) example:
out <- ci(Est)
out
## End(Not run)
Confidence Intervals for Bias-corrected QF Estimators
Description
Computes confidence intervals for bias-corrected estimators; Each row corresponds to a tau value.
Usage
## S3 method for class 'QF'
ci(
object,
probability = FALSE,
alpha = 0.05,
alternative = c("two.sided", "less", "greater"),
...
)
Arguments
object |
An object of class 'QF', a result of a call to 'QF' |
probability |
Whether returns CI with probability transformation or not
(default= |
alpha |
Level of significance to construct confidence interval (default=0.05) |
alternative |
Indicates the alternative hypothesis to construct confidence interval and must be one of "two.sided" (default), "less", or "greater". |
... |
arguments to pass down |
Value
A matrix with columns giving lower and upper confidence limits for bias-corrected estimators, with rows corresponding to different tau.
Examples
## Not run:
## -- Continuing the QF(.) example:
out <- ci(Est)
out
## End(Not run)
Printing Summarizing CATE
Description
'print' method for class 'summary.CATE'
Usage
## S3 method for class 'summary.CATE'
print(x, digits = max(3, getOption("digits") - 3), ...)
Arguments
x |
An object of class 'summary.CATE', a result of a call to 'summary.CATE' |
digits |
The number of digits to use when printing |
... |
arguments to pass down |
Examples
## Not run:
#' ##-- Continuing the CATE(.) example:
summary(Est)
## End(Not run)
Printing summarizing Dist
Description
'print' method for class 'summary.Dist'
Usage
## S3 method for class 'summary.Dist'
print(x, digits = max(3, getOption("digits") - 3), ...)
Arguments
x |
An object of class 'summary.Dist', a result of a call to 'summary.Dist' |
digits |
The number of digits to use when printing |
... |
arguments to pass down |
Examples
## Not run:
#' ##-- Continuing the Dist(.) example:
summary(Est)
## End(Not run)
Printing summarizing InnProd
Description
'print' method for class 'summary.InnProd'
Usage
## S3 method for class 'summary.InnProd'
print(x, digits = max(3, getOption("digits") - 3), ...)
Arguments
x |
An object of class 'summary.InnProd', a result of a call to 'summary.InnProd' |
digits |
The number of digits to use when printing |
... |
arguments to pass down |
Examples
## Not run:
#' ##-- Continuing the InnProd(.) example:
summary(Est)
## End(Not run)
Printing Summarizing LF
Description
'print' method for class 'summary.LF'
Usage
## S3 method for class 'summary.LF'
print(x, digits = max(3, getOption("digits") - 3), ...)
Arguments
x |
An object of class 'summary.LF', a result of a call to 'summary.LF' |
digits |
The number of digits to use when printing |
... |
arguments to pass down |
Examples
## Not run:
#' ##-- Continuing the LF(.) example:
summary(Est)
## End(Not run)
Printing ummarizing QF
Description
'print' method for class 'summary.QF'
Usage
## S3 method for class 'summary.QF'
print(x, digits = max(3, getOption("digits") - 3), ...)
Arguments
x |
An object of class 'summary.QF', a result of a call to 'summary.QF' |
digits |
The number of digits to use when printing |
... |
arguments to pass down |
Examples
## Not run:
#' ##-- Continuing the QF(.) example:
summary(Est)
## End(Not run)
Summarizing CATE
Description
'summary' method for class 'CATE'
Usage
## S3 method for class 'CATE'
summary(object, ...)
Arguments
object |
An object of class 'CATE', a result of a call to 'CATE' |
... |
arguments to pass down |
Value
The function 'summary.CATE' computes and returns a list of summary statistics.
output.est |
a |
Examples
## Not run:
## -- Continuing the CATE(.) example:
sEst <- summary(Est)
sEst
## End(Not run)
Summarizing Dist
Description
'summary' method for class 'Dist'
Usage
## S3 method for class 'Dist'
summary(object, ...)
Arguments
object |
An object of class 'Dist', a result of a call to 'Dist' |
... |
arguments to pass down |
Value
The function 'summary.Dist' computes and returns a list of summary statistics.
output.est |
A 6-dimensional vector with elements for plugin(biased) estimators, bias-corrected estimators, its standard error, z-statistic, corresponding (two-sided) p-value and significance stars |
Examples
## Not run:
## -- Continuing the Dist(.) example:
sEst <- summary(Est)
sEst
## End(Not run)
Summarizing InnProd
Description
'summary' method for class 'InnProd'
Usage
## S3 method for class 'InnProd'
summary(object, ...)
Arguments
object |
An object of class 'InnProd', a result of a call to 'InnProd' |
... |
arguments to pass down |
Value
The function 'summary.InnProd' computes and returns a list of summary statistics.
output.est |
A 6-dimensional vector with elements for plugin(biased) estimators, bias-corrected estimators, its standard error, z-statistic, corresponding (two-sided) p-value and significance stars |
Examples
## Not run:
## -- Continuing the InnProd(.) example:
sEst <- summary(Est)
sEst
## End(Not run)
Summarizing LF
Description
'summary' method for class 'LF'
Usage
## S3 method for class 'LF'
summary(object, ...)
Arguments
object |
An object of class 'LF', a result of a call to 'LF' |
... |
arguments to pass down |
Value
The function 'summary.LF' computes and returns a list of summary statistics.
output.est |
a |
Examples
## Not run:
## -- Continuing the LF(.) example:
sEst <- summary(Est)
sEst
## End(Not run)
Summarizing QF
Description
'summary' method for class 'QF'
Usage
## S3 method for class 'QF'
summary(object, ...)
Arguments
object |
An object of class 'QF', a result of a call to 'QF' |
... |
arguments to pass down |
Value
The function 'summary.QF' computes and returns a list of summary statistics.
output.est |
a |
Examples
## Not run:
## -- Continuing the QF(.) example:
sEst <- summary(Est)
sEst
## End(Not run)