Nothing
test_that("mbco S7 generic works with MxModel input", {
skip_if_not_installed("OpenMx")
library(OpenMx)
# Use real MxModel objects
h0 <- mxModel("NullModel")
h1 <- mxModel("AltModel")
# We expect the method to dispatch.
# However, the internal logic (mbco_asymp) will likely fail because these models are empty/invalid.
# We just want to ensure dispatch happens and we hit the validation or internal function.
# Since we can't easily check "dispatch happened" without a spy,
# and the function will error out deep inside mbco_asymp or input validation,
# we can at least check that MBCOResult class exists and works.
res_obj <- MBCOResult(statistic = 5.2, df = 1, p_value = 0.02, type = "asymp")
expect_s3_class(res_obj, "RMediation::MBCOResult")
expect_equal(res_obj@statistic, 5.2)
expect_true(is(mbco, "S7_generic"))
# Attempt dispatch - expect error from internal validation or logic, NOT "no method found"
# The error "h0 must be an MxModel" would come from our method if we passed wrong type.
# If we pass correct type, it proceeds.
expect_error(mbco(h0, h1), class = "error")
# We expect SOME error, but not "no method for mbco".
# If dispatch failed, we'd get S7 dispatch error.
})
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.