View source: R/x_from_power_for_x_summary.R
summary.x_from_power | R Documentation |
The summary method of
the output of x_from_power()
.
## S3 method for class 'x_from_power'
summary(object, ...)
## S3 method for class 'n_region_from_power'
summary(object, ...)
## S3 method for class 'summary.x_from_power'
print(x, digits = 3, ...)
## S3 method for class 'summary.n_region_from_power'
print(x, digits = 3, ...)
object |
An |
... |
Additional arguments. Not used for now. |
x |
The output of
|
digits |
The number of digits after the decimal when printing the results. |
The summary
method simply prepares the
results of x_from_power()
to be printed in details.
The summary
method for
x_from_power
objects returns an
object of the class
summary.x_from_power
, which is
simply the output of x_from_power()
,
with a print
method dedicated for
detailed summary. Please refer
to x_from_power()
for the contents.
The print
-method of summary.x_from_power
objects returns the object x
invisibly.
It is called for its side effect.
The print
-method of summary.n_region_from_power
objects returns the object x
invisibly.
It is called for its side effect.
x_from_power()
,
n_region_from_power()
# Specify the population model
mod <-
"
m ~ x
y ~ m + x
"
# Specify the population values
mod_es <-
"
m ~ x: m
y ~ m: l
y ~ x: n
"
# Generate the datasets
sim_only <- power4test(nrep = 5,
model = mod,
pop_es = mod_es,
n = 100,
do_the_test = FALSE,
iseed = 2345)
# Do a test
test_out <- power4test(object = sim_only,
test_fun = test_parameters,
test_args = list(pars = "m~x"))
# Determine the sample size with a power of .80 (default)
power_vs_n <- x_from_power(test_out,
x = "n",
progress = TRUE,
target_power = .80,
final_nrep = 5,
max_trials = 1,
seed = 1234)
summary(power_vs_n)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.