# Direct construction (usually use specific constructors instead)
test <- hypothesis_test(stat = 1.96, p.value = 0.05, dof = 1)
test
# Extract components using the API
pval(test)
test_stat(test)
dof(test)
is_significant_at(test, 0.05)
# Create a custom test type
custom <- hypothesis_test(
stat = 2.5, p.value = 0.01, dof = 10,
superclasses = "custom_test",
method = "bootstrap", n_replicates = 1000
)
class(custom) # c("custom_test", "hypothesis_test")
custom$method # "bootstrap"
Run the code above in your browser using DataLab