Skip to content

Conversation

@mihaiconstantin
Copy link
Owner

@mihaiconstantin mihaiconstantin commented Oct 3, 2025

# Install the `remotes` package if not available.
install.packages("remotes")

# Install the `powerly` package containing the `SEM` example.
remotes::install_github("mihaiconstantin/powerly", ref = "example/sem-omega")

# Load the package.
library(powerly)

# Run the method for the example.
results <- powerly(
    #  The lower and upper bounds of the sample size search range.
    range_lower = 150,
    range_upper = 450,

    # How many sample sizes to be in the candidate grid.
    samples = 50,

    # The number of Monte Carlo replications for each sample in the candidate grid.
    replications = 30,

    # This is the explicit estimand implementation name (i.e., redundant in new API).
    measure = "omega",

    # This is what we call reliability in version `2.0.0`.
    statistic = "power",
    
    # Check if the research question was answered within ε = 0.05 accuracy.
    measure_value = 1 - 0.05,

    # This is the value for the reliability (i.e., not McDonald's ω).
    statistic_value = .8,

    # This is the `SemOmega` model implemented for this example.
    model = "sem-omega",

    # Number of cores for the parallel processing.
    cores = 9,

    # Verbose output.
    verbose = TRUE
)

# Plot the sample size recommendation.
plot(results, step = 3)

# Validate.
validation <- validate(results, replications = 1500, cores = 9)

# Plot the validation.
plot(validation)

@mihaiconstantin mihaiconstantin self-assigned this Oct 3, 2025
@mihaiconstantin mihaiconstantin added the enhancement New feature or request label Oct 3, 2025
@github-project-automation github-project-automation bot moved this to Backlog in powerly Oct 3, 2025
Repository owner deleted a comment from codecov bot Oct 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

Status: Backlog

Development

Successfully merging this pull request may close these issues.

2 participants