tests/testthat/test-RsquaredSE.R

context("Check input of RsquaredSE function")
test_that("RsquaredSE throws errors when incorrect input is provided", {
    expect_error(RsquaredSE(MSE = 3, margVar = 4, SEMSE = 0.4, n = 0, corMSEMST = 0.75))
    expect_error(RsquaredSE(MSE = -3, margVar = 4, SEMSE = 0.4, n = 50, corMSEMST = 0.75))
    expect_error(RsquaredSE(MSE = 3, margVar = -4, SEMSE = 0.4, n = 50, corMSEMST = 0.75))
    expect_error(RsquaredSE(MSE = 3, margVar = 4, SEMSE = -0.4, n = 50, corMSEMST = 0.75))
    expect_error(RsquaredSE(MSE = 3, margVar = 4, SEMSE = 0.4, n = 50, corMSEMST = 2))
    })
test_that("RsquaredSE works as expected with correct input", {
    expect_length(RsquaredSE(MSE = 3, margVar = 4, SEMSE = 0.4, n = 50, corMSEMST = 0.75), 2)
})

Try the oosse package in your browser

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

oosse documentation built on May 29, 2024, 10:35 a.m.