Hypothesis test structure

hypothesis_test(stat, p.value, dof, superclasses = NULL, ...)

Arguments

stat

test statistic

p.value

p-value

dof

degrees of freedom

Value

hypothesis test

Examples

# create a hypothesis test
test <- hypothesis_test(stat = 1.96, p.value = 0.05, dof = 1)
# print the test
test
#> $stat
#> [1] 1.96
#> 
#> $p.value
#> [1] 0.05
#> 
#> $dof
#> [1] 1
#> 
#> attr(,"class")
#> [1] "hypothesis_test"
# extract the p-value
pval(test)
#> [1] 0.05
# extract the degrees of freedom
dof(test)
#> Error in UseMethod("dof"): no applicable method for 'dof' applied to an object of class "hypothesis_test"
# extract the test statistic
stat(test)
#> Error in stat(test): could not find function "stat"
# check if the test is significant at the 5% level
is_significant_at(test, 0.05)
#> Error in is_significant_at(test, 0.05): could not find function "is_significant_at"