Title: | Tests for High Dimensional Generalized Linear Models |
---|---|
Description: | Test the significance of coefficients in high dimensional generalized linear models. |
Authors: | Bin Guo |
Maintainer: | Bin Guo <[email protected]> |
License: | GPL-2 |
Version: | 0.1 |
Built: | 2024-12-12 06:46:12 UTC |
Source: | CRAN |
Generate the covariates and the response for generalized linear models in simulation.
DGP(n, p, alpha, norm = 0, no = NA, betanui = NULL, model = "gaussian")
DGP(n, p, alpha, norm = 0, no = NA, betanui = NULL, model = "gaussian")
n |
the sample size. |
p |
the dimension of the covariates. |
alpha |
the coefficients in moving average model |
norm |
the norm of coefficient vector under the alternative hypothesis (norm of |
no |
the number of nonzero coefficients under the alternative hypothesis (do not account the number of nuisance parameter). The default is |
betanui |
the vector which denotes the value of the nuisance coefficients. The default is |
model |
a character string to describe the model. The default is |
An object of class "DGP" is a list containing the following components:
X |
the design matrix with |
Y |
the response with length |
The covariates are generated by the moving average model
where were generated from the
dimensional standard normal distribution
Bin Guo
Guo, B. and Chen, S. X. (2015). Tests for High Dimensional Generalized Linear Models.
alpha=runif(5,min=0,max=1) ## Example 1: Linear model ## H_0: \beta_0=0 DGP_0=DGP(80,320,alpha) ## Example 2: Logistic model ## H_0: \beta_0=0 DGP_0=DGP(80,320,alpha,model="logistic") ## Example 3: Linear model with the first five coefficients to be nonzero, ## the square of the norm of the coefficients to be 0.2 DGP_0=DGP(80,320,alpha,sqrt(0.2),5)
alpha=runif(5,min=0,max=1) ## Example 1: Linear model ## H_0: \beta_0=0 DGP_0=DGP(80,320,alpha) ## Example 2: Logistic model ## H_0: \beta_0=0 DGP_0=DGP(80,320,alpha,model="logistic") ## Example 3: Linear model with the first five coefficients to be nonzero, ## the square of the norm of the coefficients to be 0.2 DGP_0=DGP(80,320,alpha,sqrt(0.2),5)
Tests for whole or partial regression coefficient vectors for high dimensional generalized linear models.
HDGLM_test(Y, X, beta_0 = NULL, nuisance = NULL, model = "gaussian")
HDGLM_test(Y, X, beta_0 = NULL, nuisance = NULL, model = "gaussian")
Y |
a vector of observations of length |
X |
a design matrix with |
beta_0 |
a vector with length |
nuisance |
an index indicating which coefficients are nuisance parameter. The default is |
model |
a character string to describe the model and link function. The default is |
An object of class "HDGLM_test" is a list containing the following components:
test_stat |
the standardized test statistic |
test_pvalue |
pvalue of the test against the null hypothesis |
In global test, the function "HDGLM_test"
can deal with the null hypothesis with non-zero coefficients (). However, in test with nuisance coefficient,
the function can only deal with the null hypothesis with zero coefficients (
) in this version.
Bin Guo
Guo, B. and Chen, S. X. (2015). Tests for High Dimensional Generalized Linear Models.
## Example: Linear model ## Global test: if the null hypothesis is true (beta_0=0) alpha=runif(5,min=0,max=1) ## Generate the data DGP_0=DGP(80,320,alpha) result=HDGLM_test(DGP_0$Y,DGP_0$X) ## Pvalue result$test_pvalue ## Global test: if the alternative hypothesis is true ## (the square of the norm of the first 5 nonzero coefficients to be 0.2) ## Generate the data DGP_0=DGP(80,320,alpha,sqrt(0.2),5) result=HDGLM_test(DGP_0$Y,DGP_0$X) ## Pvalue result$test_pvalue ## Test with nuisance coefficients: if the null hypothesis is true (beta_0^{(2)}=0) ## The first 10 coefficients to be the nuisance coefficients betanui=runif(10,min=0,max=1) ## Generate the data DGP_0=DGP(80,320,alpha,0,no=NA,betanui) result=HDGLM_test(DGP_0$Y,DGP_0$X,nuisance=c(1:10)) ## Pvalue result$test_pvalue ## Test with nuisance coefficients: if the alternative hypothesis is true ## (the square of the norm of the first 5 nonzero coefficients in beta_0^{(2)} to be 2) ## The first 10 coefficients to be the nuisance coefficients betanui=runif(10,min=0,max=1) ## Generate the data DGP_0=DGP(80,330,alpha,sqrt(2),no=5,betanui) result=HDGLM_test(DGP_0$Y,DGP_0$X,nuisance=c(1:10)) ## Pvalue result$test_pvalue
## Example: Linear model ## Global test: if the null hypothesis is true (beta_0=0) alpha=runif(5,min=0,max=1) ## Generate the data DGP_0=DGP(80,320,alpha) result=HDGLM_test(DGP_0$Y,DGP_0$X) ## Pvalue result$test_pvalue ## Global test: if the alternative hypothesis is true ## (the square of the norm of the first 5 nonzero coefficients to be 0.2) ## Generate the data DGP_0=DGP(80,320,alpha,sqrt(0.2),5) result=HDGLM_test(DGP_0$Y,DGP_0$X) ## Pvalue result$test_pvalue ## Test with nuisance coefficients: if the null hypothesis is true (beta_0^{(2)}=0) ## The first 10 coefficients to be the nuisance coefficients betanui=runif(10,min=0,max=1) ## Generate the data DGP_0=DGP(80,320,alpha,0,no=NA,betanui) result=HDGLM_test(DGP_0$Y,DGP_0$X,nuisance=c(1:10)) ## Pvalue result$test_pvalue ## Test with nuisance coefficients: if the alternative hypothesis is true ## (the square of the norm of the first 5 nonzero coefficients in beta_0^{(2)} to be 2) ## The first 10 coefficients to be the nuisance coefficients betanui=runif(10,min=0,max=1) ## Generate the data DGP_0=DGP(80,330,alpha,sqrt(2),no=5,betanui) result=HDGLM_test(DGP_0$Y,DGP_0$X,nuisance=c(1:10)) ## Pvalue result$test_pvalue