Skip to content

Commit

Permalink
Some small changes in functions
Browse files Browse the repository at this point in the history
  • Loading branch information
mwheymans committed May 31, 2023
1 parent 21a7443 commit c76437a
Show file tree
Hide file tree
Showing 8 changed files with 73 additions and 68 deletions.
44 changes: 21 additions & 23 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -3,37 +3,35 @@ Type: Package
Depends:
R (>= 4.0.0),
Imports:
ggplot2 (>= 3.3.6),
norm (>= 1.0-10.0),
survival (>= 3.4-0),
mitools (>= 2.4),
pROC (>= 1.18.0),
rms (>= 6.3-0),
ResourceSelection (>= 0.3-5),
magrittr (>= 2.0.3),
rsample (>= 1.1.0),
mice (>= 3.14.0),
mitml (>= 0.4-3),
cvAUC (>= 1.1.4),
dplyr (>= 1.0.10),
purrr (>= 0.3.5),
tidyr (>= 1.2.1),
tibble (>= 3.1.8),
stringr (>= 1.4.1),
lme4 (>= 1.1-30),
car(>= 3.1-1)
ggplot2,
norm,
survival,
mitools,
pROC,
rms,
magrittr,
rsample,
mice,
mitml,
cvAUC,
dplyr,
purrr,
tidyr,
tibble,
stringr,
lme4,
car
Suggests:
foreign (>= 0.8-80),
knitr,
rmarkdown,
testthat,
testthat (>= 3.0.0),
bookdown,
readr,
gtools,
covr,
ucminf
covr
Title: Prediction Model Pooling, Selection and Performance Evaluation Across Multiply Imputed Datasets
Version: 1.1.0
Version: 1.3.0
Authors@R: c(
person("Martijn", "Heymans", email = "mw.heymans@amsterdamumc.nl", role=c("cre", "aut"),
comment = c(ORCID = "0000-0002-3889-0921")),
Expand Down
75 changes: 38 additions & 37 deletions NAMESPACE
Original file line number Diff line number Diff line change
@@ -1,49 +1,52 @@

export(psfmi_lr)
export(psfmi_lm)
export(psfmi_coxr)
export(psfmi_lr_bw)
export(psfmi_lr_fw)
export(psfmi_lm_bw)
export(psfmi_lm_fw)
export(psfmi_coxr_bw)
export(psfmi_coxr_fw)
export(psfmi_validate)
export(mivalext_lr)
export(nri_cox)
export(nri_est)
export(psfmi_mm)
export(psfmi_mm_multiparm)
export(psfmi_stab)
export(pool_performance)
export(pool_intadj)
export(pool_RR)
export(boot_MI)
export(MI_boot)
export(cv_MI)
export(cv_MI_RR)
export(MI_cv_naive)
export(scaled_brier)
export(rsq_nagel)
export(rsq_surv)
export(pool_auc)
export(miceImp)
export(RR_diff_prop)
export(boot_MI)
export(bw_single)
export(clean_P)
export(pool_compare_models)
export(pool_reclassification)
export(coxph_bw)
export(coxph_fw)
export(cv_MI)
export(cv_MI_RR)
export(glm_bw)
export(glm_fw)
export(hoslem_test)
export(km_estimates)
export(km_fit)
export(mean_auc_log)
export(miceImp)
export(mivalext_lr)
export(nri_cox)
export(nri_est)
export(pool_D2)
export(pool_D4)
export(glm_bw)
export(glm_fw)
export(coxph_bw)
export(coxph_fw)
export(bw_single)
export(pool_RR)
export(pool_auc)
export(pool_compare_models)
export(pool_intadj)
export(pool_performance)
export(pool_performance_internal)
export(pool_reclassification)
export(psfmi_coxr)
export(psfmi_coxr_bw)
export(psfmi_coxr_fw)
export(psfmi_lm)
export(psfmi_lm_bw)
export(psfmi_lm_fw)
export(psfmi_lr)
export(psfmi_lr_bw)
export(psfmi_lr_fw)
export(psfmi_mm)
export(psfmi_mm_multiparm)
export(psfmi_perform)
export(stab_single)
export(psfmi_stab)
export(psfmi_validate)
export(risk_coxph)
export(rsq_nagel)
export(rsq_surv)
export(scaled_brier)
export(stab_single)

importFrom(stats, glm)
importFrom(stats, coef)
Expand Down Expand Up @@ -81,7 +84,6 @@ importFrom(stats, AIC)
importFrom(stats, stepfun)
importFrom(pROC, roc)
importFrom(pROC, var)
importFrom(ResourceSelection, hoslem.test)
importFrom(ggplot2, theme_set)
importFrom(ggplot2, theme_bw)
importFrom(ggplot2, element_blank)
Expand Down Expand Up @@ -138,4 +140,3 @@ importFrom(cvAUC, cvAUC)
importFrom(cvAUC, ci.cvAUC)
importFrom(car, Anova)
importFrom(stats, approx)
importFrom(stats, stepfun)
2 changes: 1 addition & 1 deletion R/pool_D4.R
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ pool_D4 <- function(data,
{
m <- nimp
data <-
filter(data, data[impvar] <= nimp)
subset(data, data[impvar] <= nimp)

if(model_type=="binomial") family="binomial"
if(model_type=="linear") family="gaussian"
Expand Down
2 changes: 1 addition & 1 deletion R/psfmi_lm_bw.R
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ psfmi_lm_bw <- function(data, nimp, impvar, Outcome, P, p.crit, method, keep.P)
}
if(method=="D4"){
data <-
filter(data, data[impvar] <= nimp)
subset(data, data[impvar] <= nimp)
imp_list <-
data %>% group_split(data[, impvar], .keep = FALSE) %>%
mitools::imputationList(imp_list)
Expand Down
2 changes: 1 addition & 1 deletion R/psfmi_lm_fw.R
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ psfmi_lm_fw <- function(data, nimp, impvar, Outcome, P, p.crit, method, keep.P)
}
if(method=="D4"){
data <-
filter(data, data[impvar] <= nimp)
subset(data, data[impvar] <= nimp)
imp_list <-
data %>% group_split(data[, impvar], .keep = FALSE) %>%
mitools::imputationList(imp_list)
Expand Down
4 changes: 2 additions & 2 deletions R/psfmi_lr_bw.R
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ psfmi_lr_bw <- function(data, nimp, impvar, Outcome, P, p.crit, method, keep.P)
}
if(method=="D4"){
data <-
filter(data, data[impvar] <= nimp)
subset(data, data[impvar] <= nimp)
imp_list <-
data %>% group_split(data[, impvar], .keep = FALSE) %>%
mitools::imputationList(imp_list)
Expand Down Expand Up @@ -162,7 +162,7 @@ psfmi_lr_bw <- function(data, nimp, impvar, Outcome, P, p.crit, method, keep.P)
}
if(method=="D3"){
data <-
filter(data, data[impvar] <= nimp)
subset(data, data[impvar] <= nimp)
imp_list <-
data %>% group_split(data[, impvar], .keep = FALSE) %>%
mitools::imputationList(imp_list)
Expand Down
2 changes: 1 addition & 1 deletion R/psfmi_lr_fw.R
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ psfmi_lr_fw <- function(data, nimp, impvar, Outcome, P, p.crit, method, keep.P)
}
if(method=="D4"){
data <-
filter(data, data[impvar] <= nimp)
subset(data, data[impvar] <= nimp)
imp_list <-
data %>% group_split(data[, impvar], .keep = FALSE) %>%
mitools::imputationList(imp_list)
Expand Down
10 changes: 8 additions & 2 deletions tests/testthat/testthat.R
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
context("testthat.R")
# This file is part of the standard setup for testthat.
# It is recommended that you do not modify it.
#
# Where should you do additional test configuration?
# Learn more about the roles of various files in:
# * https://r-pkgs.org/tests.html
# * https://testthat.r-lib.org/reference/test_package.html#special-files

library(testthat)
library(psfmi)


test_check("psfmi")

0 comments on commit c76437a

Please sign in to comment.