summary.x_from_power: Summarize 'x_from_power' Results

View source: R/x_from_power_for_x_summary.R

summary.x_from_powerR Documentation

Summarize 'x_from_power' Results

Description

The summary method of the output of x_from_power().

Usage

## 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, ...)

Arguments

object

An x_from_power-class object, such as the output of x_from_power(), or an object of the class n_region_from_power, such as the output of n_region_from_power().

...

Additional arguments. Not used for now.

x

The output of summary.x_from_power(), the summary method of an x_from_power object, which is the output of x_from_power(), or the output of summary.n_region_from_power(), the summary method of an n_region_from_power object (the output of n_region_from_power()).

digits

The number of digits after the decimal when printing the results.

Details

The summary method simply prepares the results of x_from_power() to be printed in details.

Value

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.

See Also

x_from_power(), n_region_from_power()

Examples


# 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)


power4mome documentation built on Sept. 9, 2025, 5:35 p.m.