tests/testthat/test-smooth_erf.R

test_that("smooth_erf works as expected.", {

  skip_on_cran()
  data.table::setDTthreads(1)
  val <- smooth_erf(matched_Y = pseudo_pop_covar_test$Y,
                    bw = 0.2,
                    matched_w = pseudo_pop_covar_test$w,
                    matched_cw = pseudo_pop_covar_test$w * 0,
                    kernel_appr = "locpol",
                    x_eval = pseudo_pop_covar_test$w)

  expect_equal(length(val), 2800)
  expect_equal(val[150], -149.4761, tolerance=0.0001)
})

Try the CausalGPS package in your browser

Any scripts or data that you put into this service are public.

CausalGPS documentation built on Sept. 30, 2023, 1:06 a.m.