tests/testthat/tests_bctrans.R

context("bctrans")

test_that("test Box-Cox function, lambda zero case",{
  y<-runif(10)+.1
  expect_equal(bctrans(y,0),log(y))
  expect_equal(bctrans(y,1e-12),log(y))
})

test_that("test Box-Cox function, lambda differs from zero case",{
  y<-runif(10)+.1
  lambda<-rnorm(1,sd=3)
  expect_equal(bctrans(y,lambda),(y^lambda-1)/lambda)
})

Try the wsyn package in your browser

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

wsyn documentation built on June 19, 2021, 1:07 a.m.