Nothing
test_that("simulate_fps_data returns correct structure - scalar", {
dat <- simulate_fps_data(n = 50, setting = "LL", outcome_type = "scalar",
seed = 1)
expect_named(dat, c("X", "Y", "C", "D", "t_grid", "true_beta",
"setting", "outcome_type"))
expect_equal(nrow(dat$X), 50)
expect_equal(ncol(dat$X), 51)
expect_length(dat$Y, 50)
expect_equal(nrow(dat$C), 50)
expect_equal(ncol(dat$C), 3)
expect_length(dat$t_grid, 51)
expect_length(dat$true_beta, 51)
expect_equal(dat$setting, "LL")
expect_equal(dat$outcome_type, "scalar")
})
test_that("simulate_fps_data returns correct structure - functional", {
dat <- simulate_fps_data(n = 50, setting = "LL", outcome_type = "functional",
seed = 2)
expect_equal(nrow(dat$Y), 50)
expect_equal(ncol(dat$Y), 51)
expect_equal(dim(dat$true_beta), c(51, 51))
expect_equal(dat$outcome_type, "functional")
})
test_that("simulate_fps_data includes D when include_functional_cov = TRUE", {
dat <- simulate_fps_data(50, "LL", include_functional_cov = TRUE, seed = 3)
expect_false(is.null(dat$D))
expect_equal(dim(dat$D), c(50, 51))
})
test_that("simulate_fps_data D is NULL when include_functional_cov = FALSE", {
dat <- simulate_fps_data(50, "LL", include_functional_cov = FALSE, seed = 4)
expect_null(dat$D)
})
test_that("all four settings produce different data", {
d_LL <- simulate_fps_data(50, "LL", seed = 5)
d_NN <- simulate_fps_data(50, "NN", seed = 5)
expect_false(isTRUE(all.equal(d_LL$Y, d_NN$Y)))
})
test_that("seed produces reproducible results", {
d1 <- simulate_fps_data(50, "LL", seed = 99)
d2 <- simulate_fps_data(50, "LL", seed = 99)
expect_equal(d1$X, d2$X)
expect_equal(d1$Y, d2$Y)
})
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.