diff --git a/DESCRIPTION b/DESCRIPTION index 62386834..64adacfe 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,8 +1,8 @@ Package: CohortMethod Type: Package Title: New-User Cohort Method with Large Scale Propensity and Outcome Models -Version: 4.2.2 -Date: 2022-01-21 +Version: 4.2.3 +Date: 2022-08-12 Authors@R: c( person("Martijn", "Schuemie", , "schuemie@ohdsi.org", role = c("aut", "cre")), person("Marc", "Suchard", role = c("aut")), @@ -55,8 +55,7 @@ Suggests: EmpiricalCalibration, Eunomia, withr, - R.utils, - RISCA + R.utils Remotes: ohdsi/FeatureExtraction, ohdsi/Eunomia diff --git a/NEWS.md b/NEWS.md index 6aed9342..0e053f85 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,3 +1,15 @@ +CohortMethod 4.2.3 +================== + +Changes: + +1. Removed `RISCA` from the Suggests list. This package was used for a single unit test, but has a large amount of difficult-to-install dependencies. + +Bug fixes: + +1. Fixed error when failing model fitting caused by new `Cyclops` version. + + CohortMethod 4.2.2 ================== diff --git a/R/OutcomeModels.R b/R/OutcomeModels.R index d225697e..a2189d79 100644 --- a/R/OutcomeModels.R +++ b/R/OutcomeModels.R @@ -322,10 +322,8 @@ fitOutcomeModel <- function(population, logLikelihoodProfile <- logLikelihoodProfile$value } } - if (fit$return_flag == "ILLCONDITIONED") { - status <- "ILL CONDITIONED, CANNOT FIT" - } else if (fit$return_flag == "MAX_ITERATIONS") { - status <- "REACHED MAXIMUM NUMBER OF ITERATIONS, CANNOT FIT" + if (fit$return_flag != "SUCCESS") { + status <- fit$return_flag } else { status <- "OK" coefficients <- coef(fit) diff --git a/extras/balanceScatterplot.png b/extras/balanceScatterplot.png index a4d4ad3f..ae7b39b1 100644 Binary files a/extras/balanceScatterplot.png and b/extras/balanceScatterplot.png differ diff --git a/extras/ps.png b/extras/ps.png index 29ec45d0..9e4874f9 100644 Binary files a/extras/ps.png and b/extras/ps.png differ diff --git a/tests/testthat/test-kmFunctions.R b/tests/testthat/test-kmFunctions.R index c46c18ef..8afb4e50 100644 --- a/tests/testthat/test-kmFunctions.R +++ b/tests/testthat/test-kmFunctions.R @@ -21,15 +21,15 @@ test_that("Weighted Kaplan-Meier", { expect_equal(sum(weightedKm$s == unweightedKm$s), 0) # None of the values are equal - if (require("RISCA")) { - risca <- RISCA::ipw.survival(lung$time, lung$status - 1, variable = rep(1, length(lung$status)), weights = weight) - risca <- risca$table.surv - - matched <- inner_join(risca, data.frame(times = weightedKm$time, survival = weightedKm$s), - by = "times") - - expect_equal(matched$survival.x, matched$survival.y) - } + # if (require("RISCA")) { + # risca <- RISCA::ipw.survival(lung$time, lung$status - 1, variable = rep(1, length(lung$status)), weights = weight) + # risca <- risca$table.surv + # + # matched <- inner_join(risca, data.frame(times = weightedKm$time, survival = weightedKm$s), + # by = "times") + # + # expect_equal(matched$survival.x, matched$survival.y) + # } })