library(statiotest)
context("Unit tests for statiotest")
# Stationary data sample
x2 <- function(){
set.seed(1234)
rnorm(1000)
}
test_that("p_value is >= 0.05 if data stationary", {
expect_true(statiotest(x2())$p.val >= 0.05)
})
# Non-stationary data sample
x3 <- function(){
set.seed(1234)
cumsum(rnorm(1000))
}
test_that("p_value is < 0.05 if data non-stationary unit root", {
expect_true(statiotest(x3())$p.val < 0.05)
})
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.