View source: R/summarize_test.R
summarize_tests | R Documentation |
Extract and summarize test results.
summarize_tests(
object,
collapse = c("none", "all_sig", "at_least_one_sig", "at_least_k_sig"),
at_least_k = 1
)
## S3 method for class 'test_summary_list'
print(x, digits = 3, ...)
## S3 method for class 'test_summary'
print(x, digits = 2, ...)
## S3 method for class 'test_out_list'
print(x, digits = 3, test_long = FALSE, ...)
object |
A |
collapse |
Whether a single
decision (significant vs. not significant)
is made across all tests for a test
that consists of several tests
(e.g., the tests of several parameters).
If |
at_least_k |
Used by |
x |
The object to be printed. |
digits |
The numbers of digits after the decimal when printing numeric results. |
... |
Optional arguments. Not used. |
test_long |
If |
The function summarize_tests()
is used to extract
information from each test stored
in a power4test
object.
The method print.test_out_list()
is
used to print the content of a list
of test stored in a power4test
object, with the option to print
just the names of tests.
The function summarize_tests()
returns
a list of the class test_summary_list
.
Each element contains a summary of a
test stored. The elements are of
the class test_summary
, with
these elements:
test_attributes
: The stored
information of a test, for printing.
nrep
: The number of datasets
(replications).
mean
: The means of numeric
information. For significance
tests, these are the rejection
rates.
nvalid
: The number of non-NA
replications used to compute each
mean.
The print
methods returns x
invisibly.
They are called for their side
effects.
summarize_tests()
and related functionsThe function summarize_tests()
and
related print methods are used by
the all-in-one function
power4test()
and its summary
method. Users usually do not
call them directly, though
developers can use this function to
develop other functions for power
analysis, or to build their own
workflows to do the power analysis.
power4test()
# Specify the model
mod <-
"
m ~ x
y ~ m + x
"
# Specify the population values
es <-
"
y ~ m: l
m ~ x: m
y ~ x: n
"
# Simulated datasets
sim_only <- power4test(nrep = 2,
model = mod,
pop_es = es,
n = 100,
do_the_test = FALSE,
iseed = 1234)
# Test the parameters in each dataset
test_out <- power4test(object = sim_only,
test_fun = test_parameters)
# Print the summary
summarize_tests(test_out)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.