From fb661ce369a311c8798677cd9481ef81f476ade0 Mon Sep 17 00:00:00 2001 From: lkook Date: Thu, 28 Sep 2023 14:11:52 +0200 Subject: [PATCH 1/5] title --- DESCRIPTION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DESCRIPTION b/DESCRIPTION index d8abf1a..8f1f947 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,6 +1,6 @@ Package: tramicp Type: Package -Title: Model-Based Feature Selection for General Response Types +Title: Model-Based Causal Feature Selection for General Response Types Version: 0.0-1 Authors@R: c(person("Lucas", "Kook", role = c("aut", "cre"), comment = c("ORCID" = "0000-0002-7546-7356"), From 5c1650e9d7bf96f5f1cbce2c4409f71051c48b7b Mon Sep 17 00:00:00 2001 From: lkook Date: Thu, 28 Sep 2023 14:30:18 +0200 Subject: [PATCH 2/5] faster examples --- R/alias.R | 26 +++++++++++++------------- R/methods.R | 2 +- man/pvalues.Rd | 2 +- man/tramicp-alias.Rd | 26 +++++++++++++------------- 4 files changed, 28 insertions(+), 28 deletions(-) diff --git a/R/alias.R b/R/alias.R index 719fe70..24f5ea9 100644 --- a/R/alias.R +++ b/R/alias.R @@ -17,7 +17,7 @@ #' @examples #' set.seed(123) #' d <- dgp_dicp(mod = "boxcox", n = 300) -#' BoxCoxICP(Y ~ X2, data = d, env = ~ E) +#' BoxCoxICP(Y ~ X2, data = d, env = ~ E, type = "wald") #' BoxCoxICP <- function(formula, data, env, verbose = TRUE, type = "residual", test = "gcm.test", controls = NULL, alpha = 0.05, @@ -42,11 +42,11 @@ BoxCoxICP <- function(formula, data, env, verbose = TRUE, type = "residual", #' @examples #' set.seed(123) #' d <- dgp_dicp(mod = "weibull", n = 300) -#' SurvregICP(Y ~ X1 + X2 + X3, data = d, env = ~ E) +#' SurvregICP(Y ~ X1 + X2 + X3, data = d, env = ~ E, type = "wald") #' ### or -#' # survregICP(Y ~ X1 + X2 + X3, data = d, env = ~ E) -#' # CoxphICP(Y ~ X2, data = d, env = ~ E) -#' # coxphICP(Y ~ X2, data = d, env = ~ E) +#' # survregICP(Y ~ X1 + X2 + X3, data = d, env = ~ E, type = "wald") +#' # CoxphICP(Y ~ X2, data = d, env = ~ E, type = "wald") +#' # coxphICP(Y ~ X2, data = d, env = ~ E, type = "wald") #' SurvregICP <- function(formula, data, env, verbose = TRUE, type = "residual", test = "gcm.test", controls = NULL, alpha = 0.05, @@ -109,7 +109,7 @@ coxphICP <- function(formula, data, env, verbose = TRUE, type = "residual", #' @examples #' set.seed(123) #' d <- dgp_dicp(mod = "colr", n = 300) -#' ColrICP(Y ~ X1 + X2 + X3, data = d, env = ~ E, type = "wald", test = "wald") +#' ColrICP(Y ~ X1 + X2 + X3, data = d, env = ~ E, type = "wald") #' ColrICP <- function(formula, data, env, verbose = TRUE, type = "residual", test = "gcm.test", controls = NULL, alpha = 0.05, @@ -154,7 +154,7 @@ CoxphICP <- function(formula, data, env, verbose = TRUE, type = "residual", #' @examples #' set.seed(123) #' d <- dgp_dicp(mod = "coxph", n = 300) -#' LehmannICP(Y ~ X2, data = d, env = ~ E) +#' LehmannICP(Y ~ X2, data = d, env = ~ E, type = "wald") #' LehmannICP <- function(formula, data, env, verbose = TRUE, type = "residual", test = "gcm.test", controls = NULL, alpha = 0.05, @@ -179,9 +179,9 @@ LehmannICP <- function(formula, data, env, verbose = TRUE, type = "residual", #' @examples #' set.seed(123) #' d <- dgp_dicp(mod = "lm", n = 300) -#' LmICP(Y ~ X1 + X2 + X3, data = d, env = ~ E) +#' LmICP(Y ~ X1 + X2 + X3, data = d, env = ~ E, type = "wald") #' ### or -#' # lmICP(Y ~ X1 + X2 + X3, data = d, env = ~ E) +#' # lmICP(Y ~ X1 + X2 + X3, data = d, env = ~ E, type = "wald") #' LmICP <- function(formula, data, env, verbose = TRUE, type = "residual", test = "gcm.test", controls = NULL, alpha = 0.05, @@ -225,9 +225,9 @@ lmICP <- function(formula, data, env, verbose = TRUE, type = "residual", #' @examples #' set.seed(123) #' d <- dgp_dicp(mod = "polr", n = 300) -#' PolrICP(Y ~ X1 + X2 + X3, data = d, env = ~ E) +#' PolrICP(Y ~ X1 + X2 + X3, data = d, env = ~ E, type = "wald") #' ### or -#' # PolrICP(Y ~ X1 + X2 + X3, data = d, env = ~ E) +#' # PolrICP(Y ~ X1 + X2 + X3, data = d, env = ~ E, type = "wald") #' PolrICP <- function(formula, data, env, verbose = TRUE, type = "residual", test = "gcm.test", controls = NULL, alpha = 0.05, @@ -294,7 +294,7 @@ residuals.polr <- function(object, ...) { #' @examples #' set.seed(123) #' d <- dgp_dicp(mod = "binary", n = 300) -#' glmICP(Y ~ X1 + X2 + X3, data = d, env = ~ E, family = "binomial") +#' glmICP(Y ~ X1 + X2 + X3, data = d, env = ~ E, family = "binomial", type = "wald") #' glmICP <- function(formula, data, env, verbose = TRUE, type = "residual", test = "gcm.test", controls = NULL, alpha = 0.05, @@ -329,7 +329,7 @@ glmICP <- function(formula, data, env, verbose = TRUE, type = "residual", #' @examples #' set.seed(123) #' d <- dgp_dicp(mod = "cotram", n = 300) -#' cotramICP(Y ~ X2, data = d, env = ~ E) +#' cotramICP(Y ~ X2, data = d, env = ~ E, type = "wald") #' cotramICP <- function(formula, data, env, verbose = TRUE, type = "residual", test = "gcm.test", controls = NULL, alpha = 0.05, diff --git a/R/methods.R b/R/methods.R index 017cb58..55c8d50 100644 --- a/R/methods.R +++ b/R/methods.R @@ -94,7 +94,7 @@ summary.dICP <- function(object, print_all = FALSE, digits = 3, ...) { #' @examples #' set.seed(123) #' d <- dgp_dicp(n = 1e3, mod = "polr") -#' res <- PolrICP(Y ~ X1 + X2 + X3, data = d, env = ~ E) +#' res <- polrICP(Y ~ X1 + X2 + X3, data = d, env = ~ E, type = "wald") #' pvalues(res, which = "predictor") #' pvalues(res, which = "set") #' pvalues(res, which = "all") diff --git a/man/pvalues.Rd b/man/pvalues.Rd index 58c0fdf..551113c 100644 --- a/man/pvalues.Rd +++ b/man/pvalues.Rd @@ -26,7 +26,7 @@ Predictor p-values are computed from the set p-values as follows: \examples{ set.seed(123) d <- dgp_dicp(n = 1e3, mod = "polr") -res <- PolrICP(Y ~ X1 + X2 + X3, data = d, env = ~ E) +res <- polrICP(Y ~ X1 + X2 + X3, data = d, env = ~ E, type = "wald") pvalues(res, which = "predictor") pvalues(res, which = "set") pvalues(res, which = "all") diff --git a/man/tramicp-alias.Rd b/man/tramicp-alias.Rd index 40b3076..7eaae5c 100644 --- a/man/tramicp-alias.Rd +++ b/man/tramicp-alias.Rd @@ -294,43 +294,43 @@ ICP for Box-Cox-type transformed normal regression, parametric \examples{ set.seed(123) d <- dgp_dicp(mod = "boxcox", n = 300) -BoxCoxICP(Y ~ X2, data = d, env = ~ E) +BoxCoxICP(Y ~ X2, data = d, env = ~ E, type = "wald") set.seed(123) d <- dgp_dicp(mod = "weibull", n = 300) -SurvregICP(Y ~ X1 + X2 + X3, data = d, env = ~ E) +SurvregICP(Y ~ X1 + X2 + X3, data = d, env = ~ E, type = "wald") ### or -# survregICP(Y ~ X1 + X2 + X3, data = d, env = ~ E) -# CoxphICP(Y ~ X2, data = d, env = ~ E) -# coxphICP(Y ~ X2, data = d, env = ~ E) +# survregICP(Y ~ X1 + X2 + X3, data = d, env = ~ E, type = "wald") +# CoxphICP(Y ~ X2, data = d, env = ~ E, type = "wald") +# coxphICP(Y ~ X2, data = d, env = ~ E, type = "wald") set.seed(123) d <- dgp_dicp(mod = "colr", n = 300) -ColrICP(Y ~ X1 + X2 + X3, data = d, env = ~ E, type = "wald", test = "wald") +ColrICP(Y ~ X1 + X2 + X3, data = d, env = ~ E, type = "wald") set.seed(123) d <- dgp_dicp(mod = "coxph", n = 300) -LehmannICP(Y ~ X2, data = d, env = ~ E) +LehmannICP(Y ~ X2, data = d, env = ~ E, type = "wald") set.seed(123) d <- dgp_dicp(mod = "lm", n = 300) -LmICP(Y ~ X1 + X2 + X3, data = d, env = ~ E) +LmICP(Y ~ X1 + X2 + X3, data = d, env = ~ E, type = "wald") ### or -# lmICP(Y ~ X1 + X2 + X3, data = d, env = ~ E) +# lmICP(Y ~ X1 + X2 + X3, data = d, env = ~ E, type = "wald") set.seed(123) d <- dgp_dicp(mod = "polr", n = 300) -PolrICP(Y ~ X1 + X2 + X3, data = d, env = ~ E) +PolrICP(Y ~ X1 + X2 + X3, data = d, env = ~ E, type = "wald") ### or -# PolrICP(Y ~ X1 + X2 + X3, data = d, env = ~ E) +# PolrICP(Y ~ X1 + X2 + X3, data = d, env = ~ E, type = "wald") set.seed(123) d <- dgp_dicp(mod = "binary", n = 300) -glmICP(Y ~ X1 + X2 + X3, data = d, env = ~ E, family = "binomial") +glmICP(Y ~ X1 + X2 + X3, data = d, env = ~ E, family = "binomial", type = "wald") set.seed(123) d <- dgp_dicp(mod = "cotram", n = 300) -cotramICP(Y ~ X2, data = d, env = ~ E) +cotramICP(Y ~ X2, data = d, env = ~ E, type = "wald") set.seed(123) d <- dgp_dicp(mod = "binary", n = 300) From 11fd00b358e5795a2179946a94fd7d3c67d4b054 Mon Sep 17 00:00:00 2001 From: lkook Date: Thu, 28 Sep 2023 15:38:33 +0200 Subject: [PATCH 3/5] residual but dontrun --- R/alias.R | 40 ++++++++++++++++++++++++++++------------ man/tramicp-alias.Rd | 40 ++++++++++++++++++++++++++++------------ 2 files changed, 56 insertions(+), 24 deletions(-) diff --git a/R/alias.R b/R/alias.R index 24f5ea9..e220142 100644 --- a/R/alias.R +++ b/R/alias.R @@ -40,13 +40,15 @@ BoxCoxICP <- function(formula, data, env, verbose = TRUE, type = "residual", #' @export #' #' @examples +#' \dontrun{ #' set.seed(123) #' d <- dgp_dicp(mod = "weibull", n = 300) -#' SurvregICP(Y ~ X1 + X2 + X3, data = d, env = ~ E, type = "wald") +#' SurvregICP(Y ~ X1 + X2 + X3, data = d, env = ~ E) #' ### or -#' # survregICP(Y ~ X1 + X2 + X3, data = d, env = ~ E, type = "wald") -#' # CoxphICP(Y ~ X2, data = d, env = ~ E, type = "wald") -#' # coxphICP(Y ~ X2, data = d, env = ~ E, type = "wald") +#' # survregICP(Y ~ X1 + X2 + X3, data = d, env = ~ E) +#' # CoxphICP(Y ~ X2, data = d, env = ~ E) +#' # coxphICP(Y ~ X2, data = d, env = ~ E) +#' } #' SurvregICP <- function(formula, data, env, verbose = TRUE, type = "residual", test = "gcm.test", controls = NULL, alpha = 0.05, @@ -107,9 +109,11 @@ coxphICP <- function(formula, data, env, verbose = TRUE, type = "residual", #' @export #' #' @examples +#' \dontrun{ #' set.seed(123) #' d <- dgp_dicp(mod = "colr", n = 300) -#' ColrICP(Y ~ X1 + X2 + X3, data = d, env = ~ E, type = "wald") +#' ColrICP(Y ~ X1 + X2 + X3, data = d, env = ~ E) +#' } #' ColrICP <- function(formula, data, env, verbose = TRUE, type = "residual", test = "gcm.test", controls = NULL, alpha = 0.05, @@ -152,9 +156,11 @@ CoxphICP <- function(formula, data, env, verbose = TRUE, type = "residual", #' @export #' #' @examples +#' \dontrun{ #' set.seed(123) #' d <- dgp_dicp(mod = "coxph", n = 300) -#' LehmannICP(Y ~ X2, data = d, env = ~ E, type = "wald") +#' LehmannICP(Y ~ X2, data = d, env = ~ E) +#' } #' LehmannICP <- function(formula, data, env, verbose = TRUE, type = "residual", test = "gcm.test", controls = NULL, alpha = 0.05, @@ -177,11 +183,13 @@ LehmannICP <- function(formula, data, env, verbose = TRUE, type = "residual", #' @export #' #' @examples +#' \dontrun{ #' set.seed(123) #' d <- dgp_dicp(mod = "lm", n = 300) -#' LmICP(Y ~ X1 + X2 + X3, data = d, env = ~ E, type = "wald") +#' LmICP(Y ~ X1 + X2 + X3, data = d, env = ~ E) #' ### or -#' # lmICP(Y ~ X1 + X2 + X3, data = d, env = ~ E, type = "wald") +#' # lmICP(Y ~ X1 + X2 + X3, data = d, env = ~ E) +#' } #' LmICP <- function(formula, data, env, verbose = TRUE, type = "residual", test = "gcm.test", controls = NULL, alpha = 0.05, @@ -223,11 +231,13 @@ lmICP <- function(formula, data, env, verbose = TRUE, type = "residual", #' @export #' #' @examples +#' \dontrun{ #' set.seed(123) #' d <- dgp_dicp(mod = "polr", n = 300) -#' PolrICP(Y ~ X1 + X2 + X3, data = d, env = ~ E, type = "wald") +#' PolrICP(Y ~ X1 + X2 + X3, data = d, env = ~ E) #' ### or -#' # PolrICP(Y ~ X1 + X2 + X3, data = d, env = ~ E, type = "wald") +#' # PolrICP(Y ~ X1 + X2 + X3, data = d, env = ~ E) +#' } #' PolrICP <- function(formula, data, env, verbose = TRUE, type = "residual", test = "gcm.test", controls = NULL, alpha = 0.05, @@ -292,9 +302,11 @@ residuals.polr <- function(object, ...) { #' @export #' #' @examples +#' \dontrun{ #' set.seed(123) #' d <- dgp_dicp(mod = "binary", n = 300) -#' glmICP(Y ~ X1 + X2 + X3, data = d, env = ~ E, family = "binomial", type = "wald") +#' glmICP(Y ~ X1 + X2 + X3, data = d, env = ~ E, family = "binomial") +#' } #' glmICP <- function(formula, data, env, verbose = TRUE, type = "residual", test = "gcm.test", controls = NULL, alpha = 0.05, @@ -327,9 +339,11 @@ glmICP <- function(formula, data, env, verbose = TRUE, type = "residual", #' @export #' #' @examples +#' \dontrun{ #' set.seed(123) #' d <- dgp_dicp(mod = "cotram", n = 300) -#' cotramICP(Y ~ X2, data = d, env = ~ E, type = "wald") +#' cotramICP(Y ~ X2, data = d, env = ~ E) +#' } #' cotramICP <- function(formula, data, env, verbose = TRUE, type = "residual", test = "gcm.test", controls = NULL, alpha = 0.05, @@ -352,9 +366,11 @@ cotramICP <- function(formula, data, env, verbose = TRUE, type = "residual", #' @export #' #' @examples +#' \dontrun{ #' set.seed(123) #' d <- dgp_dicp(mod = "binary", n = 300) #' rangerICP(Y ~ X1 + X2 + X3, data = d, env = ~ E) +#' } #' rangerICP <- function(formula, data, env, verbose = TRUE, type = "residual", test = "gcm.test", controls = NULL, alpha = 0.05, diff --git a/man/tramicp-alias.Rd b/man/tramicp-alias.Rd index 7eaae5c..6047661 100644 --- a/man/tramicp-alias.Rd +++ b/man/tramicp-alias.Rd @@ -296,44 +296,60 @@ set.seed(123) d <- dgp_dicp(mod = "boxcox", n = 300) BoxCoxICP(Y ~ X2, data = d, env = ~ E, type = "wald") +\dontrun{ set.seed(123) d <- dgp_dicp(mod = "weibull", n = 300) -SurvregICP(Y ~ X1 + X2 + X3, data = d, env = ~ E, type = "wald") +SurvregICP(Y ~ X1 + X2 + X3, data = d, env = ~ E) ### or -# survregICP(Y ~ X1 + X2 + X3, data = d, env = ~ E, type = "wald") -# CoxphICP(Y ~ X2, data = d, env = ~ E, type = "wald") -# coxphICP(Y ~ X2, data = d, env = ~ E, type = "wald") +# survregICP(Y ~ X1 + X2 + X3, data = d, env = ~ E) +# CoxphICP(Y ~ X2, data = d, env = ~ E) +# coxphICP(Y ~ X2, data = d, env = ~ E) +} +\dontrun{ set.seed(123) d <- dgp_dicp(mod = "colr", n = 300) -ColrICP(Y ~ X1 + X2 + X3, data = d, env = ~ E, type = "wald") +ColrICP(Y ~ X1 + X2 + X3, data = d, env = ~ E) +} +\dontrun{ set.seed(123) d <- dgp_dicp(mod = "coxph", n = 300) -LehmannICP(Y ~ X2, data = d, env = ~ E, type = "wald") +LehmannICP(Y ~ X2, data = d, env = ~ E) +} +\dontrun{ set.seed(123) d <- dgp_dicp(mod = "lm", n = 300) -LmICP(Y ~ X1 + X2 + X3, data = d, env = ~ E, type = "wald") +LmICP(Y ~ X1 + X2 + X3, data = d, env = ~ E) ### or -# lmICP(Y ~ X1 + X2 + X3, data = d, env = ~ E, type = "wald") +# lmICP(Y ~ X1 + X2 + X3, data = d, env = ~ E) +} +\dontrun{ set.seed(123) d <- dgp_dicp(mod = "polr", n = 300) -PolrICP(Y ~ X1 + X2 + X3, data = d, env = ~ E, type = "wald") +PolrICP(Y ~ X1 + X2 + X3, data = d, env = ~ E) ### or -# PolrICP(Y ~ X1 + X2 + X3, data = d, env = ~ E, type = "wald") +# PolrICP(Y ~ X1 + X2 + X3, data = d, env = ~ E) +} +\dontrun{ set.seed(123) d <- dgp_dicp(mod = "binary", n = 300) -glmICP(Y ~ X1 + X2 + X3, data = d, env = ~ E, family = "binomial", type = "wald") +glmICP(Y ~ X1 + X2 + X3, data = d, env = ~ E, family = "binomial") +} +\dontrun{ set.seed(123) d <- dgp_dicp(mod = "cotram", n = 300) -cotramICP(Y ~ X2, data = d, env = ~ E, type = "wald") +cotramICP(Y ~ X2, data = d, env = ~ E) +} +\dontrun{ set.seed(123) d <- dgp_dicp(mod = "binary", n = 300) rangerICP(Y ~ X1 + X2 + X3, data = d, env = ~ E) +} } From c6dfdf0bd8cad03e81712548cca2ed5c2b7dbdd8 Mon Sep 17 00:00:00 2001 From: lkook Date: Sat, 30 Sep 2023 10:14:25 +0200 Subject: [PATCH 4/5] cran version 0.0-1 --- R/alias.R | 26 +++++++++++++------------- README.md | 7 ++++++- man/tramicp-alias.Rd | 26 +++++++++++++------------- 3 files changed, 32 insertions(+), 27 deletions(-) diff --git a/R/alias.R b/R/alias.R index e220142..85b73a6 100644 --- a/R/alias.R +++ b/R/alias.R @@ -40,14 +40,14 @@ BoxCoxICP <- function(formula, data, env, verbose = TRUE, type = "residual", #' @export #' #' @examples -#' \dontrun{ +#' \donttest{ #' set.seed(123) #' d <- dgp_dicp(mod = "weibull", n = 300) #' SurvregICP(Y ~ X1 + X2 + X3, data = d, env = ~ E) #' ### or -#' # survregICP(Y ~ X1 + X2 + X3, data = d, env = ~ E) -#' # CoxphICP(Y ~ X2, data = d, env = ~ E) -#' # coxphICP(Y ~ X2, data = d, env = ~ E) +#' survregICP(Y ~ X1 + X2 + X3, data = d, env = ~ E) +#' CoxphICP(Y ~ X2, data = d, env = ~ E) +#' coxphICP(Y ~ X2, data = d, env = ~ E) #' } #' SurvregICP <- function(formula, data, env, verbose = TRUE, type = "residual", @@ -109,7 +109,7 @@ coxphICP <- function(formula, data, env, verbose = TRUE, type = "residual", #' @export #' #' @examples -#' \dontrun{ +#' \donttest{ #' set.seed(123) #' d <- dgp_dicp(mod = "colr", n = 300) #' ColrICP(Y ~ X1 + X2 + X3, data = d, env = ~ E) @@ -156,7 +156,7 @@ CoxphICP <- function(formula, data, env, verbose = TRUE, type = "residual", #' @export #' #' @examples -#' \dontrun{ +#' \donttest{ #' set.seed(123) #' d <- dgp_dicp(mod = "coxph", n = 300) #' LehmannICP(Y ~ X2, data = d, env = ~ E) @@ -183,12 +183,12 @@ LehmannICP <- function(formula, data, env, verbose = TRUE, type = "residual", #' @export #' #' @examples -#' \dontrun{ +#' \donttest{ #' set.seed(123) #' d <- dgp_dicp(mod = "lm", n = 300) #' LmICP(Y ~ X1 + X2 + X3, data = d, env = ~ E) #' ### or -#' # lmICP(Y ~ X1 + X2 + X3, data = d, env = ~ E) +#' lmICP(Y ~ X1 + X2 + X3, data = d, env = ~ E) #' } #' LmICP <- function(formula, data, env, verbose = TRUE, type = "residual", @@ -231,12 +231,12 @@ lmICP <- function(formula, data, env, verbose = TRUE, type = "residual", #' @export #' #' @examples -#' \dontrun{ +#' \donttest{ #' set.seed(123) #' d <- dgp_dicp(mod = "polr", n = 300) #' PolrICP(Y ~ X1 + X2 + X3, data = d, env = ~ E) #' ### or -#' # PolrICP(Y ~ X1 + X2 + X3, data = d, env = ~ E) +#' PolrICP(Y ~ X1 + X2 + X3, data = d, env = ~ E) #' } #' PolrICP <- function(formula, data, env, verbose = TRUE, type = "residual", @@ -302,7 +302,7 @@ residuals.polr <- function(object, ...) { #' @export #' #' @examples -#' \dontrun{ +#' \donttest{ #' set.seed(123) #' d <- dgp_dicp(mod = "binary", n = 300) #' glmICP(Y ~ X1 + X2 + X3, data = d, env = ~ E, family = "binomial") @@ -339,7 +339,7 @@ glmICP <- function(formula, data, env, verbose = TRUE, type = "residual", #' @export #' #' @examples -#' \dontrun{ +#' \donttest{ #' set.seed(123) #' d <- dgp_dicp(mod = "cotram", n = 300) #' cotramICP(Y ~ X2, data = d, env = ~ E) @@ -366,7 +366,7 @@ cotramICP <- function(formula, data, env, verbose = TRUE, type = "residual", #' @export #' #' @examples -#' \dontrun{ +#' \donttest{ #' set.seed(123) #' d <- dgp_dicp(mod = "binary", n = 300) #' rangerICP(Y ~ X1 + X2 + X3, data = d, env = ~ E) diff --git a/README.md b/README.md index c0831cb..e3fc6af 100644 --- a/README.md +++ b/README.md @@ -14,12 +14,17 @@ described in [the paper](https://doi.org/10.48550/arXiv.2309.12833). # Installation -The `tramicp` package can be installed via: +The development version of `tramicp` package can be installed via: ```r # install.packages("remotes") remotes::install_github("LucasKook/tramicp") ``` +A stable version is available on [CRAN](https://CRAN.R-project.org/package=tramicp): +```r +install.packages("tramicp") +``` + # Using package `tramicp` Consider the following data simulated from a structural causal model: diff --git a/man/tramicp-alias.Rd b/man/tramicp-alias.Rd index 6047661..ad7971c 100644 --- a/man/tramicp-alias.Rd +++ b/man/tramicp-alias.Rd @@ -296,57 +296,57 @@ set.seed(123) d <- dgp_dicp(mod = "boxcox", n = 300) BoxCoxICP(Y ~ X2, data = d, env = ~ E, type = "wald") -\dontrun{ +\donttest{ set.seed(123) d <- dgp_dicp(mod = "weibull", n = 300) SurvregICP(Y ~ X1 + X2 + X3, data = d, env = ~ E) ### or -# survregICP(Y ~ X1 + X2 + X3, data = d, env = ~ E) -# CoxphICP(Y ~ X2, data = d, env = ~ E) -# coxphICP(Y ~ X2, data = d, env = ~ E) +survregICP(Y ~ X1 + X2 + X3, data = d, env = ~ E) +CoxphICP(Y ~ X2, data = d, env = ~ E) +coxphICP(Y ~ X2, data = d, env = ~ E) } -\dontrun{ +\donttest{ set.seed(123) d <- dgp_dicp(mod = "colr", n = 300) ColrICP(Y ~ X1 + X2 + X3, data = d, env = ~ E) } -\dontrun{ +\donttest{ set.seed(123) d <- dgp_dicp(mod = "coxph", n = 300) LehmannICP(Y ~ X2, data = d, env = ~ E) } -\dontrun{ +\donttest{ set.seed(123) d <- dgp_dicp(mod = "lm", n = 300) LmICP(Y ~ X1 + X2 + X3, data = d, env = ~ E) ### or -# lmICP(Y ~ X1 + X2 + X3, data = d, env = ~ E) +lmICP(Y ~ X1 + X2 + X3, data = d, env = ~ E) } -\dontrun{ +\donttest{ set.seed(123) d <- dgp_dicp(mod = "polr", n = 300) PolrICP(Y ~ X1 + X2 + X3, data = d, env = ~ E) ### or -# PolrICP(Y ~ X1 + X2 + X3, data = d, env = ~ E) +PolrICP(Y ~ X1 + X2 + X3, data = d, env = ~ E) } -\dontrun{ +\donttest{ set.seed(123) d <- dgp_dicp(mod = "binary", n = 300) glmICP(Y ~ X1 + X2 + X3, data = d, env = ~ E, family = "binomial") } -\dontrun{ +\donttest{ set.seed(123) d <- dgp_dicp(mod = "cotram", n = 300) cotramICP(Y ~ X2, data = d, env = ~ E) } -\dontrun{ +\donttest{ set.seed(123) d <- dgp_dicp(mod = "binary", n = 300) rangerICP(Y ~ X1 + X2 + X3, data = d, env = ~ E) From 4e81968536635fe2b18417ee1447301228c84b8d Mon Sep 17 00:00:00 2001 From: lkook Date: Sat, 30 Sep 2023 10:27:30 +0200 Subject: [PATCH 5/5] donttest err --- R/alias.R | 2 ++ man/tramicp-alias.Rd | 2 ++ 2 files changed, 4 insertions(+) diff --git a/R/alias.R b/R/alias.R index 85b73a6..53b1003 100644 --- a/R/alias.R +++ b/R/alias.R @@ -45,6 +45,8 @@ BoxCoxICP <- function(formula, data, env, verbose = TRUE, type = "residual", #' d <- dgp_dicp(mod = "weibull", n = 300) #' SurvregICP(Y ~ X1 + X2 + X3, data = d, env = ~ E) #' ### or +#' library("survival") +#' d$Y <- Surv(d$Y) #' survregICP(Y ~ X1 + X2 + X3, data = d, env = ~ E) #' CoxphICP(Y ~ X2, data = d, env = ~ E) #' coxphICP(Y ~ X2, data = d, env = ~ E) diff --git a/man/tramicp-alias.Rd b/man/tramicp-alias.Rd index ad7971c..028f71b 100644 --- a/man/tramicp-alias.Rd +++ b/man/tramicp-alias.Rd @@ -301,6 +301,8 @@ set.seed(123) d <- dgp_dicp(mod = "weibull", n = 300) SurvregICP(Y ~ X1 + X2 + X3, data = d, env = ~ E) ### or +library("survival") +d$Y <- Surv(d$Y) survregICP(Y ~ X1 + X2 + X3, data = d, env = ~ E) CoxphICP(Y ~ X2, data = d, env = ~ E) coxphICP(Y ~ X2, data = d, env = ~ E)