Nothing
library(testthat)
library(Eunomia)
set.seed(1234)
data(cohortMethodDataSimulationProfile)
sampleSize <- 1000
cohortMethodData <- simulateCohortMethodData(cohortMethodDataSimulationProfile, n = sampleSize)
test_that("Subsampling cohort throws no error", {
population <- CohortMethod::createStudyPopulation(
cohortMethodData = cohortMethodData,
outcomeId = 3,
createStudyPopulationArgs = createCreateStudyPopulationArgs(
riskWindowEnd = 99999
)
)
prior <- createPrior("laplace", 0.1, exclude = 0)
# Ensure subsampling takes place
targetPopSize <- length(population$rowId[population$treatment == 1])
comparatorPopSize <- length(population$rowId[population$treatment == 0])
expect_true(min(targetPopSize, comparatorPopSize) > 100)
ps <- createPs(
cohortMethodData = cohortMethodData,
population = population,
createPsArgs = createCreatePsArgs(
errorOnHighCorrelation = FALSE,
maxCohortSizeForFitting = 100,
prior = prior
)
)
expect_s3_class(ps, "data.frame")
})
Any scripts or data that you put into this service are public.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.