tests/testthat/test-printing.R

test_that("printing.R works", {
    # .print.pwrss.ancova ----------------------------------------------------------------------------------------------
    crrAsc <- capture.output(power.f.ancova(eta.squared = 0.059, factor.levels = 2, alpha = 0.05, power = 0.80, verbose = 2))
    expect_equal(crrAsc, c("+--------------------------------------------------+",
                           "|             SAMPLE SIZE CALCULATION              |",
                           "+--------------------------------------------------+", "",
                           "One-Way Analysis of Variance (F-Test)", "",
                           "----------------------------------------------------",
                           "Hypotheses",
                           "----------------------------------------------------",
                           "  H0 (Null)        : eta.squared = 0",
                           "  H1 (Alternative) : eta.squared > 0", "",
                           "----------------------------------------------------",
                           "Key Parameters",
                           "----------------------------------------------------",
                           "  Design                 = A(2)",
                           "  Num. Deg. of Freedom   = 1",
                           "  Denom. Deg. of Freedom = 126",
                           "  Non-centrality of Alt. = 8.026",
                           "  Non-centrality of Null = 0",
                           "  Critical Value         = 3.916", "",
                           "----------------------------------------------------",
                           "Results",
                           "----------------------------------------------------",
                           "  Effect Size (eta-squared) = 0.059",
                           "  Total Sample Size         = 128  <<",
                           "  Type 1 Error (alpha)      = 0.050",
                           "  Type 2 Error (beta)       = 0.197",
                           "  Statistical Power         = 0.803", "",
                           "----------------------------------------------------",
                           "Definitions",
                           "----------------------------------------------------",
                           "  eta.squared      : (Partial) eta-squared under alt.", ""))

    crrUTF <- capture.output(power.f.ancova(eta.squared = 0.059, factor.levels = 2, alpha = 0.05, power = 0.80, verbose = 2, utf = TRUE))
    expect_equal(crrUTF, c("╔══════════════════════════════════════════════════╗",
                           "║           \033[34m SAMPLE SIZE CALCULATION \033[0m              ║",
                           "╚══════════════════════════════════════════════════╝", "",
                           "One-Way Analysis of Variance (F-Test)", "",
                           "────────────────────────────────────────────────────",
                           "Hypotheses",
                           "────────────────────────────────────────────────────",
                           "  H₀ (Null)        : η² = 0",
                           "  H₁ (Alternative) : η² > 0", "",
                           "────────────────────────────────────────────────────",
                           "Key Parameters",
                           "────────────────────────────────────────────────────",
                           "  Design      = A(2)",
                           "  df1         = 1",
                           "  df2         = 126",
                           "  λ           = 8.026",
                           "  λ₀          = 0",
                           "  F⁻¹(α, λ₀)   = 3.916", "",
                           "────────────────────────────────────────────────────",
                           "Results",
                           "────────────────────────────────────────────────────",
                           "  Effect Size (η²)  = 0.059",
                           "  \033[34mTotal Sample Size = 128\033[0m  \033[1;35m◄◄\033[0m",
                           "  Type 1 Error (α)  = 0.050",
                           "  Type 2 Error (β)  = 0.197",
                           "  Statistical Power = 0.803", "",
                           "\033[36m────────────────────────────────────────────────────\033[0m",
                           "\033[36mDefinitions\033[0m",
                           "\033[36m────────────────────────────────────────────────────\033[0m",
                           "  \033[36mη²  : (Partial) eta-squared under alternative\033[0m",
                           "  \033[36mλ   : Non-centrality parameter under alternative\033[0m",
                           "  \033[36mλ₀  : Non-centrality parameter under null\033[0m", ""))

    crrAsc <- capture.output(power.f.ancova.keppel(mu.vector = c(0.50, 0.00), sd.vector = rep(1, 2), p.vector = rep(0.50, 2),
                                                   k.covariates = 1, r.squared = 0.50, alpha = 0.05, power = 0.80, verbose = 2))
    expect_equal(crrAsc, c("+--------------------------------------------------+",
                           "|             SAMPLE SIZE CALCULATION              |",
                           "+--------------------------------------------------+", "",
                           "One-Way Analysis of Covariance (F-Test)", "",
                           "----------------------------------------------------",
                           "Hypotheses",
                           "----------------------------------------------------",
                           "  H0 (Null)        : eta.squared = 0",
                           "  H1 (Alternative) : eta.squared > 0", "",
                           "----------------------------------------------------",
                           "Key Parameters",
                           "----------------------------------------------------",
                           "  Design                 = A(2)",
                           "  Num. Deg. of Freedom   = 1",
                           "  Denom. Deg. of Freedom = 63",
                           "  Non-centrality of Alt. = 8.250",
                           "  Non-centrality of Null = 0",
                           "  Critical Value         = 3.993", "",
                           "----------------------------------------------------",
                           "Results",
                           "----------------------------------------------------",
                           "  Effect Size (eta-squared) = 0.111",
                           "  Total Sample Size         = 66  <<",
                           "  Type 1 Error (alpha)      = 0.050",
                           "  Type 2 Error (beta)       = 0.193",
                           "  Statistical Power         = 0.807", "",
                           "----------------------------------------------------",
                           "Definitions",
                           "----------------------------------------------------",
                           "  eta.squared      : (Partial) eta-squared under alt.", ""))

    crrUTF <- capture.output(power.f.ancova.keppel(mu.vector = c(0.50, 0.00), sd.vector = rep(1, 2), p.vector = rep(0.50, 2),
                                                   k.covariates = 1, r.squared = 0.50, alpha = 0.05, power = 0.80, verbose = 2, utf = TRUE))
    expect_equal(crrUTF, c("╔══════════════════════════════════════════════════╗",
                           "║           \033[34m SAMPLE SIZE CALCULATION \033[0m              ║",
                           "╚══════════════════════════════════════════════════╝", "",
                           "One-Way Analysis of Covariance (F-Test)", "",
                           "────────────────────────────────────────────────────",
                           "Hypotheses",
                           "────────────────────────────────────────────────────",
                           "  H₀ (Null)        : η² = 0",
                           "  H₁ (Alternative) : η² > 0", "",
                           "────────────────────────────────────────────────────",
                           "Key Parameters",
                           "────────────────────────────────────────────────────",
                           "  Design      = A(2)",
                           "  df1         = 1",
                           "  df2         = 63",
                           "  λ           = 8.250",
                           "  λ₀          = 0",
                           "  F⁻¹(α, λ₀)   = 3.993", "",
                           "────────────────────────────────────────────────────",
                           "Results",
                           "────────────────────────────────────────────────────",
                           "  Effect Size (η²)  = 0.111",
                           "  \033[34mTotal Sample Size = 66\033[0m  \033[1;35m◄◄\033[0m",
                           "  Type 1 Error (α)  = 0.050",
                           "  Type 2 Error (β)  = 0.193",
                           "  Statistical Power = 0.807", "",
                           "\033[36m────────────────────────────────────────────────────\033[0m",
                           "\033[36mDefinitions\033[0m",
                           "\033[36m────────────────────────────────────────────────────\033[0m",
                           "  \033[36mη²  : (Partial) eta-squared under alternative\033[0m",
                           "  \033[36mλ   : Non-centrality parameter under alternative\033[0m",
                           "  \033[36mλ₀  : Non-centrality parameter under null\033[0m", ""))

    crrAsc <- capture.output(power.f.ancova.shieh(mu.vector = c(0.20, 0), sd.vector = rep(1, 2), n.vector = rep(150, 2),
                                                  r.squared = 0.50, k.covariates = 1, alpha = 0.05, verbose = 2))
    expect_equal(crrAsc, c("+--------------------------------------------------+",
                           "|                POWER CALCULATION                 |",
                           "+--------------------------------------------------+", "",
                           "One-Way Analysis of Covariance (F-Test)", "",
                           "----------------------------------------------------",
                           "Hypotheses",
                           "----------------------------------------------------",
                           "  H0 (Null)        : eta.squared = 0",
                           "  H1 (Alternative) : eta.squared > 0", "",
                           "----------------------------------------------------",
                           "Key Parameters",
                           "----------------------------------------------------",
                           "  Design                 = A(2)",
                           "  Num. Deg. of Freedom   = 1",
                           "  Denom. Deg. of Freedom = 297",
                           "  Non-centrality of Alt. = 5.980",
                           "  Non-centrality of Null = 0",
                           "  Critical Value         = 3.873", "",
                           "----------------------------------------------------",
                           "Results",
                           "----------------------------------------------------",
                           "  Effect Size (eta-squared) = 0.020",
                           "  Total Sample Size         = 300",
                           "  Type 1 Error (alpha)      = 0.050",
                           "  Type 2 Error (beta)       = 0.316",
                           "  Statistical Power         = 0.684  <<", "",
                           "----------------------------------------------------",
                           "Definitions",
                           "----------------------------------------------------",
                           "  eta.squared      : (Partial) eta-squared under alt.", ""))

    crrUTF <- capture.output(power.f.ancova.shieh(mu.vector = c(0.20, 0), sd.vector = rep(1, 2), n.vector = rep(150, 2),
                                                  r.squared = 0.50, k.covariates = 1, alpha = 0.05, verbose = 2, utf = TRUE))
    expect_equal(crrUTF, c("╔══════════════════════════════════════════════════╗",
                           "║               \033[34m POWER CALCULATION \033[0m                ║",
                           "╚══════════════════════════════════════════════════╝", "",
                           "One-Way Analysis of Covariance (F-Test)", "",
                           "────────────────────────────────────────────────────",
                           "Hypotheses",
                           "────────────────────────────────────────────────────",
                           "  H₀ (Null)        : η² = 0",
                           "  H₁ (Alternative) : η² > 0", "",
                           "────────────────────────────────────────────────────",
                           "Key Parameters",
                           "────────────────────────────────────────────────────",
                           "  Design      = A(2)",
                           "  df1         = 1",
                           "  df2         = 297",
                           "  λ           = 5.980",
                           "  λ₀          = 0",
                           "  F⁻¹(α, λ₀)   = 3.873", "",
                           "────────────────────────────────────────────────────",
                           "Results",
                           "────────────────────────────────────────────────────",
                           "  Effect Size (η²)  = 0.020",
                           "  Total Sample Size = 300",
                           "  Type 1 Error (α)  = 0.050",
                           "  Type 2 Error (β)  = 0.316",
                           "  \033[34mStatistical Power = 0.684\033[0m  \033[1;35m◄◄\033[0m", "",
                           "\033[36m────────────────────────────────────────────────────\033[0m",
                           "\033[36mDefinitions\033[0m",
                           "\033[36m────────────────────────────────────────────────────\033[0m",
                           "  \033[36mη²  : (Partial) eta-squared under alternative\033[0m",
                           "  \033[36mλ   : Non-centrality parameter under alternative\033[0m",
                           "  \033[36mλ₀  : Non-centrality parameter under null\033[0m", ""))

    # NB: power.f.mixed.anova uses .print.pwrss.ancova too -------------------------------------------------------------
    crrAsc <- capture.output(power.f.mixed.anova(eta.squared = 0.022,   factor.levels = c(1, 2), rho.within = 0.50,
                                                 effect = "within", power = 0.80, alpha = 0.05, verbose = 2))
    expect_equal(crrAsc, c("+--------------------------------------------------+",
                           "|             SAMPLE SIZE CALCULATION              |",
                           "+--------------------------------------------------+", "",
                           "Repeated Measures Analysis of Variance (F-Test)", "",
                           "----------------------------------------------------",
                           "Hypotheses",
                           "----------------------------------------------------",
                           "  H0 (Null)        : eta.squared = 0",
                           "  H1 (Alternative) : eta.squared > 0", "",
                           "----------------------------------------------------",
                           "Key Parameters",
                           "----------------------------------------------------",
                           "  Design                 = W(2)|B(1)",
                           "  Num. Deg. of Freedom   = 1",
                           "  Denom. Deg. of Freedom = 89",
                           "  Non-centrality of Alt. = 8.098",
                           "  Non-centrality of Null = 0",
                           "  Critical Value         = 3.948", "",
                           "----------------------------------------------------",
                           "Results",
                           "----------------------------------------------------",
                           "  Effect Size (eta-squared) = 0.022",
                           "  Total Sample Size         = 90  <<",
                           "  Type 1 Error (alpha)      = 0.050",
                           "  Type 2 Error (beta)       = 0.196",
                           "  Statistical Power         = 0.804", "",
                           "----------------------------------------------------",
                           "Definitions",
                           "----------------------------------------------------",
                           "  eta.squared      : (Partial) eta-squared under alt.", ""))

    crrUTF <- capture.output(power.f.mixed.anova(eta.squared = 0.022,   factor.levels = c(1, 2), rho.within = 0.50,
                                                 effect = "within", power = 0.80, alpha = 0.05, verbose = 2, utf = TRUE))
    expect_equal(crrUTF, c("╔══════════════════════════════════════════════════╗",
                           "║           \033[34m SAMPLE SIZE CALCULATION \033[0m              ║",
                           "╚══════════════════════════════════════════════════╝", "",
                           "Repeated Measures Analysis of Variance (F-Test)", "",
                           "────────────────────────────────────────────────────",
                           "Hypotheses",
                           "────────────────────────────────────────────────────",
                           "  H₀ (Null)        : η² = 0",
                           "  H₁ (Alternative) : η² > 0", "",
                           "────────────────────────────────────────────────────",
                           "Key Parameters",
                           "────────────────────────────────────────────────────",
                           "  Design      = W(2)|B(1)",
                           "  df1         = 1",
                           "  df2         = 89",
                           "  λ           = 8.098",
                           "  λ₀          = 0",
                           "  F⁻¹(α, λ₀)   = 3.948", "",
                           "────────────────────────────────────────────────────",
                           "Results",
                           "────────────────────────────────────────────────────",
                           "  Effect Size (η²)  = 0.022",
                           "  \033[34mTotal Sample Size = 90\033[0m  \033[1;35m◄◄\033[0m",
                           "  Type 1 Error (α)  = 0.050",
                           "  Type 2 Error (β)  = 0.196",
                           "  Statistical Power = 0.804", "",
                           "\033[36m────────────────────────────────────────────────────\033[0m",
                           "\033[36mDefinitions\033[0m",
                           "\033[36m────────────────────────────────────────────────────\033[0m",
                           "  \033[36mη²  : (Partial) eta-squared under alternative\033[0m",
                           "  \033[36mλ   : Non-centrality parameter under alternative\033[0m",
                           "  \033[36mλ₀  : Non-centrality parameter under null\033[0m", ""))

    crrAsc <- capture.output(power.f.mixed.anova(eta.squared = 0.022,   factor.levels = c(1, 2), rho.within = 0.50,
                                                 effect = "within", n.total = 120, alpha = 0.05, verbose = 2))
    expect_equal(crrAsc, c("+--------------------------------------------------+",
                           "|                POWER CALCULATION                 |",
                           "+--------------------------------------------------+", "",
                           "Repeated Measures Analysis of Variance (F-Test)", "",
                           "----------------------------------------------------",
                           "Hypotheses",
                           "----------------------------------------------------",
                           "  H0 (Null)        : eta.squared = 0",
                           "  H1 (Alternative) : eta.squared > 0", "",
                           "----------------------------------------------------",
                           "Key Parameters",
                           "----------------------------------------------------",
                           "  Design                 = W(2)|B(1)",
                           "  Num. Deg. of Freedom   = 1",
                           "  Denom. Deg. of Freedom = 119",
                           "  Non-centrality of Alt. = 10.798",
                           "  Non-centrality of Null = 0",
                           "  Critical Value         = 3.921", "",
                           "----------------------------------------------------",
                           "Results",
                           "----------------------------------------------------",
                           "  Effect Size (eta-squared) = 0.022",
                           "  Total Sample Size         = 120",
                           "  Type 1 Error (alpha)      = 0.050",
                           "  Type 2 Error (beta)       = 0.097",
                           "  Statistical Power         = 0.903  <<", "",
                           "----------------------------------------------------",
                           "Definitions",
                           "----------------------------------------------------",
                           "  eta.squared      : (Partial) eta-squared under alt.", ""))

    crrUTF <- capture.output(power.f.mixed.anova(eta.squared = 0.022,   factor.levels = c(1, 2), rho.within = 0.50,
                                                 effect = "within", n.total = 120, alpha = 0.05, verbose = 2, utf = TRUE))
    expect_equal(crrUTF, c("╔══════════════════════════════════════════════════╗",
                           "║               \033[34m POWER CALCULATION \033[0m                ║",
                           "╚══════════════════════════════════════════════════╝", "",
                           "Repeated Measures Analysis of Variance (F-Test)", "",
                           "────────────────────────────────────────────────────",
                           "Hypotheses",
                           "────────────────────────────────────────────────────",
                           "  H₀ (Null)        : η² = 0",
                           "  H₁ (Alternative) : η² > 0", "",
                           "────────────────────────────────────────────────────",
                           "Key Parameters",
                           "────────────────────────────────────────────────────",
                           "  Design      = W(2)|B(1)",
                           "  df1         = 1",
                           "  df2         = 119",
                           "  λ           = 10.798",
                           "  λ₀          = 0",
                           "  F⁻¹(α, λ₀)   = 3.921", "",
                           "────────────────────────────────────────────────────",
                           "Results",
                           "────────────────────────────────────────────────────",
                           "  Effect Size (η²)  = 0.022",
                           "  Total Sample Size = 120",
                           "  Type 1 Error (α)  = 0.050",
                           "  Type 2 Error (β)  = 0.097",
                           "  \033[34mStatistical Power = 0.903\033[0m  \033[1;35m◄◄\033[0m", "",
                           "\033[36m────────────────────────────────────────────────────\033[0m",
                           "\033[36mDefinitions\033[0m",
                           "\033[36m────────────────────────────────────────────────────\033[0m",
                           "  \033[36mη²  : (Partial) eta-squared under alternative\033[0m",
                           "  \033[36mλ   : Non-centrality parameter under alternative\033[0m",
                           "  \033[36mλ₀  : Non-centrality parameter under null\033[0m", ""))


    expect_equal(capture.output(power.f.mixed.anova(eta.squared = 0.059, factor.levels = c(2, 1), effect = "between",
                                                    alpha = 0.05, power = 0.80))[5],
                 "Analysis of Variance (F-Test)")
    expect_equal(capture.output(power.f.mixed.anova(eta.squared = 0.038, factor.levels = c(2, 2),  rho.within = 0.50,
                                                    effect = "between", power = 0.80, alpha = 0.05))[5],
                 "Mixed-Effects Analysis of Variance (F-Test)")
    # ------------------------------------------------------------------------------------------------------------------


    # .print.pwrss.contrast --------------------------------------------------------------------------------------------
    crrAsc <- capture.output(power.t.contrast(mu.vector = c(0.20, 0.10), sd.vector = rep(1, 2), n.vector = rep(1200, 2),
                                              contrast.vector = c(1, -1), r.squared = 0.50, k.covariates = 1, alpha = 0.05, verbose = 2))
    expect_equal(crrAsc, c("+--------------------------------------------------+",
                           "|                POWER CALCULATION                 |",
                           "+--------------------------------------------------+", "",
                           "Single Contrast Analysis (T-Test)", "",
                           "----------------------------------------------------",
                           "Hypotheses",
                           "----------------------------------------------------",
                           "  H0 (Null)        : psi  = 0",
                           "  H1 (Alternative) : psi != 0", "",
                           "----------------------------------------------------",
                           "Key Parameters",
                           "----------------------------------------------------",
                           "  Contrast Est. (psi)    =  0.100",
                           "  Standardized psi (d)   =  0.141",
                           "  Degrees of Freedom     =  2397",
                           "  Non-centrality of Alt. =  3.463",
                           "  Non-centrality of Null =  0",
                           "  Critical Value         = -1.961 and 1.961", "",
                           "----------------------------------------------------",
                           "Results",
                           "----------------------------------------------------",
                           "  Effect Size (d)      = 0.141",
                           "  Total Sample Size    = 2400",
                           "  Type 1 Error (alpha) = 0.050",
                           "  Type 2 Error (beta)  = 0.067",
                           "  Statistical Power    = 0.933  <<", "",
                           "----------------------------------------------------",
                           "Definitions",
                           "----------------------------------------------------",
                           "  psi : Contrast estimate, sum(contrast[i] * mu[i])",
                           "  d   : Standardized contrast estimate", ""))

    crrUTF <- capture.output(power.t.contrast(mu.vector = c(0.20, 0.10), sd.vector = rep(1, 2), n.vector = rep(1200, 2),
                                              contrast.vector = c(1, -1), r.squared = 0.50, k.covariates = 1, alpha = 0.05,
                                              verbose = 2, utf = TRUE))
    expect_equal(crrUTF, c("╔══════════════════════════════════════════════════╗",
                           "║               \033[34m POWER CALCULATION \033[0m                ║",
                           "╚══════════════════════════════════════════════════╝", "",
                           "Single Contrast Analysis (T-Test)", "",
                           "────────────────────────────────────────────────────",
                           "Hypotheses",
                           "────────────────────────────────────────────────────",
                           "  H₀ (Null)        : ψ = 0",
                           "  H₁ (Alternative) : ψ ≠ 0", "",
                           "────────────────────────────────────────────────────",
                           "Key Parameters",
                           "────────────────────────────────────────────────────",
                           "  ψ           =  0.100",
                           "  d           =  0.141",
                           "  df          =  2397",
                           "  λ           =  3.463",
                           "  λ₀          =  0",
                           "  T⁻¹(α, λ₀)   = -1.961 and 1.961", "",
                           "────────────────────────────────────────────────────",
                           "Results",
                           "────────────────────────────────────────────────────",
                           "  Effect Size (d)   = 0.141",
                           "  Total Sample Size = 2400",
                           "  Type 1 Error (α)  = 0.050",
                           "  Type 2 Error (β)  = 0.067",
                           "  \033[34mStatistical Power = 0.933\033[0m  \033[1;35m◄◄\033[0m", "",
                           "\033[36m────────────────────────────────────────────────────\033[0m",
                           "\033[36mDefinitions\033[0m",
                           "\033[36m────────────────────────────────────────────────────\033[0m",
                           "  \033[36mψ  : Contrast est. defined as ∑(contrastᵢ * μᵢ)\033[0m",
                           "  \033[36md  : Standardized contrast estimate\033[0m",
                           "  \033[36mλ  : Non-centrality parameter under alternative\033[0m",
                           "  \033[36mλ₀ : Non-centrality parameter under null\033[0m", ""))
    # ------------------------------------------------------------------------------------------------------------------


    # .print.pwrss.contrasts -------------------------------------------------------------------------------------------
    mtxCnt <- factorial.contrasts(factor.levels = 3, coding = "treatment", verbose = 0)$contrast.matrix
    crrRes <- power.f.ancova.shieh(mu.vector = c(0.15, 0.30, 0.20), sd.vector = rep(1, 3), p.vector = rep(1 / 3, 3),
                                   contrast.matrix = mtxCnt, r.squared = 0.50, k.covariates = 1, alpha = 0.05,
                                   power = 0.80, verbose = 0)
    crrAsc <- capture.output(power.t.contrasts(crrRes, adjust.alpha = "fdr", verbose = 2))
    expect_equal(crrAsc, c("+--------------------------------------------------+",
                           "|                POWER CALCULATION                 |",
                           "+--------------------------------------------------+", "",
                           "Multiple Contrast Analyses (T-Tests)", "",
                           "----------------------------------------------------",
                           "Hypotheses",
                           "----------------------------------------------------",
                           "  H0 (Null)        : psi  = 0",
                           "  H1 (Alternative) : psi != 0", "",
                           "----------------------------------------------------",
                           "Key Parameters",
                           "----------------------------------------------------",
                           "  Non-centrality of Null = 0",
                           "  Adjusted Alpha         = 0.025",
                           "  Alpha Adjustment       = False Discovery Rate", "",
                           "----------------------------------------------------",
                           "Results",
                           "----------------------------------------------------",
                           " contr comparison   psi      d    ncp n.total power",
                           "     1  A1 <=> A3 -0.05 -0.071 -1.018    1245 0.111",
                           "     2  A2 <=> A3  0.10  0.141  2.036    1245 0.418", "",
                           "----------------------------------------------------",
                           "Definitions",
                           "----------------------------------------------------",
                           "  psi : Contrast estimate, sum(contrast[i] * mu[i])",
                           "  d   : Standardized contrast estimate",
                           "  ncp : Non-centrality parameter under alt.", ""))

    crrUTF <- capture.output(power.t.contrasts(crrRes, adjust.alpha = "fdr", verbose = 2, utf = TRUE))
    expect_equal(crrUTF, c("╔══════════════════════════════════════════════════╗",
                           "║               \033[34m POWER CALCULATION \033[0m                ║",
                           "╚══════════════════════════════════════════════════╝", "",
                           "Multiple Contrast Analyses (T-Tests)", "",
                           "────────────────────────────────────────────────────",
                           "Hypotheses",
                           "────────────────────────────────────────────────────",
                           "  H₀ (Null)        : ψ = 0",
                           "  H₁ (Alternative) : ψ ≠ 0", "",
                           "────────────────────────────────────────────────────",
                           "Key Parameters",
                           "────────────────────────────────────────────────────",
                           "  λ₀                        = 0",
                           "  Adjusted Type 1 Error (α) = 0.025",
                           "  α Adjustment              = False Discovery Rate", "",
                           "────────────────────────────────────────────────────",
                           "Results",
                           "────────────────────────────────────────────────────",
                           " contr comparison   psi      d    ncp n.total power",
                           "     1  A1 <=> A3 -0.05 -0.071 -1.018    1245 0.111",
                           "     2  A2 <=> A3  0.10  0.141  2.036    1245 0.418", "",
                           "\033[36m────────────────────────────────────────────────────\033[0m",
                           "\033[36mDefinitions\033[0m",
                           "\033[36m────────────────────────────────────────────────────\033[0m",
                           "  \033[36mψ (psi) : Contrast est. defined as ∑(contrastᵢ * μᵢ)\033[0m",
                           "  \033[36md       : Standardized contrast estimate\033[0m",
                           "  \033[36mλ₀      : Non-centrality parameter under alt.\033[0m", ""))
    # ------------------------------------------------------------------------------------------------------------------


    # .print.pwrss.steiger ---------------------------------------------------------------------------------------------
    crrAsc <- capture.output(power.z.twocors.steiger(rho12 = 0.35, rho13 = 0.45, rho23 = 0.05, n = 1000, power = NULL,
                                                     alpha = 0.05, alternative = "two.sided", common.index = TRUE, verbose = 2))
    expect_equal(crrAsc, c("+--------------------------------------------------+",
                           "|                POWER CALCULATION                 |",
                           "+--------------------------------------------------+", "",
                           "Dependent Correlations", "",
                           "  Common Index : TRUE", "",
                           "----------------------------------------------------",
                           "Hypotheses",
                           "----------------------------------------------------",
                           "  H0 (Null)        : rho12 - rho13  = 0",
                           "  H1 (Alternative) : rho12 - rho13 != 0", "",
                           "----------------------------------------------------",
                           "Key Parameters",
                           "----------------------------------------------------",
                           "  rho12 - rho13  = -0.100",
                           "  Mean of Alt.   = -2.625",
                           "  SD of Alt.     =  0.999",
                           "  Mean of Null   =  0",
                           "  SD of Null     =  1",
                           "  Critical Value = -1.960 and 1.960", "",
                           "----------------------------------------------------",
                           "Results",
                           "----------------------------------------------------",
                           "  Target Effect (rho12) = 0.350 (vs. rho13 = 0.450)",
                           "  Sample Size           = 1000",
                           "  Type 1 Error (alpha)  = 0.050",
                           "  Type 2 Error (beta)   = 0.253",
                           "  Statistical Power     = 0.747  <<", "",
                           "----------------------------------------------------",
                           "Definitions",
                           "----------------------------------------------------",
                           "  rho12 : Correlation between variable V1 and V2",
                           "  rho13 : Correlation between variable V1 and V3", ""))

    crrUTF <- capture.output(power.z.twocors.steiger(rho12 = 0.35, rho13 = 0.45, rho23 = 0.05, n = 1000, power = NULL,
                                                     alpha = 0.05, alternative = "two.sided", common.index = TRUE,
                                                     verbose = 2, utf = TRUE))
    expect_equal(crrUTF, c("╔══════════════════════════════════════════════════╗",
                           "║               \033[34m POWER CALCULATION \033[0m                ║",
                           "╚══════════════════════════════════════════════════╝", "",
                           "Dependent Correlations", "",
                           "  Common Index : TRUE", "",
                           "────────────────────────────────────────────────────",
                           "Hypotheses",
                           "────────────────────────────────────────────────────",
                           "  H₀ (Null)        : ρ₁₂ -  ρ₁₃ = 0",
                           "  H₁ (Alternative) : ρ₁₂ -  ρ₁₃ ≠ 0", "",
                           "────────────────────────────────────────────────────",
                           "Key Parameters",
                           "────────────────────────────────────────────────────",
                           "  ρ₁₂ - ρ₁₃       = -0.100",
                           "  μ (Alternative) = -2.625",
                           "  σ (Alternative) =  0.999",
                           "  μ₀ (Null)       =  0",
                           "  σ₀ (Null)       =  1",
                           "  Z⁻¹(α, μ₀, σ₀)  = -1.960 and 1.960", "",
                           "────────────────────────────────────────────────────",
                           "Results",
                           "────────────────────────────────────────────────────",
                           "  Target Effect (ρ₁₂) = 0.350 (vs. ρ₁₃ = 0.450)",
                           "  Sample Size         = 1000",
                           "  Type 1 Error (α)    = 0.050",
                           "  Type 2 Error (β)    = 0.253",
                           "  \033[34mStatistical Power   = 0.747\033[0m  \033[1;35m◄◄\033[0m", "",
                           "\033[36m────────────────────────────────────────────────────\033[0m",
                           "\033[36mDefinitions\033[0m",
                           "\033[36m────────────────────────────────────────────────────\033[0m",
                           "  \033[36mρ₁₂ : Correlation between variable V1 and V2\033[0m",
                           "  \033[36mρ₁₃ : Correlation between variable V1 and V3\033[0m",
                           "  \033[36mμ   : Mean\033[0m",
                           "  \033[36mσ   : Standard deviation\033[0m", ""))

    crrAsc <- capture.output(power.z.twocors.steiger(rho12 = 0.45, rho13 = 0.45, rho23 = 0.50, rho14 = 0.50, rho24 = 0.80, rho34 = 0.55,
                                                     power = 0.8, alpha = 0.05, alternative = "two.sided", common.index = FALSE, verbose = 2))
    expect_equal(crrAsc, c("+--------------------------------------------------+",
                           "|             SAMPLE SIZE CALCULATION              |",
                           "+--------------------------------------------------+", "",
                           "Dependent Correlations", "",
                           "  Common Index : FALSE", "",
                           "----------------------------------------------------",
                           "Hypotheses",
                           "----------------------------------------------------",
                           "  H0 (Null)        : rho12 - rho34  = 0",
                           "  H1 (Alternative) : rho12 - rho34 != 0", "",
                           "----------------------------------------------------",
                           "Key Parameters",
                           "----------------------------------------------------",
                           "  rho12 - rho34  = -0.100",
                           "  Mean of Alt.   = -2.802",
                           "  SD of Alt.     =  1.000",
                           "  Mean of Null   =  0",
                           "  SD of Null     =  1",
                           "  Critical Value = -1.960 and 1.960", "",
                           "----------------------------------------------------",
                           "Results",
                           "----------------------------------------------------",
                           "  Target Effect (rho12) = 0.450 (vs. rho34 = 0.550)",
                           "  Sample Size           = 643  <<",
                           "  Type 1 Error (alpha)  = 0.050",
                           "  Type 2 Error (beta)   = 0.200",
                           "  Statistical Power     = 0.800", "",
                           "----------------------------------------------------",
                           "Definitions",
                           "----------------------------------------------------",
                           "  rho12 : Correlation between variable V1 and V2",
                           "  rho34 : Correlation between variable V3 and V4", ""))

    crrUTF <- capture.output(power.z.twocors.steiger(rho12 = 0.45, rho13 = 0.45, rho23 = 0.50, rho14 = 0.50, rho24 = 0.80, rho34 = 0.55,
                                                     power = 0.8, alpha = 0.05, alternative = "two.sided", common.index = FALSE,
                                                     verbose = 2, utf = TRUE))
    expect_equal(crrUTF, c("╔══════════════════════════════════════════════════╗",
                           "║           \033[34m SAMPLE SIZE CALCULATION \033[0m              ║",
                           "╚══════════════════════════════════════════════════╝", "",
                           "Dependent Correlations", "",
                           "  Common Index : FALSE", "",
                           "────────────────────────────────────────────────────",
                           "Hypotheses",
                           "────────────────────────────────────────────────────",
                           "  H₀ (Null)        : ρ₁₂ -  ρ₃₄ = 0",
                           "  H₁ (Alternative) : ρ₁₂ -  ρ₃₄ ≠ 0", "",
                           "────────────────────────────────────────────────────",
                           "Key Parameters",
                           "────────────────────────────────────────────────────",
                           "  ρ₁₂ - ρ₃₄       = -0.100",
                           "  μ (Alternative) = -2.802",
                           "  σ (Alternative) =  1.000",
                           "  μ₀ (Null)       =  0",
                           "  σ₀ (Null)       =  1",
                           "  Z⁻¹(α, μ₀, σ₀)  = -1.960 and 1.960", "",
                           "────────────────────────────────────────────────────",
                           "Results",
                           "────────────────────────────────────────────────────",
                           "  Target Effect (ρ₁₂) = 0.450 (vs. ρ₃₄ = 0.550)",
                           "  \033[34mSample Size         = 643\033[0m  \033[1;35m◄◄\033[0m",
                           "  Type 1 Error (α)    = 0.050",
                           "  Type 2 Error (β)    = 0.200",
                           "  Statistical Power   = 0.800", "",
                           "\033[36m────────────────────────────────────────────────────\033[0m",
                           "\033[36mDefinitions\033[0m",
                           "\033[36m────────────────────────────────────────────────────\033[0m",
                           "  \033[36mρ₁₂ : Correlation between variable V1 and V2\033[0m",
                           "  \033[36mρ₃₄ : Correlation between variable V3 and V4\033[0m",
                           "  \033[36mμ   : Mean\033[0m",
                           "  \033[36mσ   : Standard deviation\033[0m", ""))
    # ------------------------------------------------------------------------------------------------------------------


    # .print.pwrss.twocors ---------------------------------------------------------------------------------------------
    crrAsc <- capture.output(power.z.twocors(rho1 = 0.20, rho2 = 0.30, power = 0.80, alpha = 0.05, alternative = "two.sided", verbose = 2))
    expect_equal(crrAsc, c("+--------------------------------------------------+",
                           "|             SAMPLE SIZE CALCULATION              |",
                           "+--------------------------------------------------+", "",
                           "Independent Correlations", "",
                           "----------------------------------------------------",
                           "Hypotheses",
                           "----------------------------------------------------",
                           "  H0 (Null)        : rho1 - rho2  = 0",
                           "  H1 (Alternative) : rho1 - rho2 != 0", "",
                           "----------------------------------------------------",
                           "Key Parameters",
                           "----------------------------------------------------",
                           "  rho1 - rho2    = -0.100",
                           "  Cohen's q      = -0.107",
                           "  Mean of Alt.   = -2.802",
                           "  SD of Alt.     =  1",
                           "  Mean of Null   =  0",
                           "  SD of Null     =  1",
                           "  Critical Value = -1.960 and 1.960", "",
                           "----------------------------------------------------",
                           "Results",
                           "----------------------------------------------------",
                           "  Target Effect (rho1) = 0.200 (vs. rho2 = 0.300)",
                           "  Sample Size          = 1380 and 1380  <<",
                           "  Type 1 Error (alpha) = 0.050",
                           "  Type 2 Error (beta)  = 0.200",
                           "  Statistical Power    = 0.800", "",
                           "----------------------------------------------------",
                           "Definitions",
                           "----------------------------------------------------",
                           "  rho1 : Correlation (for some V1 ~ V2) in group 1",
                           "  rho2 : Correlation (for some V1 ~ V2) in group 2", ""))

    crrUTF <- capture.output(power.z.twocors(rho1 = 0.20, rho2 = 0.30, n2 = 1380, alpha = 0.05, alternative = "two.sided",
                                             verbose = 2, utf = TRUE))
    expect_equal(crrUTF, c("╔══════════════════════════════════════════════════╗",
                           "║               \033[34m POWER CALCULATION \033[0m                ║",
                           "╚══════════════════════════════════════════════════╝", "",
                           "Independent Correlations", "",
                           "────────────────────────────────────────────────────",
                           "Hypotheses",
                           "────────────────────────────────────────────────────",
                           "  H₀ (Null)        : ρ₁ - ρ₂ = 0",
                           "  H₁ (Alternative) : ρ₁ - ρ₂ ≠ 0", "",
                           "────────────────────────────────────────────────────",
                           "Key Parameters",
                           "────────────────────────────────────────────────────",
                           "  ρ₁ - ρ₂         = -0.100",
                           "  Cohen's q       = -0.107",
                           "  μ (Alternative) = -2.802",
                           "  σ (Alternative) =  1",
                           "  μ₀ (Null)       =  0",
                           "  σ₀ (Null)       =  1",
                           "  Z⁻¹(α, μ₀, σ₀)  = -1.960 and 1.960", "",
                           "────────────────────────────────────────────────────",
                           "Results",
                           "────────────────────────────────────────────────────",
                           "  Target Effect (ρ₁) = 0.200 (vs. ρ₂ = 0.300)",
                           "  Sample Size        = 1380 and 1380",
                           "  Type 1 Error (α)   = 0.050",
                           "  Type 2 Error (β)   = 0.200",
                           "  \033[34mStatistical Power  = 0.800\033[0m  \033[1;35m◄◄\033[0m", "",
                           "\033[36m────────────────────────────────────────────────────\033[0m",
                           "\033[36mDefinitions\033[0m",
                           "\033[36m────────────────────────────────────────────────────\033[0m",
                           "  \033[36mρ₁ : Correlation (for some V1 ~ V2) in group 1\033[0m",
                           "  \033[36mρ₂ : Correlation (for some V1 ~ V2) in group 2\033[0m",
                           "  \033[36mμ  : Mean\033[0m",
                           "  \033[36mσ  : Standard deviation\033[0m", ""))

    crrAsc <- capture.output(power.z.twocors(rho1 = 0.20, rho2 = 0.30, power = 0.80, alpha = 0.05, alternative = "one.sided", verbose = 2))
    expect_equal(crrAsc[c(5, 10, 11, 16:22, 27, 36:37)],
                 c("Independent Correlations",
                   "  H0 (Null)        : rho1 - rho2 >= 0",
                   "  H1 (Alternative) : rho1 - rho2  < 0",
                   "  rho1 - rho2    = -0.100",
                   "  Cohen's q      = -0.107",
                   "  Mean of Alt.   = -2.487",
                   "  SD of Alt.     =  1",
                   "  Mean of Null   =  0",
                   "  SD of Null     =  1",
                   "  Critical Value = -1.645",
                   "  Target Effect (rho1) = 0.200 (vs. rho2 = 0.300)",
                   "  rho1 : Correlation (for some V1 ~ V2) in group 1",
                   "  rho2 : Correlation (for some V1 ~ V2) in group 2"))
    expect_length(crrAsc, 38)

    crrUTF <- capture.output(power.z.twocors(rho1 = 0.20, rho2 = 0.30, power = 0.80, alpha = 0.05, alternative = "one.sided",
                                             verbose = 2, utf = TRUE))
    expect_equal(crrUTF[c(5, 10, 11, 16:22, 27, 36:39)],
                 c("Independent Correlations",
                   "  H₀ (Null)        : ρ₁ - ρ₂ ≥ 0",
                   "  H₁ (Alternative) : ρ₁ - ρ₂ < 0",
                   "  ρ₁ - ρ₂         = -0.100",
                   "  Cohen's q       = -0.107",
                   "  μ (Alternative) = -2.487",
                   "  σ (Alternative) =  1",
                   "  μ₀ (Null)       =  0",
                   "  σ₀ (Null)       =  1",
                   "  Z⁻¹(α, μ₀, σ₀)  = -1.645",
                   "  Target Effect (ρ₁) = 0.200 (vs. ρ₂ = 0.300)",
                   "  \033[36mρ₁ : Correlation (for some V1 ~ V2) in group 1\033[0m",
                   "  \033[36mρ₂ : Correlation (for some V1 ~ V2) in group 2\033[0m",
                   "  \033[36mμ  : Mean\033[0m",
                   "  \033[36mσ  : Standard deviation\033[0m"))
    expect_length(crrUTF, 40)

    crrAsc <- capture.output(power.z.onecor(rho = 0.20, power = 0.80, alpha = 0.05, alternative = "two.sided", verbose = 2))
    expect_equal(crrAsc[c(5, 10:11, 16:22, 27, 36:37)],
                 c("One-Sample Correlation (Approximate)",
                   "  H0 (Null)        : rho - null.rho  = 0",
                   "  H1 (Alternative) : rho - null.rho != 0",
                   "  rho - null.rho =  0.200",
                   "  Cohen's q      =  0.203",
                   "  Mean of Alt.   =  2.802",
                   "  SD of Alt.     =  1",
                   "  Mean of Null   =  0",
                   "  SD of Null     =  1",
                   "  Critical Value = -1.960 and 1.960",
                   "  Target Effect (rho)  = 0.200 (vs. null.rho = 0)",
                   "  rho      : Correlation (for some V1 ~ V2) under alt.",
                   "  null.rho : Correlation (for some V1 ~ V2) under null"))
    expect_length(crrAsc, 38)

    crrUTF <- capture.output(power.z.onecor(rho = 0.20, power = 0.80, alpha = 0.05, alternative = "two.sided", verbose = 2, utf = TRUE))
    expect_equal(crrUTF[c(5, 10:11, 16:22, 27, 36:39)],
                 c("One-Sample Correlation (Approximate)",
                   "  H₀ (Null)        : ρ - ρ₀ = 0",
                   "  H₁ (Alternative) : ρ - ρ₀ ≠ 0",
                   "  ρ₁ - ρ₀         =  0.200",
                   "  Cohen's q       =  0.203",
                   "  μ (Alternative) =  2.802",
                   "  σ (Alternative) =  1",
                   "  μ₀ (Null)       =  0",
                   "  σ₀ (Null)       =  1",
                   "  Z⁻¹(α, μ₀, σ₀)  = -1.960 and 1.960",
                   "  Target Effect (ρ)  = 0.200 (vs. ρ₀ = 0)",
                   "  \033[36mρ₁ : Correlation (for some V1 ~ V2) under alternative\033[0m",
                   "  \033[36mρ₀ : Correlation (for some V1 ~ V2) under null\033[0m",
                   "  \033[36mμ  : Mean\033[0m",
                   "  \033[36mσ  : Standard deviation\033[0m"))
    expect_length(crrUTF, 40)

    crrAsc <- capture.output(power.exact.onecor(rho = 0.20, power = 0.80, alpha = 0.05, alternative = "two.sided", verbose = 2))
    expect_equal(crrAsc[c(5, 10:11, 16:17, 22, 31:32)],
                 c("One-Sample Correlation (Exact)",
                   "  H0 (Null)        : rho - null.rho  = 0",
                   "  H1 (Alternative) : rho - null.rho != 0",
                   "  rho - null.rho = 0.200",
                   "  Cohen's q      = 0.203",
                   "  Target Effect (rho)  = 0.200 (vs. null.rho = 0)",
                   "  rho      : Correlation (for some V1 ~ V2) under alt.",
                   "  null.rho : Correlation (for some V1 ~ V2) under null"))
    expect_length(crrAsc, 33)

    crrUTF <- capture.output(power.exact.onecor(rho = 0.20, power = 0.80, alpha = 0.05, alternative = "two.sided", verbose = 2, utf = TRUE))
    expect_equal(crrUTF[c(5, 10:11, 16:17, 22, 31:34)],
                 c("One-Sample Correlation (Exact)",
                   "  H₀ (Null)        : ρ - ρ₀ = 0",
                   "  H₁ (Alternative) : ρ - ρ₀ ≠ 0",
                   "  ρ₁ - ρ₀   = 0.200",
                   "  Cohen's q = 0.203",
                   "  Target Effect (ρ)  = 0.200 (vs. ρ₀ = 0)",
                   "  \033[36mρ₁ : Correlation (for some V1 ~ V2) under alternative\033[0m",
                   "  \033[36mρ₀ : Correlation (for some V1 ~ V2) under null\033[0m",
                   "  \033[36mμ  : Mean\033[0m",
                   "  \033[36mσ  : Standard deviation\033[0m"))
    expect_length(crrUTF, 35)
    # ------------------------------------------------------------------------------------------------------------------


    # .print.pwrss.binom -----------------------------------------------------------------------------------------------
    crrAsc <- capture.output(power.binom.test(size = 200, prob = 0.6, null.prob = 0.5, alpha = 0.05, alternative = "one.sided",
                                              plot = FALSE, verbose = 2))
    expect_equal(crrAsc, c("+--------------------------------------------------+",
                           "|                POWER CALCULATION                 |",
                           "+--------------------------------------------------+", "",
                           "Generic Binomial Test", "",
                           "----------------------------------------------------",
                           "Hypotheses",
                           "----------------------------------------------------",
                           "  H0 (Null)        : prob <= null.prob",
                           "  H1 (Alternative) : prob  > null.prob", "",
                           "----------------------------------------------------",
                           "Key Parameters",
                           "----------------------------------------------------",
                           "  Size                   = 200",
                           "  Probability Under Alt. = 0.600",
                           "  Probability Under Null = 0.500",
                           "  Critical Value         = 112", "",
                           "----------------------------------------------------",
                           "Results",
                           "----------------------------------------------------",
                           "  Target NCP (prob)    = 0.600 (vs. null.prob = 0.500)",
                           "  Number of Trials     = 200",
                           "  Type 1 Error (alpha) = 0.038",
                           "  Type 2 Error (beta)  = 0.140",
                           "  Statistical Power    = 0.860  <<", "",
                           "----------------------------------------------------",
                           "Definitions",
                           "----------------------------------------------------",
                           "  prob      : Probability under alt.",
                           "  null.prob : Probability under null", ""))

    crrUTF <- capture.output(power.binom.test(size = 200, prob = 0.6, null.prob = 0.5, alpha = 0.05, alternative = "one.sided",
                                              plot = FALSE, verbose = 2, utf = TRUE))
    expect_equal(crrUTF, c("╔══════════════════════════════════════════════════╗",
                           "║               \033[34m POWER CALCULATION \033[0m                ║",
                           "╚══════════════════════════════════════════════════╝", "",
                           "Generic Binomial Test", "",
                           "────────────────────────────────────────────────────",
                           "Hypotheses",
                           "────────────────────────────────────────────────────",
                           "  H₀ (Null)        : P ≤ P₀",
                           "  H₁ (Alternative) : P > P₀", "",
                           "────────────────────────────────────────────────────",
                           "Key Parameters",
                           "────────────────────────────────────────────────────",
                           "  Size          = 200",
                           "  P             = 0.600",
                           "  P₀            = 0.500",
                           "  Bin⁻¹(α, P₀)   = 112", "",
                           "────────────────────────────────────────────────────",
                           "Results",
                           "────────────────────────────────────────────────────",
                           "  Target NCP (P)    = 0.600 (vs. P₀ = 0.500)",
                           "  Number of Trials  = 200",
                           "  Type 1 Error (α)  = 0.038",
                           "  Type 2 Error (β)  = 0.140",
                           "  \033[34mStatistical Power = 0.860\033[0m  \033[1;35m◄◄\033[0m", "",
                           "\033[36m────────────────────────────────────────────────────\033[0m",
                           "\033[36mDefinitions\033[0m",
                           "\033[36m────────────────────────────────────────────────────\033[0m",
                           "  \033[36mP  : Probability under alternative\033[0m",
                           "  \033[36mP₀ : Probability under null\033[0m", ""))
    # ------------------------------------------------------------------------------------------------------------------


    # .print.pwrss.chisq -----------------------------------------------------------------------------------------------
    crrAsc <- capture.output(power.chisq.test(ncp = 20, df = 100, alpha = 0.05, plot = FALSE, verbose = 2))
    expect_equal(crrAsc, c("+--------------------------------------------------+",
                           "|                POWER CALCULATION                 |",
                           "+--------------------------------------------------+", "",
                           "Generic Chi-square Test", "",
                           "----------------------------------------------------",
                           "Hypotheses",
                           "----------------------------------------------------",
                           "  H0 (Null)        : lambda = null.lambda",
                           "  H1 (Alternative) : lambda > null.lambda", "",
                           "----------------------------------------------------",
                           "Key Parameters",
                           "----------------------------------------------------",
                           "  Degrees of Freedom     = 100",
                           "  Non-centrality of Alt. = 20",
                           "  Non-centrality of Null = 0",
                           "  Critical Value         = 124.342", "",
                           "----------------------------------------------------",
                           "Results",
                           "----------------------------------------------------",
                           "  Target NCP (lambda)  = 20 (vs. null.lambda = 0)",
                           "  Degrees of Freedom   = 100",
                           "  Type 1 Error (alpha) = 0.050",
                           "  Type 2 Error (beta)  = 0.619",
                           "  Statistical Power    = 0.381  <<", "",
                           "----------------------------------------------------",
                           "Definitions",
                           "----------------------------------------------------",
                           "  lambda      : Non-centrality parameter of alt.",
                           "  null.lambda : Non-centrality parameter of null", ""))

    crrUTF <- capture.output(power.chisq.test(ncp = 20, df = 100, alpha = 0.05, plot = FALSE, verbose = 2, utf = TRUE))
    expect_equal(crrUTF, c("╔══════════════════════════════════════════════════╗",
                           "║               \033[34m POWER CALCULATION \033[0m                ║",
                           "╚══════════════════════════════════════════════════╝", "",
                           "Generic Chi-square Test", "",
                           "────────────────────────────────────────────────────",
                           "Hypotheses",
                           "────────────────────────────────────────────────────",
                           "  H₀ (Null)        : λ = λ₀",
                           "  H₁ (Alternative) : λ > λ₀", "",
                           "────────────────────────────────────────────────────",
                           "Key Parameters",
                           "────────────────────────────────────────────────────",
                           "  df             = 100",
                           "  λ              = 20",
                           "  λ₀             = 0",
                           "  Inv-χ²(α, λ₀)  = 124.342", "",
                           "────────────────────────────────────────────────────",
                           "Results",
                           "────────────────────────────────────────────────────",
                           "  Target NCP (λ)     = 20 (vs. λ₀ = 0)",
                           "  Degrees of Freedom = 100",
                           "  Type 1 Error (α)   = 0.050",
                           "  Type 2 Error (β)   = 0.619",
                           "  \033[34mStatistical Power  = 0.381\033[0m  \033[1;35m◄◄\033[0m", "",
                           "\033[36m────────────────────────────────────────────────────\033[0m",
                           "\033[36mDefinitions\033[0m",
                           "\033[36m────────────────────────────────────────────────────\033[0m",
                           "  \033[36mλ  : Non-centrality parameter under alternative\033[0m",
                           "  \033[36mλ₀ : Non-centrality parameter under null\033[0m", ""))
    # ------------------------------------------------------------------------------------------------------------------


    # .print.pwrss.f ---------------------------------------------------------------------------------------------------
    crrAsc <- capture.output(power.f.test(ncp = 2, df1 = 4, df2 = 100, alpha = 0.05, plot = FALSE, verbose = 2))
    expect_equal(crrAsc, c("+--------------------------------------------------+",
                           "|                POWER CALCULATION                 |",
                           "+--------------------------------------------------+", "",
                           "Generic F-Test", "",
                           "----------------------------------------------------",
                           "Hypotheses",
                           "----------------------------------------------------",
                           "  H0 (Null)        : lambda = 0",
                           "  H1 (Alternative) : lambda > 0", "",
                           "----------------------------------------------------",
                           "Key Parameters",
                           "----------------------------------------------------",
                           "  Num. Deg. of Freedom   = 4",
                           "  Denom. Deg. of Freedom = 100",
                           "  Non-centrality of Alt. = 2",
                           "  Non-centrality of Null = 0",
                           "  Critical Value         = 2.463", "",
                           "----------------------------------------------------",
                           "Results",
                           "----------------------------------------------------",
                           "  Target NCP (lambda)  = 2 (vs. null.lambda = 0)",
                           "  Presumed Sample S.   = 105",
                           "  Type 1 Error (alpha) = 0.050",
                           "  Type 2 Error (beta)  = 0.835",
                           "  Statistical Power    = 0.165  <<", "",
                           "----------------------------------------------------",
                           "Definitions",
                           "----------------------------------------------------",
                           "  lambda      : Non-centrality parameter of alt.",
                           "  null.lambda : Non-centrality parameter of null", ""))

    crrUTF <- capture.output(power.f.test(ncp = 2, df1 = 4, df2 = 100, alpha = 0.05, plot = FALSE, verbose = 2, utf = TRUE))
    expect_equal(crrUTF, c("╔══════════════════════════════════════════════════╗",
                           "║               \033[34m POWER CALCULATION \033[0m                ║",
                           "╚══════════════════════════════════════════════════╝", "",
                           "Generic F-Test", "",
                           "────────────────────────────────────────────────────",
                           "Hypotheses",
                           "────────────────────────────────────────────────────",
                           "  H₀ (Null)        : λ = λ₀",
                           "  H₁ (Alternative) : λ > λ₀", "",
                           "────────────────────────────────────────────────────",
                           "Key Parameters",
                           "────────────────────────────────────────────────────",
                           "  df1         = 4",
                           "  df2         = 100",
                           "  λ           = 2",
                           "  λ₀          = 0",
                           "  F⁻¹(α, λ₀)   = 2.463", "",
                           "────────────────────────────────────────────────────",
                           "Results",
                           "────────────────────────────────────────────────────",
                           "  Target NCP (λ)     = 2 (vs. λ₀ = 0)",
                           "  Presumed Sample S. = 105",
                           "  Type 1 Error (α)   = 0.050",
                           "  Type 2 Error (β)   = 0.835",
                           "  \033[34mStatistical Power  = 0.165\033[0m  \033[1;35m◄◄\033[0m", "",
                           "\033[36m────────────────────────────────────────────────────\033[0m",
                           "\033[36mDefinitions\033[0m",
                           "\033[36m────────────────────────────────────────────────────\033[0m",
                           "  \033[36mλ  : Non-centrality parameter under alternative\033[0m",
                           "  \033[36mλ₀ : Non-centrality parameter under null\033[0m", ""))
    # ------------------------------------------------------------------------------------------------------------------


    # .print.pwrss.t ---------------------------------------------------------------------------------------------------
    crrAsc <- capture.output(power.t.test(ncp = 1.96, df = 100, alpha = 0.05, alternative = "two.sided", plot = FALSE, verbose = 2))
    expect_equal(crrAsc, c("+--------------------------------------------------+",
                           "|                POWER CALCULATION                 |",
                           "+--------------------------------------------------+", "",
                           "Generic t-Test", "",
                           "----------------------------------------------------",
                           "Hypotheses",
                           "----------------------------------------------------",
                           "  H0 (Null)        : lambda  = null.lambda",
                           "  H1 (Alternative) : lambda != null.lambda", "",
                           "----------------------------------------------------",
                           "Key Parameters",
                           "----------------------------------------------------",
                           "  Degrees of Freedom     =  100",
                           "  Non-centrality of Alt. =  1.960",
                           "  Non-centrality of Null =  0",
                           "  Critical Value         = -1.984 and 1.984", "",
                           "----------------------------------------------------",
                           "Results",
                           "----------------------------------------------------",
                           "  Target NCP (lambda)  = 1.960 (vs. null.lambda = 0)",
                           "  Degrees of Freedom   = 100",
                           "  Type 1 Error (alpha) = 0.050",
                           "  Type 2 Error (beta)  = 0.507",
                           "  Statistical Power    = 0.493  <<", "",
                           "----------------------------------------------------",
                           "Definitions",
                           "----------------------------------------------------",
                           "  lambda      : Non-centrality parameter of alt.",
                           "  null.lambda : Non-centrality parameter of null", ""))

    crrUTF <- capture.output(power.t.test(ncp = 1.96, df = 100, alpha = 0.05, alternative = "two.sided", plot = FALSE, verbose = 2, utf = TRUE))
    expect_equal(crrUTF, c("╔══════════════════════════════════════════════════╗",
                           "║               \033[34m POWER CALCULATION \033[0m                ║",
                           "╚══════════════════════════════════════════════════╝", "",
                           "Generic t-Test", "",
                           "────────────────────────────────────────────────────",
                           "Hypotheses",
                           "────────────────────────────────────────────────────",
                           "  H₀ (Null)        : λ = λ₀",
                           "  H₁ (Alternative) : λ ≠ λ₀", "",
                           "────────────────────────────────────────────────────",
                           "Key Parameters",
                           "────────────────────────────────────────────────────",
                           "  df          =  100",
                           "  λ           =  1.960",
                           "  λ₀          =  0",
                           "  T⁻¹(α, λ₀)   = -1.984 and 1.984", "",
                           "────────────────────────────────────────────────────",
                           "Results",
                           "────────────────────────────────────────────────────",
                           "  Target NCP (λ)     = 1.960 (vs. λ₀ = 0)",
                           "  Degrees of Freedom = 100",
                           "  Type 1 Error (α)   = 0.050",
                           "  Type 2 Error (β)   = 0.507",
                           "  \033[34mStatistical Power  = 0.493\033[0m  \033[1;35m◄◄\033[0m", "",
                           "\033[36m────────────────────────────────────────────────────\033[0m",
                           "\033[36mDefinitions\033[0m",
                           "\033[36m────────────────────────────────────────────────────\033[0m",
                           "  \033[36mλ  : Non-centrality parameter under alternative\033[0m",
                           "  \033[36mλ₀ : Non-centrality parameter under null\033[0m", ""))

    crrAsc <- capture.output(power.t.test(ncp = 1.96, df = Inf, alpha = 0.05, alternative = "two.sided", plot = FALSE, verbose = 2))
    expect_false(any(grepl("Degrees of Freedom", crrAsc, fixed = TRUE)))
    expect_length(crrAsc, 33)
    expect_equal(crrAsc[c(18, 25:26)], c("  Critical Value         = -1.960 and 1.960",
                                         "  Type 2 Error (beta)  = 0.500",
                                         "  Statistical Power    = 0.500  <<"))
    crrAsc <- capture.output(power.lp.test(ncp = 1.96, df = 100, alpha = 0.05, alternative = "two.sided", plot = FALSE, verbose = 2))
    expect_equal(crrAsc, c("+--------------------------------------------------+",
                           "|                POWER CALCULATION                 |",
                           "+--------------------------------------------------+", "",
                           "Generic Lambda-Prime Distribution", "",
                           "----------------------------------------------------",
                           "Hypotheses",
                           "----------------------------------------------------",
                           "  H0 (Null)        : lambda  = null.lambda",
                           "  H1 (Alternative) : lambda != null.lambda", "",
                           "----------------------------------------------------",
                           "Key Parameters",
                           "----------------------------------------------------",
                           "  Degrees of Freedom     =  100",
                           "  Non-centrality of Alt. =  1.960",
                           "  Non-centrality of Null =  0",
                           "  Critical Value         = -1.960 and 1.960", "",
                           "----------------------------------------------------",
                           "Results",
                           "----------------------------------------------------",
                           "  Target NCP (lambda)  = 1.960 (vs. null.lambda = 0)",
                           "  Degrees of Freedom   = 100",
                           "  Type 1 Error (alpha) = 0.050",
                           "  Type 2 Error (beta)  = 0.502",
                           "  Statistical Power    = 0.498  <<", "",
                           "----------------------------------------------------",
                           "Definitions",
                           "----------------------------------------------------",
                           "  lambda      : Non-centrality parameter of alt.",
                           "  null.lambda : Non-centrality parameter of null", ""))

    crrUTF <- capture.output(power.lp.test(ncp = 1.96, df = 100, alpha = 0.05, alternative = "two.sided", plot = FALSE, verbose = 2, utf = TRUE))
    expect_equal(crrUTF, c("╔══════════════════════════════════════════════════╗",
                           "║               \033[34m POWER CALCULATION \033[0m                ║",
                           "╚══════════════════════════════════════════════════╝", "",
                           "Generic Lambda-Prime Distribution", "",
                           "────────────────────────────────────────────────────",
                           "Hypotheses",
                           "────────────────────────────────────────────────────",
                           "  H₀ (Null)        : λ = λ₀",
                           "  H₁ (Alternative) : λ ≠ λ₀", "",
                           "────────────────────────────────────────────────────",
                           "Key Parameters",
                           "────────────────────────────────────────────────────",
                           "  df          =  100",
                           "  λ           =  1.960",
                           "  λ₀          =  0",
                           "  T⁻¹(α, λ₀)   = -1.960 and 1.960", "",
                           "────────────────────────────────────────────────────",
                           "Results",
                           "────────────────────────────────────────────────────",
                           "  Target NCP (λ)     = 1.960 (vs. λ₀ = 0)",
                           "  Degrees of Freedom = 100",
                           "  Type 1 Error (α)   = 0.050",
                           "  Type 2 Error (β)   = 0.502",
                           "  \033[34mStatistical Power  = 0.498\033[0m  \033[1;35m◄◄\033[0m", "",
                           "\033[36m────────────────────────────────────────────────────\033[0m",
                           "\033[36mDefinitions\033[0m",
                           "\033[36m────────────────────────────────────────────────────\033[0m",
                           "  \033[36mλ  : Non-centrality parameter under alternative\033[0m",
                           "  \033[36mλ₀ : Non-centrality parameter under null\033[0m", ""))

    # ------------------------------------------------------------------------------------------------------------------


    # .print.pwrss.z ---------------------------------------------------------------------------------------------------
    crrAsc <- capture.output(power.z.test(mean = 1.96, alpha = 0.05, alternative = "two.sided", plot = FALSE, verbose = 2))
    expect_equal(crrAsc, c("+--------------------------------------------------+",
                           "|                POWER CALCULATION                 |",
                           "+--------------------------------------------------+", "",
                           "Generic z-Test", "",
                           "----------------------------------------------------",
                           "Hypotheses",
                           "----------------------------------------------------",
                           "  H0 (Null)        : mean  = null.mean",
                           "  H1 (Alternative) : mean != null.mean", "",
                           "----------------------------------------------------",
                           "Key Parameters",
                           "----------------------------------------------------",
                           "  Mean of Alt.   =  1.960",
                           "  Mean of Null   =  0",
                           "  Critical Value = -1.960 and 1.960", "",
                           "----------------------------------------------------",
                           "Results",
                           "----------------------------------------------------",
                           "  Target NCP (mean)    = 1.960 (vs. null.mean = 0)",
                           "  Type 1 Error (alpha) = 0.050",
                           "  Type 2 Error (beta)  = 0.500",
                           "  Statistical Power    = 0.500  <<", "",
                           "----------------------------------------------------",
                           "Definitions",
                           "----------------------------------------------------",
                           "  mean      : Mean of alt.",
                           "  null.mean : Mean of null", ""))

    crrUTF <- capture.output(power.z.test(mean = 1.96, alpha = 0.05, alternative = "two.sided", plot = FALSE, verbose = 2, utf = TRUE))
    expect_equal(crrUTF, c("╔══════════════════════════════════════════════════╗",
                           "║               \033[34m POWER CALCULATION \033[0m                ║",
                           "╚══════════════════════════════════════════════════╝", "",
                           "Generic z-Test", "",
                           "────────────────────────────────────────────────────",
                           "Hypotheses",
                           "────────────────────────────────────────────────────",
                           "  H₀ (Null)        : μ = μ₀",
                           "  H₁ (Alternative) : μ ≠ μ₀", "",
                           "────────────────────────────────────────────────────",
                           "Key Parameters",
                           "────────────────────────────────────────────────────",
                           "  μ           =  1.960",
                           "  μ₀          =  0",
                           "  Z⁻¹(α, μ₀)   = -1.960 and 1.960", "",
                           "────────────────────────────────────────────────────",
                           "Results",
                           "────────────────────────────────────────────────────",
                           "  Target NCP (μ)    = 1.960 (vs. μ₀ = 0)",
                           "  Type 1 Error (α)  = 0.050",
                           "  Type 2 Error (β)  = 0.500",
                           "  \033[34mStatistical Power = 0.500\033[0m  \033[1;35m◄◄\033[0m", "",
                           "\033[36m────────────────────────────────────────────────────\033[0m",
                           "\033[36mDefinitions\033[0m",
                           "\033[36m────────────────────────────────────────────────────\033[0m",
                           "  \033[36mμ  : Mean under alternative\033[0m",
                           "  \033[36mμ₀ : Mean under null\033[0m", ""))
    # ------------------------------------------------------------------------------------------------------------------


    # .print.pwrss.ttest -----------------------------------------------------------------------------------------------
    crrAsc <- capture.output(power.t.student(power = 0.80, n2 = 400, alternative = "two.sided", design = "independent", verbose = 2))
    expect_equal(crrAsc, c("+--------------------------------------------------+",
                           "|      MINIMUM DETECTABLE EFFECT CALCULATION       |",
                           "+--------------------------------------------------+", "",
                           "Student's T-Test (Independent Samples)", "",
                           "----------------------------------------------------",
                           "Hypotheses",
                           "----------------------------------------------------",
                           "  H0 (Null)        : d - null.d  = 0",
                           "  H1 (Alternative) : d - null.d != 0", "",
                           "----------------------------------------------------",
                           "Key Parameters",
                           "----------------------------------------------------",
                           "  Margin                 =  0",
                           "  Degrees of Freedom     =  798",
                           "  Non-centrality of Alt. =  2.805",
                           "  Non-centrality of Null =  0",
                           "  Critical Value         = -1.963 and 1.963", "",
                           "----------------------------------------------------",
                           "Results",
                           "----------------------------------------------------",
                           "  Effect Size (d)      = 0.198 (vs. null.d = 0)  <<",
                           "  Sample Size          = 400 and 400",
                           "  Type 1 Error (alpha) = 0.050",
                           "  Type 2 Error (beta)  = 0.200",
                           "  Statistical Power    = 0.800", "",
                           "----------------------------------------------------",
                           "Definitions",
                           "----------------------------------------------------",
                           "  Margin : Smallest d - null.d difference that matters", ""))

    crrUTF <- capture.output(power.t.student(power = 0.80, n2 = 400, alternative = "two.sided", design = "independent",
                                             verbose = 2, utf = TRUE))
    expect_equal(crrUTF, c("╔══════════════════════════════════════════════════╗",
                           "║     \033[34m MINIMUM DETECTABLE EFFECT CALCULATION \033[0m      ║",
                           "╚══════════════════════════════════════════════════╝", "",
                           "Student's T-Test (Independent Samples)", "",
                           "────────────────────────────────────────────────────",
                           "Hypotheses",
                           "────────────────────────────────────────────────────",
                           "  H₀ (Null)        : d - d₀ = 0",
                           "  H₁ (Alternative) : d - d₀ ≠ 0", "",
                           "────────────────────────────────────────────────────",
                           "Key Parameters",
                           "────────────────────────────────────────────────────",
                           "  δ           =  0",
                           "  df          =  798",
                           "  λ           =  2.805",
                           "  λ₀          =  0",
                           "  T⁻¹(α, λ₀)   = -1.963 and 1.963", "",
                           "────────────────────────────────────────────────────",
                           "Results",
                           "────────────────────────────────────────────────────",
                           "  \033[34mEffect Size (d)    = 0.198 (vs. d₀ = 0)\033[0m  \033[1;35m◄◄\033[0m",
                           "  Sample Size        = 400 and 400",
                           "  Type 1 Error (α)   = 0.050",
                           "  Type 2 Error (β)   = 0.200",
                           "  Statistical Power  = 0.800", "",
                           "\033[36m────────────────────────────────────────────────────\033[0m",
                           "\033[36mDefinitions\033[0m",
                           "\033[36m────────────────────────────────────────────────────\033[0m",
                           "  \033[36md  : Cohen's d under alternative\033[0m",
                           "  \033[36md₀ : Cohen's d under null\033[0m",
                           "  \033[36mδ  : Margin - ignorable d - d₀ difference\033[0m",
                           "  \033[36mλ  : Non-centrality parameter under alternative\033[0m",
                           "  \033[36mλ₀ : Non-centrality parameter under null\033[0m", ""))

    crrAsc <- capture.output(power.t.student(d = 0.20, power = 0.80, alternative = "two.sided", design = "independent", verbose = 2))
    expect_equal(crrAsc, c("+--------------------------------------------------+",
                           "|             SAMPLE SIZE CALCULATION              |",
                           "+--------------------------------------------------+", "",
                           "Student's T-Test (Independent Samples)", "",
                           "----------------------------------------------------",
                           "Hypotheses",
                           "----------------------------------------------------",
                           "  H0 (Null)        : d - null.d  = 0",
                           "  H1 (Alternative) : d - null.d != 0", "",
                           "----------------------------------------------------",
                           "Key Parameters",
                           "----------------------------------------------------",
                           "  Margin                 =  0",
                           "  Degrees of Freedom     =  786",
                           "  Non-centrality of Alt. =  2.807",
                           "  Non-centrality of Null =  0",
                           "  Critical Value         = -1.963 and 1.963", "",
                           "----------------------------------------------------",
                           "Results",
                           "----------------------------------------------------",
                           "  Effect Size (d)      = 0.200 (vs. null.d = 0)",
                           "  Sample Size          = 394 and 394  <<",
                           "  Type 1 Error (alpha) = 0.050",
                           "  Type 2 Error (beta)  = 0.199",
                           "  Statistical Power    = 0.801", "",
                           "----------------------------------------------------",
                           "Definitions",
                           "----------------------------------------------------",
                           "  Margin : Smallest d - null.d difference that matters", ""))

    crrUTF <- capture.output(power.t.student(d = 0.20, power = 0.80, alternative = "two.sided", design = "independent",
                                             verbose = 2, utf = TRUE))
    expect_equal(crrUTF, c("╔══════════════════════════════════════════════════╗",
                           "║           \033[34m SAMPLE SIZE CALCULATION \033[0m              ║",
                           "╚══════════════════════════════════════════════════╝", "",
                           "Student's T-Test (Independent Samples)", "",
                           "────────────────────────────────────────────────────",
                           "Hypotheses",
                           "────────────────────────────────────────────────────",
                           "  H₀ (Null)        : d - d₀ = 0",
                           "  H₁ (Alternative) : d - d₀ ≠ 0", "",
                           "────────────────────────────────────────────────────",
                           "Key Parameters",
                           "────────────────────────────────────────────────────",
                           "  δ           =  0",
                           "  df          =  786",
                           "  λ           =  2.807",
                           "  λ₀          =  0",
                           "  T⁻¹(α, λ₀)   = -1.963 and 1.963", "",
                           "────────────────────────────────────────────────────",
                           "Results",
                           "────────────────────────────────────────────────────",
                           "  Effect Size (d)    = 0.200 (vs. d₀ = 0)",
                           "  \033[34mSample Size        = 394 and 394\033[0m  \033[1;35m◄◄\033[0m",
                           "  Type 1 Error (α)   = 0.050",
                           "  Type 2 Error (β)   = 0.199",
                           "  Statistical Power  = 0.801", "",
                           "\033[36m────────────────────────────────────────────────────\033[0m",
                           "\033[36mDefinitions\033[0m",
                           "\033[36m────────────────────────────────────────────────────\033[0m",
                           "  \033[36md  : Cohen's d under alternative\033[0m",
                           "  \033[36md₀ : Cohen's d under null\033[0m",
                           "  \033[36mδ  : Margin - ignorable d - d₀ difference\033[0m",
                           "  \033[36mλ  : Non-centrality parameter under alternative\033[0m",
                           "  \033[36mλ₀ : Non-centrality parameter under null\033[0m", ""))

    crrAsc <- capture.output(power.t.welch(d = 0.20, n.ratio = 2, var.ratio = 2, n2 = 237, alternative = "two.sided", verbose = 2))
    expect_equal(crrAsc, c("+--------------------------------------------------+",
                           "|                POWER CALCULATION                 |",
                           "+--------------------------------------------------+", "",
                           "Welch's T-Test (Independent Samples)", "",
                           "----------------------------------------------------",
                           "Hypotheses",
                           "----------------------------------------------------",
                           "  H0 (Null)        : d - null.d  = 0",
                           "  H1 (Alternative) : d - null.d != 0", "",
                           "----------------------------------------------------",
                           "Key Parameters",
                           "----------------------------------------------------",
                           "  Margin                 =  0",
                           "  Degrees of Freedom     =  629.777",
                           "  Non-centrality of Alt. =  2.811",
                           "  Non-centrality of Null =  0",
                           "  Critical Value         = -1.964 and 1.964", "",
                           "----------------------------------------------------",
                           "Results",
                           "----------------------------------------------------",
                           "  Effect Size (d)      = 0.200 (vs. null.d = 0)",
                           "  Sample Size          = 474 and 237",
                           "  Type 1 Error (alpha) = 0.050",
                           "  Type 2 Error (beta)  = 0.199",
                           "  Statistical Power    = 0.801  <<", "",
                           "----------------------------------------------------",
                           "Definitions",
                           "----------------------------------------------------",
                           "  Margin : Smallest d - null.d difference that matters", ""))

    crrUTF <- capture.output(power.t.welch(d = 0.20, n.ratio = 2, var.ratio = 2, n2 = 237, alternative = "two.sided",
                                           verbose = 2, utf = TRUE))
    expect_equal(crrUTF, c("╔══════════════════════════════════════════════════╗",
                           "║               \033[34m POWER CALCULATION \033[0m                ║",
                           "╚══════════════════════════════════════════════════╝", "",
                           "Welch's T-Test (Independent Samples)", "",
                           "────────────────────────────────────────────────────",
                           "Hypotheses",
                           "────────────────────────────────────────────────────",
                           "  H₀ (Null)        : d - d₀ = 0",
                           "  H₁ (Alternative) : d - d₀ ≠ 0", "",
                           "────────────────────────────────────────────────────",
                           "Key Parameters",
                           "────────────────────────────────────────────────────",
                           "  δ           =  0",
                           "  df          =  629.777",
                           "  λ           =  2.811",
                           "  λ₀          =  0",
                           "  T⁻¹(α, λ₀)   = -1.964 and 1.964", "",
                           "────────────────────────────────────────────────────",
                           "Results",
                           "────────────────────────────────────────────────────",
                           "  Effect Size (d)    = 0.200 (vs. d₀ = 0)",
                           "  Sample Size        = 474 and 237",
                           "  Type 1 Error (α)   = 0.050",
                           "  Type 2 Error (β)   = 0.199",
                           "  \033[34mStatistical Power  = 0.801\033[0m  \033[1;35m◄◄\033[0m", "",
                           "\033[36m────────────────────────────────────────────────────\033[0m",
                           "\033[36mDefinitions\033[0m",
                           "\033[36m────────────────────────────────────────────────────\033[0m",
                           "  \033[36md  : Cohen's d under alternative\033[0m",
                           "  \033[36md₀ : Cohen's d under null\033[0m",
                           "  \033[36mδ  : Margin - ignorable d - d₀ difference\033[0m",
                           "  \033[36mλ  : Non-centrality parameter under alternative\033[0m",
                           "  \033[36mλ₀ : Non-centrality parameter under null\033[0m", ""))
    # ------------------------------------------------------------------------------------------------------------------


    # .print.pwrss.wilcoxon --------------------------------------------------------------------------------------------
    crrAsc <- capture.output(power.np.wilcoxon(d = 0.25, power = 0.80, verbose = 2))
    expect_equal(crrAsc, c("+--------------------------------------------------+",
                           "|             SAMPLE SIZE CALCULATION              |",
                           "+--------------------------------------------------+", "",
                           "Wilcoxon Rank-Sum Test (Independent Samples) ",
                           "(Wilcoxon-Mann-Whitney or Mann-Whitney U Test)", "",
                           "  Method       : Guenther",
                           "  Distribution : Normal", "",
                           "----------------------------------------------------",
                           "Hypotheses",
                           "----------------------------------------------------",
                           "  H0 (Null)        : d - null.d  = 0",
                           "  H1 (Alternative) : d - null.d != 0", "",
                           "----------------------------------------------------",
                           "Key Parameters",
                           "----------------------------------------------------",
                           "  Margin                 =  0",
                           "  Degrees of Freedom     =  504.113",
                           "  Non-centrality of Alt. =  2.812",
                           "  Non-centrality of Null =  0",
                           "  Critical Value         = -1.965 and 1.965", "",
                           "----------------------------------------------------",
                           "Results",
                           "----------------------------------------------------",
                           "  Effect Size (d)      = 0.250 (vs. null.d = 0)",
                           "  Sample Size          = 265 and 265  <<",
                           "  Type 1 Error (alpha) = 0.050",
                           "  Type 2 Error (beta)  = 0.199",
                           "  Statistical Power    = 0.801", "",
                           "----------------------------------------------------",
                           "Definitions",
                           "----------------------------------------------------",
                           "  Margin : Smallest d - null.d difference that matters", ""))

    crrUTF <- capture.output(power.np.wilcoxon(d = 0.25, power = 0.80, verbose = 2, utf = TRUE))
    expect_equal(crrUTF, c("╔══════════════════════════════════════════════════╗",
                           "║           \033[34m SAMPLE SIZE CALCULATION \033[0m              ║",
                           "╚══════════════════════════════════════════════════╝", "",
                           "Wilcoxon Rank-Sum Test (Independent Samples) ",
                           "(Wilcoxon-Mann-Whitney or Mann-Whitney U Test)", "",
                           "  Method       : Guenther",
                           "  Distribution : Normal", "",
                           "────────────────────────────────────────────────────",
                           "Hypotheses",
                           "────────────────────────────────────────────────────",
                           "  H₀ (Null)        : d - d₀ = 0",
                           "  H₁ (Alternative) : d - d₀ ≠ 0", "",
                           "────────────────────────────────────────────────────",
                           "Key Parameters",
                           "────────────────────────────────────────────────────",
                           "  δ           =  0",
                           "  df          =  504.113",
                           "  λ           =  2.812",
                           "  λ₀          =  0",
                           "  T⁻¹(α, λ₀)   = -1.965 and 1.965", "",
                           "────────────────────────────────────────────────────",
                           "Results",
                           "────────────────────────────────────────────────────",
                           "  Effect Size (d)    = 0.250 (vs. d₀ = 0)",
                           "  \033[34mSample Size        = 265 and 265\033[0m  \033[1;35m◄◄\033[0m",
                           "  Type 1 Error (α)   = 0.050",
                           "  Type 2 Error (β)   = 0.199",
                           "  Statistical Power  = 0.801", "",
                           "\033[36m────────────────────────────────────────────────────\033[0m",
                           "\033[36mDefinitions\033[0m",
                           "\033[36m────────────────────────────────────────────────────\033[0m",
                           "  \033[36md  : Cohen's d under alternative\033[0m",
                           "  \033[36md₀ : Cohen's d under null\033[0m",
                           "  \033[36mδ  : Margin - ignorable d - d₀ difference\033[0m",
                           "  \033[36mλ  : Non-centrality parameter under alternative\033[0m",
                           "  \033[36mλ₀ : Non-centrality parameter under null\033[0m", ""))

    crrAsc <- capture.output(power.np.wilcoxon(d = 0.25, n2 = 265, method = "noether", verbose = 2))
    expect_equal(crrAsc, c("+--------------------------------------------------+",
                           "|                POWER CALCULATION                 |",
                           "+--------------------------------------------------+", "",
                           "Wilcoxon Rank-Sum Test (Independent Samples) ",
                           "(Wilcoxon-Mann-Whitney or Mann-Whitney U Test)", "",
                           "  Method       : Noether",
                           "  Distribution : Normal", "",
                           "----------------------------------------------------",
                           "Hypotheses",
                           "----------------------------------------------------",
                           "  H0 (Null)        : d - null.d  = 0",
                           "  H1 (Alternative) : d - null.d != 0", "",
                           "----------------------------------------------------",
                           "Key Parameters",
                           "----------------------------------------------------",
                           "  Margin         =  0",
                           "  Mean of Alt.   =  2.798",
                           "  Mean of Null   =  0",
                           "  Critical Value = -1.960 and 1.960", "",
                           "----------------------------------------------------",
                           "Results",
                           "----------------------------------------------------",
                           "  Effect Size (d)      = 0.250 (vs. null.d = 0)",
                           "  Sample Size          = 265 and 265",
                           "  Type 1 Error (alpha) = 0.050",
                           "  Type 2 Error (beta)  = 0.201",
                           "  Statistical Power    = 0.799  <<", "",
                           "----------------------------------------------------",
                           "Definitions",
                           "----------------------------------------------------",
                           "  Margin : Smallest d - null.d difference that matters", ""))

    crrUTF <- capture.output(power.np.wilcoxon(d = 0.25, n2 = 265, method = "noether", verbose = 2, utf = TRUE))
    expect_equal(crrUTF, c("╔══════════════════════════════════════════════════╗",
                           "║               \033[34m POWER CALCULATION \033[0m                ║",
                           "╚══════════════════════════════════════════════════╝", "",
                           "Wilcoxon Rank-Sum Test (Independent Samples) ",
                           "(Wilcoxon-Mann-Whitney or Mann-Whitney U Test)", "",
                           "  Method       : Noether",
                           "  Distribution : Normal", "",
                           "────────────────────────────────────────────────────",
                           "Hypotheses",
                           "────────────────────────────────────────────────────",
                           "  H₀ (Null)        : d - d₀ = 0",
                           "  H₁ (Alternative) : d - d₀ ≠ 0", "",
                           "────────────────────────────────────────────────────",
                           "Key Parameters",
                           "────────────────────────────────────────────────────",
                           "  δ           =  0",
                           "  μ           =  2.798",
                           "  μ₀          =  0",
                           "  Z⁻¹(α, μ₀)   = -1.960 and 1.960", "",
                           "────────────────────────────────────────────────────",
                           "Results",
                           "────────────────────────────────────────────────────",
                           "  Effect Size (d)    = 0.250 (vs. d₀ = 0)",
                           "  Sample Size        = 265 and 265",
                           "  Type 1 Error (α)   = 0.050",
                           "  Type 2 Error (β)   = 0.201",
                           "  \033[34mStatistical Power  = 0.799\033[0m  \033[1;35m◄◄\033[0m", "",
                           "\033[36m────────────────────────────────────────────────────\033[0m",
                           "\033[36mDefinitions\033[0m",
                           "\033[36m────────────────────────────────────────────────────\033[0m",
                           "  \033[36md  : Cohen's d under alternative\033[0m",
                           "  \033[36md₀ : Cohen's d under null\033[0m",
                           "  \033[36mδ  : Margin - ignorable d - d₀ difference\033[0m",
                           "  \033[36mμ  : Mean of the alternative distribution\033[0m",
                           "  \033[36mμ₀ : Mean of the null distribution\033[0m", ""))
    # ------------------------------------------------------------------------------------------------------------------


    # .print.pwrss.gof -------------------------------------------------------------------------------------------------
    mtxW <- probs.to.w(cbind(c(0.6759, 0.1559, 0.1281, 0.0323, 0.0078), c(0.6771, 0.1519, 0.1368, 0.0241, 0.0101)), verbose = 0)
    crrAsc <- capture.output(power.chisq.gof(w = mtxW$w, df = mtxW$df, power = 0.80, alpha = 0.05, verbose = 2))
    expect_equal(crrAsc, c("+--------------------------------------------------+",
                           "|             SAMPLE SIZE CALCULATION              |",
                           "+--------------------------------------------------+", "",
                           "Chi-Square Test for Goodness-of-Fit or Independence", "",
                           "----------------------------------------------------",
                           "Hypotheses",
                           "----------------------------------------------------",
                           "  H0 (Null)        : P[i,j]  = P0[i,j] for all (i,j)",
                           "  H1 (Alternative) : P[i,j] != P0[i,j] for some (i,j)", "",
                           "----------------------------------------------------",
                           "Key Parameters",
                           "----------------------------------------------------",
                           "  Degrees of Freedom     = 4",
                           "  Non-centrality of Alt. = 11.935",
                           "  Non-centrality of Null = 0",
                           "  Critical Value         = 9.488", "",
                           "----------------------------------------------------",
                           "Results",
                           "----------------------------------------------------",
                           "  Effect Size (w)      = 0.030",
                           "  Sample Size          = 13069  <<",
                           "  Type 1 Error (alpha) = 0.050",
                           "  Type 2 Error (beta)  = 0.200",
                           "  Statistical Power    = 0.800", "",
                           "----------------------------------------------------",
                           "Definitions",
                           "----------------------------------------------------",
                           "  For goodness-of-fit, comparisons are P[i] vs P0[i]",
                           "  For independence, comparisons are P[i,j] vs P0[i,j]",
                           "  Independence implies (default) P0[i,j] = P[i,.] * P[.,j]", "",
                           "  P[i,j] : Joint probability for cell (i,j)",
                           "  P[i,.] : Marginal probability for row i (sum over j)",
                           "  P[.,j] : Marginal probability for column j (sum over i)", ""))

    crrUTF <- capture.output(power.chisq.gof(w = mtxW$w, df = mtxW$df, power = 0.80, alpha = 0.05, verbose = 2, utf = TRUE))
    expect_equal(crrUTF, c("╔══════════════════════════════════════════════════╗",
                           "║           \033[34m SAMPLE SIZE CALCULATION \033[0m              ║",
                           "╚══════════════════════════════════════════════════╝", "",
                           "Chi-Square Test for Goodness-of-Fit or Independence", "",
                           "────────────────────────────────────────────────────",
                           "Hypotheses",
                           "────────────────────────────────────────────────────",
                           "  H₀ (Null)        : P[i,j] = P₀[i,j] for ∀(i,j)",
                           "  H₁ (Alternative) : P[i,j] ≠ P₀[i,j] for ∃(i,j)", "",
                           "────────────────────────────────────────────────────",
                           "Key Parameters",
                           "────────────────────────────────────────────────────",
                           "  df             = 4",
                           "  λ              = 11.935",
                           "  λ₀             = 0",
                           "  Inv-χ²(α, λ₀)  = 9.488", "",
                           "────────────────────────────────────────────────────",
                           "Results",
                           "────────────────────────────────────────────────────",
                           "  Effect Size (w)    = 0.030",
                           "  \033[34mSample Size        = 13069\033[0m  \033[1;35m◄◄\033[0m",
                           "  Type 1 Error (α)   = 0.050",
                           "  Type 2 Error (β)   = 0.200",
                           "  Statistical Power  = 0.800", "",
                           "\033[36m────────────────────────────────────────────────────\033[0m",
                           "\033[36mDefinitions\033[0m",
                           "\033[36m────────────────────────────────────────────────────\033[0m",
                           "  \033[36mFor goodness-of-fit test, it is P[i] vs P₀[i]\033[0m",
                           "  \033[36mIndependence implies P₀[i,j] = P[i,.] * P[.,j]\033[0m",
                           "  \033[36mP[i,j] : Joint prob. for cell (i,j)\033[0m",
                           "  \033[36mP[i,.] : Marginal prob. for row i (sum over j)\033[0m",
                           "  \033[36mP[.,j] : Marginal prob. for column j (sum over i)\033[0m", "",
                           "  \033[36mλ      : Non-centrality parameter under alternative\033[0m",
                           "  \033[36mλ₀     : Non-centrality parameter under null\033[0m", ""))
    # ------------------------------------------------------------------------------------------------------------------


    # .print.pwrss.oneprop ---------------------------------------------------------------------------------------------
    crrAsc <- capture.output(power.exact.oneprop(prob = 0.45, null.prob = 0.50, alpha = 0.05, n = 500, alternative = "one.sided", verbose = 2))
    expect_equal(crrAsc, c("+--------------------------------------------------+",
                           "|                POWER CALCULATION                 |",
                           "+--------------------------------------------------+", "",
                           "One Proportion", "",
                           "  Method                 : Exact", "",
                           "----------------------------------------------------",
                           "Hypotheses",
                           "----------------------------------------------------",
                           "  H0 (Null)        : prob >= null.prob",
                           "  H1 (Alternative) : prob  < null.prob", "",
                           "----------------------------------------------------",
                           "Key Parameters",
                           "----------------------------------------------------",
                           "  prob - null.prob = -0.050",
                           "  Odds Ratio (OR)  =  0.818",
                           "  Size             =  500",
                           "  Prob. Under Alt  =  0.450",
                           "  Prob. Under Null =  0.500",
                           "  Critical Value   =  231", "",
                           "----------------------------------------------------",
                           "Results",
                           "----------------------------------------------------",
                           "  Target Effect (prob) = 0.450 (vs. null.prob = 0.500)",
                           "  Sample Size          = 500",
                           "  Type 1 Error (alpha) = 0.049",
                           "  Type 2 Error (beta)  = 0.279",
                           "  Statistical Power    = 0.721  <<", "",
                           "----------------------------------------------------",
                           "Definitions",
                           "----------------------------------------------------",
                           "  Odds Ratio      : Odds(prob) / Odds(null.prob)",
                           "  Odds(prob)      : prob / (1 - prob)",
                           "  Odds(null.prob) : null.prob / (1 - null.prob)", ""))

    crrUTF <- capture.output(power.exact.oneprop(prob = 0.45, null.prob = 0.50, alpha = 0.05, n = 500, alternative = "one.sided",
                                                 verbose = 2, utf = TRUE))
    expect_equal(crrUTF, c("╔══════════════════════════════════════════════════╗",
                           "║               \033[34m POWER CALCULATION \033[0m                ║",
                           "╚══════════════════════════════════════════════════╝", "",
                           "One Proportion", "",
                           "  Method                 : Exact", "",
                           "────────────────────────────────────────────────────",
                           "Hypotheses",
                           "────────────────────────────────────────────────────",
                           "  H₀ (Null)        : P ≥ P₀",
                           "  H₁ (Alternative) : P < P₀", "",
                           "────────────────────────────────────────────────────",
                           "Key Parameters",
                           "────────────────────────────────────────────────────",
                           "  P - P₀          = -0.050",
                           "  Odds Ratio (OR) =  0.818",
                           "  Size            =  500",
                           "  P               =  0.450",
                           "  P₀              =  0.500",
                           "  Bin⁻¹(α, P₀)    =  231", "",
                           "────────────────────────────────────────────────────",
                           "Results",
                           "────────────────────────────────────────────────────",
                           "  Target Effect (P)  = 0.450 (vs. P₀ = 0.500)",
                           "  Sample Size        = 500",
                           "  Type 1 Error (α)   = 0.049",
                           "  Type 2 Error (β)   = 0.279",
                           "  \033[34mStatistical Power  = 0.721\033[0m  \033[1;35m◄◄\033[0m", "",
                           "\033[36m────────────────────────────────────────────────────\033[0m",
                           "\033[36mDefinitions\033[0m",
                           "\033[36m────────────────────────────────────────────────────\033[0m",
                           "  \033[36mOR       : Odds(P) / Odds(P₀)\033[0m",
                           "  \033[36mOdds(P)  : P / (1 - P)\033[0m",
                           "  \033[36mOdds(P₀) : P₀ / (1 - P₀)\033[0m",
                           "  \033[36mP        : Probability of success under alternative\033[0m",
                           "  \033[36mP₀       : Probability of success under null\033[0m", ""))

    crrAsc <- capture.output(power.exact.oneprop(prob = 0.45, null.prob = 0.50, alpha = 0.05, power = 0.80, alternative = "one.sided", verbose = 2))
    expect_equal(crrAsc, c("+--------------------------------------------------+",
                           "|             SAMPLE SIZE CALCULATION              |",
                           "+--------------------------------------------------+", "",
                           "One Proportion", "",
                           "  Method                 : Exact", "",
                           "----------------------------------------------------",
                           "Hypotheses",
                           "----------------------------------------------------",
                           "  H0 (Null)        : prob >= null.prob",
                           "  H1 (Alternative) : prob  < null.prob", "",
                           "----------------------------------------------------",
                           "Key Parameters",
                           "----------------------------------------------------",
                           "  prob - null.prob = -0.050",
                           "  Odds Ratio (OR)  =  0.818",
                           "  Size             =  631",
                           "  Prob. Under Alt  =  0.450",
                           "  Prob. Under Null =  0.500",
                           "  Critical Value   =  294", "",
                           "----------------------------------------------------",
                           "Results",
                           "----------------------------------------------------",
                           "  Target Effect (prob) = 0.450 (vs. null.prob = 0.500)",
                           "  Sample Size          = 631  <<",
                           "  Type 1 Error (alpha) = 0.047",
                           "  Type 2 Error (beta)  = 0.199",
                           "  Statistical Power    = 0.801", "",
                           "----------------------------------------------------",
                           "Definitions",
                           "----------------------------------------------------",
                           "  Odds Ratio      : Odds(prob) / Odds(null.prob)",
                           "  Odds(prob)      : prob / (1 - prob)",
                           "  Odds(null.prob) : null.prob / (1 - null.prob)", ""))

    crrUTF <- capture.output(power.exact.oneprop(prob = 0.45, null.prob = 0.50, alpha = 0.05, power = 0.80, alternative = "one.sided",
                                                 verbose = 2, utf = TRUE))
    expect_equal(crrUTF, c("╔══════════════════════════════════════════════════╗",
                           "║           \033[34m SAMPLE SIZE CALCULATION \033[0m              ║",
                           "╚══════════════════════════════════════════════════╝", "",
                           "One Proportion", "",
                           "  Method                 : Exact", "",
                           "────────────────────────────────────────────────────",
                           "Hypotheses",
                           "────────────────────────────────────────────────────",
                           "  H₀ (Null)        : P ≥ P₀",
                           "  H₁ (Alternative) : P < P₀", "",
                           "────────────────────────────────────────────────────",
                           "Key Parameters",
                           "────────────────────────────────────────────────────",
                           "  P - P₀          = -0.050",
                           "  Odds Ratio (OR) =  0.818",
                           "  Size            =  631",
                           "  P               =  0.450",
                           "  P₀              =  0.500",
                           "  Bin⁻¹(α, P₀)    =  294", "",
                           "────────────────────────────────────────────────────",
                           "Results",
                           "────────────────────────────────────────────────────",
                           "  Target Effect (P)  = 0.450 (vs. P₀ = 0.500)",
                           "  \033[34mSample Size        = 631\033[0m  \033[1;35m◄◄\033[0m",
                           "  Type 1 Error (α)   = 0.047",
                           "  Type 2 Error (β)   = 0.199",
                           "  Statistical Power  = 0.801", "",
                           "\033[36m────────────────────────────────────────────────────\033[0m",
                           "\033[36mDefinitions\033[0m",
                           "\033[36m────────────────────────────────────────────────────\033[0m",
                           "  \033[36mOR       : Odds(P) / Odds(P₀)\033[0m",
                           "  \033[36mOdds(P)  : P / (1 - P)\033[0m",
                           "  \033[36mOdds(P₀) : P₀ / (1 - P₀)\033[0m",
                           "  \033[36mP        : Probability of success under alternative\033[0m",
                           "  \033[36mP₀       : Probability of success under null\033[0m", ""))

    crrAsc <- capture.output(power.z.oneprop(prob = 0.45, null.prob = 0.50, alpha = 0.05, n = 500, alternative = "one.sided", verbose = 2))
    expect_equal(crrAsc, c("+--------------------------------------------------+",
                           "|                POWER CALCULATION                 |",
                           "+--------------------------------------------------+", "",
                           "One Proportion", "",
                           "  Method                 : Normal Approximation",
                           "  Continuity Correction  : FALSE",
                           "  Arcsine Transformation : FALSE",
                           "  Standard Error         : Calculated From Null", "",
                           "----------------------------------------------------",
                           "Hypotheses",
                           "----------------------------------------------------",
                           "  H0 (Null)        : prob >= null.prob",
                           "  H1 (Alternative) : prob  < null.prob", "",
                           "----------------------------------------------------",
                           "Key Parameters",
                           "----------------------------------------------------",
                           "  prob - null.prob = -0.050",
                           "  Odds Ratio (OR)  =  0.818",
                           "  Mean of Alt.     = -2.247",
                           "  Mean of Null     =  0",
                           "  Critical Value   = -1.653", "",
                           "----------------------------------------------------",
                           "Results",
                           "----------------------------------------------------",
                           "  Target Effect (prob) = 0.450 (vs. null.prob = 0.500)",
                           "  Sample Size          = 500",
                           "  Type 1 Error (alpha) = 0.050",
                           "  Type 2 Error (beta)  = 0.276",
                           "  Statistical Power    = 0.724  <<", "",
                           "----------------------------------------------------",
                           "Definitions",
                           "----------------------------------------------------",
                           "  Odds Ratio      : Odds(prob) / Odds(null.prob)",
                           "  Odds(prob)      : prob / (1 - prob)",
                           "  Odds(null.prob) : null.prob / (1 - null.prob)", ""))

    crrUTF <- capture.output(power.z.oneprop(prob = 0.45, null.prob = 0.50, alpha = 0.05, n = 500, alternative = "one.sided",
                                             verbose = 2, utf = TRUE))
    expect_equal(crrUTF, c("╔══════════════════════════════════════════════════╗",
                           "║               \033[34m POWER CALCULATION \033[0m                ║",
                           "╚══════════════════════════════════════════════════╝", "",
                           "One Proportion", "",
                           "  Method                 : Normal Approximation",
                           "  Continuity Correction  : FALSE",
                           "  Arcsine Transformation : FALSE",
                           "  Standard Error         : Calculated From Null", "",
                           "────────────────────────────────────────────────────",
                           "Hypotheses",
                           "────────────────────────────────────────────────────",
                           "  H₀ (Null)        : P ≥ P₀",
                           "  H₁ (Alternative) : P < P₀", "",
                           "────────────────────────────────────────────────────",
                           "Key Parameters",
                           "────────────────────────────────────────────────────",
                           "  P - P₀          = -0.050",
                           "  Odds Ratio (OR) =  0.818",
                           "  μ₁              = -2.247",
                           "  μ₀              =  0",
                           "  Z⁻¹(α, μ₀)      = -1.653", "",
                           "────────────────────────────────────────────────────",
                           "Results",
                           "────────────────────────────────────────────────────",
                           "  Target Effect (P)  = 0.450 (vs. P₀ = 0.500)",
                           "  Sample Size        = 500",
                           "  Type 1 Error (α)   = 0.050",
                           "  Type 2 Error (β)   = 0.276",
                           "  \033[34mStatistical Power  = 0.724\033[0m  \033[1;35m◄◄\033[0m", "",
                           "\033[36m────────────────────────────────────────────────────\033[0m",
                           "\033[36mDefinitions\033[0m",
                           "\033[36m────────────────────────────────────────────────────\033[0m",
                           "  \033[36mOR       : Odds(P) / Odds(P₀)\033[0m",
                           "  \033[36mOdds(P)  : P / (1 - P)\033[0m",
                           "  \033[36mOdds(P₀) : P₀ / (1 - P₀)\033[0m",
                           "  \033[36mμ₁       : Mean of the alternative distribution\033[0m",
                           "  \033[36mμ₀       : Mean of the null distribution\033[0m", ""))

    crrAsc <- capture.output(power.z.oneprop(prob = 0.45, null.prob = 0.50, alpha = 0.05, power = 0.80, alternative = "one.sided", verbose = 2))
    expect_equal(crrAsc, c("+--------------------------------------------------+",
                           "|             SAMPLE SIZE CALCULATION              |",
                           "+--------------------------------------------------+", "",
                           "One Proportion", "",
                           "  Method                 : Normal Approximation",
                           "  Continuity Correction  : FALSE",
                           "  Arcsine Transformation : FALSE",
                           "  Standard Error         : Calculated From Null", "",
                           "----------------------------------------------------",
                           "Hypotheses",
                           "----------------------------------------------------",
                           "  H0 (Null)        : prob >= null.prob",
                           "  H1 (Alternative) : prob  < null.prob", "",
                           "----------------------------------------------------",
                           "Key Parameters",
                           "----------------------------------------------------",
                           "  prob - null.prob = -0.050",
                           "  Odds Ratio (OR)  =  0.818",
                           "  Mean of Alt.     = -2.496",
                           "  Mean of Null     =  0",
                           "  Critical Value   = -1.653", "",
                           "----------------------------------------------------",
                           "Results",
                           "----------------------------------------------------",
                           "  Target Effect (prob) = 0.450 (vs. null.prob = 0.500)",
                           "  Sample Size          = 617  <<",
                           "  Type 1 Error (alpha) = 0.050",
                           "  Type 2 Error (beta)  = 0.200",
                           "  Statistical Power    = 0.800", "",
                           "----------------------------------------------------",
                           "Definitions",
                           "----------------------------------------------------",
                           "  Odds Ratio      : Odds(prob) / Odds(null.prob)",
                           "  Odds(prob)      : prob / (1 - prob)",
                           "  Odds(null.prob) : null.prob / (1 - null.prob)", ""))

    crrUTF <- capture.output(power.z.oneprop(prob = 0.45, null.prob = 0.50, alpha = 0.05, power = 0.80, alternative = "one.sided",
                                             verbose = 2, utf = TRUE))
    expect_equal(crrUTF, c("╔══════════════════════════════════════════════════╗",
                           "║           \033[34m SAMPLE SIZE CALCULATION \033[0m              ║",
                           "╚══════════════════════════════════════════════════╝", "",
                           "One Proportion", "",
                           "  Method                 : Normal Approximation",
                           "  Continuity Correction  : FALSE",
                           "  Arcsine Transformation : FALSE",
                           "  Standard Error         : Calculated From Null", "",
                           "────────────────────────────────────────────────────",
                           "Hypotheses",
                           "────────────────────────────────────────────────────",
                           "  H₀ (Null)        : P ≥ P₀",
                           "  H₁ (Alternative) : P < P₀",   "",
                           "────────────────────────────────────────────────────",
                           "Key Parameters",
                           "────────────────────────────────────────────────────",
                           "  P - P₀          = -0.050",
                           "  Odds Ratio (OR) =  0.818",
                           "  μ₁              = -2.496",
                           "  μ₀              =  0",
                           "  Z⁻¹(α, μ₀)      = -1.653", "",
                           "────────────────────────────────────────────────────",
                           "Results",
                           "────────────────────────────────────────────────────",
                           "  Target Effect (P)  = 0.450 (vs. P₀ = 0.500)",
                           "  \033[34mSample Size        = 617\033[0m  \033[1;35m◄◄\033[0m",
                           "  Type 1 Error (α)   = 0.050",
                           "  Type 2 Error (β)   = 0.200",
                           "  Statistical Power  = 0.800", "",
                           "\033[36m────────────────────────────────────────────────────\033[0m",
                           "\033[36mDefinitions\033[0m",
                           "\033[36m────────────────────────────────────────────────────\033[0m",
                           "  \033[36mOR       : Odds(P) / Odds(P₀)\033[0m",
                           "  \033[36mOdds(P)  : P / (1 - P)\033[0m",
                           "  \033[36mOdds(P₀) : P₀ / (1 - P₀)\033[0m",
                           "  \033[36mμ₁       : Mean of the alternative distribution\033[0m",
                           "  \033[36mμ₀       : Mean of the null distribution\033[0m", ""))
    # ------------------------------------------------------------------------------------------------------------------


    # .print.pwrss.fisher ----------------------------------------------------------------------------------------------
    crrAsc <- capture.output(power.exact.fisher(prob1 = 0.60, prob2 = 0.40, n2 = 50, verbose = 2))
    expect_equal(crrAsc, c("+--------------------------------------------------+",
                           "|                POWER CALCULATION                 |",
                           "+--------------------------------------------------+", "",
                           "Independent Proportions", "",
                           "  Method : Fisher's Exact", "",
                           "----------------------------------------------------",
                           "Hypotheses",
                           "----------------------------------------------------",
                           "  H0 (Null)        : prob1 - prob2  = 0",
                           "  H1 (Alternative) : prob1 - prob2 != 0", "",
                           "----------------------------------------------------",
                           "Key Parameters",
                           "----------------------------------------------------",
                           "  prob1 - prob2   = 0.200",
                           "  Odds Ratio (OR) = 2.250", "",
                           "----------------------------------------------------",
                           "Results",
                           "----------------------------------------------------",
                           "  Target Effect (prob1) = 0.600 (vs. prob2 = 0.400)",
                           "  Sample Size           = 50 and 50",
                           "  Type 1 Error (alpha)  = 0.050",
                           "  Type 2 Error (beta)   = 0.538",
                           "  Statistical Power     = 0.462  <<", "",
                           "----------------------------------------------------",
                           "Definitions",
                           "----------------------------------------------------",
                           "  prob1       : Probability of success in the first group",
                           "  prob2       : Probability of success in the second group",
                           "  Odds Ratio  : Odds(prob1) / Odds(prob2)",
                           "  Odds(prob1) : prob1 / (1 - prob1)",
                           "  Odds(prob2) : prob2 / (1 - prob2)", ""))

    crrUTF <- capture.output(power.exact.fisher(prob1 = 0.60, prob2 = 0.40, n2 = 50, verbose = 2, utf = TRUE))
    expect_equal(crrUTF, c("╔══════════════════════════════════════════════════╗",
                           "║               \033[34m POWER CALCULATION \033[0m                ║",
                           "╚══════════════════════════════════════════════════╝", "",
                           "Independent Proportions", "",
                           "  Method : Fisher's Exact", "",
                           "────────────────────────────────────────────────────",
                           "Hypotheses",
                           "────────────────────────────────────────────────────",
                           "  H₀ (Null)        : P₁ - P₂ = 0",
                           "  H₁ (Alternative) : P₁ - P₂ ≠ 0", "",
                           "────────────────────────────────────────────────────",
                           "Key Parameters",
                           "────────────────────────────────────────────────────",
                           "  P₁ - P₂         = 0.200",
                           "  Odds Ratio (OR) = 2.250", "",
                           "────────────────────────────────────────────────────",
                           "Results",
                           "────────────────────────────────────────────────────",
                           "  Target Effect (P₁)  = 0.600 (vs. P₂ = 0.400)",
                           "  Sample Size         = 50 and 50",
                           "  Type 1 Error (α)    = 0.050",
                           "  Type 2 Error (β)    = 0.538",
                           "  \033[34mStatistical Power   = 0.462\033[0m  \033[1;35m◄◄\033[0m", "",
                           "\033[36m────────────────────────────────────────────────────\033[0m",
                           "\033[36mDefinitions\033[0m",
                           "\033[36m────────────────────────────────────────────────────\033[0m",
                           "  \033[36mP₁       : Probability of success in the first group\033[0m",
                           "  \033[36mP₂       : Probability of success in the second group\033[0m",
                           "  \033[36mOR       : Odds(P₁) / Odds(P₂)\033[0m",
                           "  \033[36mOdds(P₁) : P₁ / (1 - P₁)\033[0m",
                           "  \033[36mOdds(P₂) : P₂ / (1 - P₂)\033[0m", ""))

    # NB: one analysis (power.z.twoprops) in proportions.onetwo.R uses .print.pwrss.fisher too -------------------------
    crrAsc <- capture.output(power.exact.twoprops(prob1 = 0.70, prob2 = 0.60, alpha = 0.05, power = 0.80,
                                                  alternative = "one.sided", verbose = 2))
    expect_equal(crrAsc, c("+--------------------------------------------------+",
                           "|             SAMPLE SIZE CALCULATION              |",
                           "+--------------------------------------------------+", "",
                           "Independent Proportions", "",
                           "  Method : Fisher's Exact", "",
                           "----------------------------------------------------",
                           "Hypotheses",
                           "----------------------------------------------------",
                           "  H0 (Null)        : prob1 - prob2 <= 0",
                           "  H1 (Alternative) : prob1 - prob2  > 0", "",
                           "----------------------------------------------------",
                           "Key Parameters",
                           "----------------------------------------------------",
                           "  prob1 - prob2   = 0.100",
                           "  Odds Ratio (OR) = 1.556", "",
                           "----------------------------------------------------",
                           "Results",
                           "----------------------------------------------------",
                           "  Target Effect (prob1) = 0.700 (vs. prob2 = 0.600)",
                           "  Sample Size           = 302 and 302  <<",
                           "  Type 1 Error (alpha)  = 0.050",
                           "  Type 2 Error (beta)   = 0.199",
                           "  Statistical Power     = 0.801", "",
                           "----------------------------------------------------",
                           "Definitions",
                           "----------------------------------------------------",
                           "  prob1       : Probability of success in the first group",
                           "  prob2       : Probability of success in the second group",
                           "  Odds Ratio  : Odds(prob1) / Odds(prob2)",
                           "  Odds(prob1) : prob1 / (1 - prob1)",
                           "  Odds(prob2) : prob2 / (1 - prob2)", ""))

    crrUTF <- capture.output(power.exact.twoprops(prob1 = 0.70, prob2 = 0.60, alpha = 0.05, power = 0.80,
                                                  alternative = "one.sided", verbose = 2, utf = TRUE))
    expect_equal(crrUTF, c("╔══════════════════════════════════════════════════╗",
                           "║           \033[34m SAMPLE SIZE CALCULATION \033[0m              ║",
                           "╚══════════════════════════════════════════════════╝", "",
                           "Independent Proportions", "",
                           "  Method : Fisher's Exact", "",
                           "────────────────────────────────────────────────────",
                           "Hypotheses",
                           "────────────────────────────────────────────────────",
                           "  H₀ (Null)        : P₁ - P₂ ≤ 0",
                           "  H₁ (Alternative) : P₁ - P₂ > 0", "",
                           "────────────────────────────────────────────────────",
                           "Key Parameters",
                           "────────────────────────────────────────────────────",
                           "  P₁ - P₂         = 0.100",
                           "  Odds Ratio (OR) = 1.556", "",
                           "────────────────────────────────────────────────────",
                           "Results",
                           "────────────────────────────────────────────────────",
                           "  Target Effect (P₁)  = 0.700 (vs. P₂ = 0.600)",
                           "  \033[34mSample Size         = 302 and 302\033[0m  \033[1;35m◄◄\033[0m",
                           "  Type 1 Error (α)    = 0.050",
                           "  Type 2 Error (β)    = 0.199",
                           "  Statistical Power   = 0.801", "",
                           "\033[36m────────────────────────────────────────────────────\033[0m",
                           "\033[36mDefinitions\033[0m",
                           "\033[36m────────────────────────────────────────────────────\033[0m",
                           "  \033[36mP₁       : Probability of success in the first group\033[0m",
                           "  \033[36mP₂       : Probability of success in the second group\033[0m",
                           "  \033[36mOR       : Odds(P₁) / Odds(P₂)\033[0m",
                           "  \033[36mOdds(P₁) : P₁ / (1 - P₁)\033[0m",
                           "  \033[36mOdds(P₂) : P₂ / (1 - P₂)\033[0m", ""))

    crrAsc <- capture.output(power.exact.twoprops(prob1 = 0.65, prob2 = 0.60, alpha = 0.05, n2 = 500,
                                                  alternative = "one.sided", verbose = 2))
    expect_equal(crrAsc, c("+--------------------------------------------------+",
                           "|                POWER CALCULATION                 |",
                           "+--------------------------------------------------+", "",
                           "Independent Proportions", "",
                           "  Method : Fisher's Exact", "",
                           "----------------------------------------------------",
                           "Hypotheses",
                           "----------------------------------------------------",
                           "  H0 (Null)        : prob1 - prob2 <= 0",
                           "  H1 (Alternative) : prob1 - prob2  > 0", "",
                           "----------------------------------------------------",
                           "Key Parameters",
                           "----------------------------------------------------",
                           "  prob1 - prob2   = 0.050",
                           "  Odds Ratio (OR) = 1.238", "",
                           "----------------------------------------------------",
                           "Results",
                           "----------------------------------------------------",
                           "  Target Effect (prob1) = 0.650 (vs. prob2 = 0.600)",
                           "  Sample Size           = 500 and 500",
                           "  Type 1 Error (alpha)  = 0.050",
                           "  Type 2 Error (beta)   = 0.533",
                           "  Statistical Power     = 0.467  <<", "",
                           "----------------------------------------------------",
                           "Definitions",
                           "----------------------------------------------------",
                           "  prob1       : Probability of success in the first group",
                           "  prob2       : Probability of success in the second group",
                           "  Odds Ratio  : Odds(prob1) / Odds(prob2)",
                           "  Odds(prob1) : prob1 / (1 - prob1)",
                           "  Odds(prob2) : prob2 / (1 - prob2)", ""))

    crrUTF <- capture.output(power.exact.twoprops(prob1 = 0.65, prob2 = 0.60, alpha = 0.05, n2 = 500,
                                                  alternative = "one.sided", utf = TRUE, verbose = 2))
    expect_equal(crrUTF, c("╔══════════════════════════════════════════════════╗",
                           "║               \033[34m POWER CALCULATION \033[0m                ║",
                           "╚══════════════════════════════════════════════════╝", "",
                           "Independent Proportions", "",
                           "  Method : Fisher's Exact", "",
                           "────────────────────────────────────────────────────",
                           "Hypotheses",
                           "────────────────────────────────────────────────────",
                           "  H₀ (Null)        : P₁ - P₂ ≤ 0",
                           "  H₁ (Alternative) : P₁ - P₂ > 0", "",
                           "────────────────────────────────────────────────────",
                           "Key Parameters",
                           "────────────────────────────────────────────────────",
                           "  P₁ - P₂         = 0.050",
                           "  Odds Ratio (OR) = 1.238", "",
                           "────────────────────────────────────────────────────",
                           "Results",
                           "────────────────────────────────────────────────────",
                           "  Target Effect (P₁)  = 0.650 (vs. P₂ = 0.600)",
                           "  Sample Size         = 500 and 500",
                           "  Type 1 Error (α)    = 0.050",
                           "  Type 2 Error (β)    = 0.533",
                           "  \033[34mStatistical Power   = 0.467\033[0m  \033[1;35m◄◄\033[0m", "",
                           "\033[36m────────────────────────────────────────────────────\033[0m",
                           "\033[36mDefinitions\033[0m",
                           "\033[36m────────────────────────────────────────────────────\033[0m",
                           "  \033[36mP₁       : Probability of success in the first group\033[0m",
                           "  \033[36mP₂       : Probability of success in the second group\033[0m",
                           "  \033[36mOR       : Odds(P₁) / Odds(P₂)\033[0m",
                           "  \033[36mOdds(P₁) : P₁ / (1 - P₁)\033[0m",
                           "  \033[36mOdds(P₂) : P₂ / (1 - P₂)\033[0m", ""))

    crrAsc <- capture.output(power.z.twoprops(prob1 = 0.65, prob2 = 0.60, alpha = 0.05, n2 = 500, alternative = "one.sided", verbose = 2))
    expect_equal(crrAsc, c("+--------------------------------------------------+",
                           "|                POWER CALCULATION                 |",
                           "+--------------------------------------------------+", "",
                           "Independent Proportions", "",
                           "  Method : Normal Approximation", "",
                           "----------------------------------------------------",
                           "Hypotheses",
                           "----------------------------------------------------",
                           "  H0 (Null)        : prob1 - prob2 <= 0",
                           "  H1 (Alternative) : prob1 - prob2  > 0", "",
                           "----------------------------------------------------",
                           "Key Parameters",
                           "----------------------------------------------------",
                           "  prob1 - prob2   = 0.050",
                           "  Odds Ratio (OR) = 1.238",
                           "  Mean of Alt.    = 1.635",
                           "  Mean of Null    = 0",
                           "  Critical Value  = 1.647", "",
                           "----------------------------------------------------",
                           "Results",
                           "----------------------------------------------------",
                           "  Target Effect (prob1) = 0.650 (vs. prob2 = 0.600)",
                           "  Sample Size           = 500 and 500",
                           "  Type 1 Error (alpha)  = 0.050",
                           "  Type 2 Error (beta)   = 0.505",
                           "  Statistical Power     = 0.495  <<", "",
                           "----------------------------------------------------",
                           "Definitions",
                           "----------------------------------------------------",
                           "  prob1       : Probability of success in the first group",
                           "  prob2       : Probability of success in the second group",
                           "  Odds Ratio  : Odds(prob1) / Odds(prob2)",
                           "  Odds(prob1) : prob1 / (1 - prob1)",
                           "  Odds(prob2) : prob2 / (1 - prob2)", ""))

    crrUTF <- capture.output(power.z.twoprops(prob1 = 0.65, prob2 = 0.60, alpha = 0.05, n2 = 500, alternative = "one.sided",
                                              utf = TRUE, verbose = 2))
    expect_equal(crrUTF, c("╔══════════════════════════════════════════════════╗",
                           "║               \033[34m POWER CALCULATION \033[0m                ║",
                           "╚══════════════════════════════════════════════════╝", "",
                           "Independent Proportions", "",
                           "  Method : Normal Approximation", "",
                           "────────────────────────────────────────────────────",
                           "Hypotheses",
                           "────────────────────────────────────────────────────",
                           "  H₀ (Null)        : P₁ - P₂ ≤ 0",
                           "  H₁ (Alternative) : P₁ - P₂ > 0", "",
                           "────────────────────────────────────────────────────",
                           "Key Parameters",
                           "────────────────────────────────────────────────────",
                           "  P₁ - P₂         = 0.050",
                           "  Odds Ratio (OR) = 1.238",
                           "  μ               = 1.635",
                           "  μ₀              = 0",
                           "  Z⁻¹(α, μ₀)      = 1.647", "",
                           "────────────────────────────────────────────────────",
                           "Results",
                           "────────────────────────────────────────────────────",
                           "  Target Effect (P₁)  = 0.650 (vs. P₂ = 0.600)",
                           "  Sample Size         = 500 and 500",
                           "  Type 1 Error (α)    = 0.050",
                           "  Type 2 Error (β)    = 0.505",
                           "  \033[34mStatistical Power   = 0.495\033[0m  \033[1;35m◄◄\033[0m", "",
                           "\033[36m────────────────────────────────────────────────────\033[0m",
                           "\033[36mDefinitions\033[0m",
                           "\033[36m────────────────────────────────────────────────────\033[0m",
                           "  \033[36mP₁       : Probability of success in the first group\033[0m",
                           "  \033[36mP₂       : Probability of success in the second group\033[0m",
                           "  \033[36mOR       : Odds(P₁) / Odds(P₂)\033[0m",
                           "  \033[36mOdds(P₁) : P₁ / (1 - P₁)\033[0m",
                           "  \033[36mOdds(P₂) : P₂ / (1 - P₂)\033[0m",
                           "  \033[36mμ        : Mean of the alternative distribution\033[0m",
                           "  \033[36mμ₀       : Mean of the null distribution\033[0m", ""))

    crrAsc <- capture.output(power.z.twoprops(prob1 = 0.65, prob2 = 0.60, alpha = 0.05, power = 0.80, alternative = "one.sided", verbose = 2))
    expect_equal(crrAsc, c("+--------------------------------------------------+",
                           "|             SAMPLE SIZE CALCULATION              |",
                           "+--------------------------------------------------+", "",
                           "Independent Proportions", "",
                           "  Method : Normal Approximation", "",
                           "----------------------------------------------------",
                           "Hypotheses",
                           "----------------------------------------------------",
                           "  H0 (Null)        : prob1 - prob2 <= 0",
                           "  H1 (Alternative) : prob1 - prob2  > 0", "",
                           "----------------------------------------------------",
                           "Key Parameters",
                           "----------------------------------------------------",
                           "  prob1 - prob2   = 0.050",
                           "  Odds Ratio (OR) = 1.238",
                           "  Mean of Alt.    = 2.490",
                           "  Mean of Null    = 0",
                           "  Critical Value  = 1.647", "",
                           "----------------------------------------------------",
                           "Results",
                           "----------------------------------------------------",
                           "  Target Effect (prob1) = 0.650 (vs. prob2 = 0.600)",
                           "  Sample Size           = 1159 and 1159  <<",
                           "  Type 1 Error (alpha)  = 0.050",
                           "  Type 2 Error (beta)   = 0.200",
                           "  Statistical Power     = 0.800", "",
                           "----------------------------------------------------",
                           "Definitions",
                           "----------------------------------------------------",
                           "  prob1       : Probability of success in the first group",
                           "  prob2       : Probability of success in the second group",
                           "  Odds Ratio  : Odds(prob1) / Odds(prob2)",
                           "  Odds(prob1) : prob1 / (1 - prob1)",
                           "  Odds(prob2) : prob2 / (1 - prob2)", ""))

    crrUTF <- capture.output(power.z.twoprops(prob1 = 0.65, prob2 = 0.60, alpha = 0.05, power = 0.80, alternative = "one.sided",
                                              verbose = 2, utf = TRUE))
    expect_equal(crrUTF, c("╔══════════════════════════════════════════════════╗",
                           "║           \033[34m SAMPLE SIZE CALCULATION \033[0m              ║",
                           "╚══════════════════════════════════════════════════╝", "",
                           "Independent Proportions", "",
                           "  Method : Normal Approximation", "",
                           "────────────────────────────────────────────────────",
                           "Hypotheses",
                           "────────────────────────────────────────────────────",
                           "  H₀ (Null)        : P₁ - P₂ ≤ 0",
                           "  H₁ (Alternative) : P₁ - P₂ > 0", "",
                           "────────────────────────────────────────────────────",
                           "Key Parameters",
                           "────────────────────────────────────────────────────",
                           "  P₁ - P₂         = 0.050",
                           "  Odds Ratio (OR) = 1.238",
                           "  μ               = 2.490",
                           "  μ₀              = 0",
                           "  Z⁻¹(α, μ₀)      = 1.647", "",
                           "────────────────────────────────────────────────────",
                           "Results",
                           "────────────────────────────────────────────────────",
                           "  Target Effect (P₁)  = 0.650 (vs. P₂ = 0.600)",
                           "  \033[34mSample Size         = 1159 and 1159\033[0m  \033[1;35m◄◄\033[0m",
                           "  Type 1 Error (α)    = 0.050",
                           "  Type 2 Error (β)    = 0.200",
                           "  Statistical Power   = 0.800", "",
                           "\033[36m────────────────────────────────────────────────────\033[0m",
                           "\033[36mDefinitions\033[0m",
                           "\033[36m────────────────────────────────────────────────────\033[0m",
                           "  \033[36mP₁       : Probability of success in the first group\033[0m",
                           "  \033[36mP₂       : Probability of success in the second group\033[0m",
                           "  \033[36mOR       : Odds(P₁) / Odds(P₂)\033[0m",
                           "  \033[36mOdds(P₁) : P₁ / (1 - P₁)\033[0m",
                           "  \033[36mOdds(P₂) : P₂ / (1 - P₂)\033[0m",
                           "  \033[36mμ        : Mean of the alternative distribution\033[0m",
                           "  \033[36mμ₀       : Mean of the null distribution\033[0m", ""))
    # ------------------------------------------------------------------------------------------------------------------


    # .print.pwrss.mcnemar ---------------------------------------------------------------------------------------------
    crrAsc <- capture.output(power.exact.mcnemar(prob10 = 0.20, prob01 = 0.10, n.paired = 100, alpha = 0.05, alternative = "two.sided",
                             method = "exact", verbose = 2))
    expect_equal(crrAsc, c("+--------------------------------------------------+",
                           "|                POWER CALCULATION                 |",
                           "+--------------------------------------------------+", "",
                           "Paired Proportions", "",
                           "  Method : McNemar's Exact", "",
                           "----------------------------------------------------",
                           "Hypotheses",
                           "----------------------------------------------------",
                           "  H0 (Null)        : prob10 - prob01  = 0",
                           "  H1 (Alternative) : prob10 - prob01 != 0", "",
                           "----------------------------------------------------",
                           "Key Parameters",
                           "----------------------------------------------------",
                           "  Odds Ratio           = 2",
                           "  prob10 - prob01      = 0.100",
                           "  Size of Disc. Pairs  = 30",
                           "  prob10 | DP for Alt. = 0.667",
                           "  prob10 | DP for Null = 0.500",
                           "  Critical Value       = 9 and 20", "",
                           "----------------------------------------------------",
                           "Results",
                           "----------------------------------------------------",
                           "  Target Effect (prob10) = 0.200 (vs. prob01 = 0.100)",
                           "  Paired Sample Size     = 100",
                           "  Type 1 Error (alpha)   = 0.043",
                           "  Type 2 Error (beta)    = 0.627",
                           "  Statistical Power      = 0.373  <<", "",
                           "----------------------------------------------------",
                           "Definitions",
                           "----------------------------------------------------",
                           "  Odds Ratio  : prob10 / prob01",
                           "  prob10      : Joint prob. of observing {1,0}",
                           "  prob01      : Joint prob. of observing {0,1}",
                           "  prob10 | DP : Conditional prob. of observing {1,0}",
                           "                among DP, prob10 / (prob10 + prob01)",
                           "  DP          : Discordant pairs", ""))

    crrUTF <- capture.output(power.exact.mcnemar(prob10 = 0.20, prob01 = 0.10, n.paired = 100, alpha = 0.05, alternative = "two.sided",
                             method = "exact", verbose = 2, utf = TRUE))
    expect_equal(crrUTF, c("╔══════════════════════════════════════════════════╗",
                           "║               \033[34m POWER CALCULATION \033[0m                ║",
                           "╚══════════════════════════════════════════════════╝", "",
                           "Paired Proportions", "",
                           "  Method : McNemar's Exact", "",
                           "────────────────────────────────────────────────────",
                           "Hypotheses",
                           "────────────────────────────────────────────────────",
                           "  H₀ (Null)        : P₁₀ - P₀₁ = 0",
                           "  H₁ (Alternative) : P₁₀ - P₀₁ ≠ 0", "",
                           "────────────────────────────────────────────────────",
                           "Key Parameters",
                           "────────────────────────────────────────────────────",
                           "  Odds Ratio (OR)   = 2",
                           "  P₁₀ - P₀₁         = 0.100",
                           "  Size (Discordant) = 30",
                           "  P₁                = 0.667",
                           "  P₀                = 0.500",
                           "  Bin⁻¹(α, P₀)       = 9 and 20", "",
                           "────────────────────────────────────────────────────",
                           "Results",
                           "────────────────────────────────────────────────────",
                           "  Target Effect (P₁₀) = 0.200 (vs. P₀₁ = 0.100)",
                           "  Paired Sample Size  = 100",
                           "  Type 1 Error (α)    = 0.043",
                           "  Type 2 Error (β)    = 0.627",
                           "  \033[34mStatistical Power   = 0.373\033[0m  \033[1;35m◄◄\033[0m", "",
                           "\033[36m────────────────────────────────────────────────────\033[0m",
                           "\033[36mDefinitions\033[0m",
                           "\033[36m────────────────────────────────────────────────────\033[0m",
                           "  \033[36mOR : P₁₀ / P₀₁\033[0m",
                           "  \033[36mP₁  : Prob. of {1,0} among discordant pairs under alt.\033[0m",
                           "  \033[36mP₀  : Prob. of {1,0} among discordant pairs under null\033[0m", ""))

    crrAsc <- capture.output(power.exact.mcnemar(prob10 = 0.20, prob01 = 0.10, power = 0.80, alpha = 0.05, alternative = "two.sided",
                             method = "exact", verbose = 2))
    expect_equal(crrAsc, c("+--------------------------------------------------+",
                           "|             SAMPLE SIZE CALCULATION              |",
                           "+--------------------------------------------------+", "",
                           "Paired Proportions", "",
                           "  Method : McNemar's Exact", "",
                           "----------------------------------------------------",
                           "Hypotheses",
                           "----------------------------------------------------",
                           "  H0 (Null)        : prob10 - prob01  = 0",
                           "  H1 (Alternative) : prob10 - prob01 != 0", "",
                           "----------------------------------------------------",
                           "Key Parameters",
                           "----------------------------------------------------",
                           "  Odds Ratio           = 2",
                           "  prob10 - prob01      = 0.100",
                           "  Size of Disc. Pairs  = 75",
                           "  prob10 | DP for Alt. = 0.667",
                           "  prob10 | DP for Null = 0.500",
                           "  Critical Value       = 28 and 46", "",
                           "----------------------------------------------------",
                           "Results",
                           "----------------------------------------------------",
                           "  Target Effect (prob10) = 0.200 (vs. prob01 = 0.100)",
                           "  Paired Sample Size     = 249  <<",
                           "  Type 1 Error (alpha)   = 0.037",
                           "  Type 2 Error (beta)    = 0.199",
                           "  Statistical Power      = 0.801", "",
                           "----------------------------------------------------",
                           "Definitions",
                           "----------------------------------------------------",
                           "  Odds Ratio  : prob10 / prob01",
                           "  prob10      : Joint prob. of observing {1,0}",
                           "  prob01      : Joint prob. of observing {0,1}",
                           "  prob10 | DP : Conditional prob. of observing {1,0}",
                           "                among DP, prob10 / (prob10 + prob01)",
                           "  DP          : Discordant pairs", ""))

    crrUTF <- capture.output(power.exact.mcnemar(prob10 = 0.20, prob01 = 0.10, power = 0.80, alpha = 0.05, alternative = "two.sided",
                             method = "exact", verbose = 2, utf = TRUE))
    expect_equal(crrUTF, c("╔══════════════════════════════════════════════════╗",
                           "║           \033[34m SAMPLE SIZE CALCULATION \033[0m              ║",
                           "╚══════════════════════════════════════════════════╝", "",
                           "Paired Proportions", "",
                           "  Method : McNemar's Exact", "",
                           "────────────────────────────────────────────────────",
                           "Hypotheses",
                           "────────────────────────────────────────────────────",
                           "  H₀ (Null)        : P₁₀ - P₀₁ = 0",
                           "  H₁ (Alternative) : P₁₀ - P₀₁ ≠ 0", "",
                           "────────────────────────────────────────────────────",
                           "Key Parameters",
                           "────────────────────────────────────────────────────",
                           "  Odds Ratio (OR)   = 2",
                           "  P₁₀ - P₀₁         = 0.100",
                           "  Size (Discordant) = 75",
                           "  P₁                = 0.667",
                           "  P₀                = 0.500",
                           "  Bin⁻¹(α, P₀)       = 28 and 46", "",
                           "────────────────────────────────────────────────────",
                           "Results",
                           "────────────────────────────────────────────────────",
                           "  Target Effect (P₁₀) = 0.200 (vs. P₀₁ = 0.100)",
                           "  \033[34mPaired Sample Size  = 249\033[0m  \033[1;35m◄◄\033[0m",
                           "  Type 1 Error (α)    = 0.037",
                           "  Type 2 Error (β)    = 0.199",
                           "  Statistical Power   = 0.801", "",
                           "\033[36m────────────────────────────────────────────────────\033[0m",
                           "\033[36mDefinitions\033[0m",
                           "\033[36m────────────────────────────────────────────────────\033[0m",
                           "  \033[36mOR : P₁₀ / P₀₁\033[0m",
                           "  \033[36mP₁  : Prob. of {1,0} among discordant pairs under alt.\033[0m",
                           "  \033[36mP₀  : Prob. of {1,0} among discordant pairs under null\033[0m", ""))

    crrAsc <- capture.output(power.exact.mcnemar(prob10 = 0.20, prob01 = 0.10, n = 300, alpha = 0.05, alternative = "two.sided",
                             method = "approximate", verbose = 2))
    expect_equal(crrAsc, c("+--------------------------------------------------+",
                           "|                POWER CALCULATION                 |",
                           "+--------------------------------------------------+", "",
                           "Paired Proportions", "",
                           "  Method : Normal Approximation", "",
                           "----------------------------------------------------",
                           "Hypotheses",
                           "----------------------------------------------------",
                           "  H0 (Null)        : prob10 - prob01  = 0",
                           "  H1 (Alternative) : prob10 - prob01 != 0", "",
                           "----------------------------------------------------",
                           "Key Parameters",
                           "----------------------------------------------------",
                           "  Odds Ratio      =  2",
                           "  prob10 - prob01 =  0.100",
                           "  Mean of Alt.    =  3.183",
                           "  Mean of Null    =  0",
                           "  Critical Value  = -1.960 and 1.960", "",
                           "----------------------------------------------------",
                           "Results",
                           "----------------------------------------------------",
                           "  Target Effect (prob10) = 0.200 (vs. prob01 = 0.100)",
                           "  Paired Sample Size     = 300",
                           "  Type 1 Error (alpha)   = 0.050",
                           "  Type 2 Error (beta)    = 0.111",
                           "  Statistical Power      = 0.889  <<", "",
                           "----------------------------------------------------",
                           "Definitions",
                           "----------------------------------------------------",
                           "  Odds Ratio  : prob10 / prob01",
                           "  prob10      : Joint prob. of observing {1,0}",
                           "  prob01      : Joint prob. of observing {0,1}",
                           "  prob10 | DP : Conditional prob. of observing {1,0}",
                           "                among DP, prob10 / (prob10 + prob01)",
                           "  DP          : Discordant pairs", ""))

    crrUTF <- capture.output(power.exact.mcnemar(prob10 = 0.20, prob01 = 0.10, n = 300, alpha = 0.05, alternative = "two.sided",
                             method = "approximate", verbose = 2, utf = TRUE))
    expect_equal(crrUTF, c("╔══════════════════════════════════════════════════╗",
                           "║               \033[34m POWER CALCULATION \033[0m                ║",
                           "╚══════════════════════════════════════════════════╝", "",
                           "Paired Proportions", "",
                           "  Method : Normal Approximation", "",
                           "────────────────────────────────────────────────────",
                           "Hypotheses",
                           "────────────────────────────────────────────────────",
                           "  H₀ (Null)        : P₁₀ - P₀₁ = 0",
                           "  H₁ (Alternative) : P₁₀ - P₀₁ ≠ 0", "",
                           "────────────────────────────────────────────────────",
                           "Key Parameters",
                           "────────────────────────────────────────────────────",
                           "  Odds Ratio (OR) =  2",
                           "  P₁₀ - P₀₁       =  0.100",
                           "  μ₁              =  3.183",
                           "  μ₀              =  0",
                           "  Z⁻¹(α, μ₀)       = -1.960 and 1.960", "",
                           "────────────────────────────────────────────────────",
                           "Results",
                           "────────────────────────────────────────────────────",
                           "  Target Effect (P₁₀) = 0.200 (vs. P₀₁ = 0.100)",
                           "  Paired Sample Size  = 300",
                           "  Type 1 Error (α)    = 0.050",
                           "  Type 2 Error (β)    = 0.111",
                           "  \033[34mStatistical Power   = 0.889\033[0m  \033[1;35m◄◄\033[0m", "",
                           "\033[36m────────────────────────────────────────────────────\033[0m",
                           "\033[36mDefinitions\033[0m",
                           "\033[36m────────────────────────────────────────────────────\033[0m",
                           "  \033[36mOR : P₁₀ / P₀₁\033[0m",
                           "  \033[36mμ₁  : Mean of the alternative distribution\033[0m",
                           "  \033[36mμ₀  : Mean of the null distribution\033[0m", ""))

    crrAsc <- capture.output(power.z.twoprops(prob2 = 0.45, n2 = 100, power = 0.446, paired = TRUE, rho.paired = 0.4141414,
                                              verbose = 2, utf = FALSE))
    expect_equal(crrAsc, c("+--------------------------------------------------+",
                           "|      MINIMUM DETECTABLE EFFECT CALCULATION       |",
                           "+--------------------------------------------------+", "",
                           "Paired Proportions", "",
                           "  Method : Normal Approximation", "",
                           "----------------------------------------------------",
                           "Hypotheses",
                           "----------------------------------------------------",
                           "  H0 (Null)        : prob10 - prob01  = 0",
                           "  H1 (Alternative) : prob10 - prob01 != 0", "",
                           "----------------------------------------------------",
                           "Key Parameters",
                           "----------------------------------------------------",
                           "  Odds Ratio      =  2.001",
                           "  prob10 - prob01 =  0.100",
                           "  Mean of Alt.    =  1.824",
                           "  Mean of Null    =  0",
                           "  Critical Value  = -1.960 and 1.960", "",
                           "----------------------------------------------------",
                           "Results",
                           "----------------------------------------------------",
                           "  Target Effect (prob10) = 0.200 (vs. prob01 = 0.100)  <<",
                           "  Paired Sample Size     = 100",
                           "  Type 1 Error (alpha)   = 0.050",
                           "  Type 2 Error (beta)    = 0.554",
                           "  Statistical Power      = 0.446", "",
                           "----------------------------------------------------",
                           "Definitions",
                           "----------------------------------------------------",
                           "  Odds Ratio  : prob10 / prob01",
                           "  prob10      : Joint prob. of observing {1,0}",
                           "  prob01      : Joint prob. of observing {0,1}",
                           "  prob10 | DP : Conditional prob. of observing {1,0}",
                           "                among DP, prob10 / (prob10 + prob01)",
                           "  DP          : Discordant pairs", ""))

    crrUTF <- capture.output(power.z.twoprops(prob2 = 0.45, n2 = 100, power = 0.446, paired = TRUE, rho.paired = 0.4141414,
                                              verbose = 2, utf = TRUE))
    expect_equal(crrUTF, c("╔══════════════════════════════════════════════════╗",
                           "║     \033[34m MINIMUM DETECTABLE EFFECT CALCULATION \033[0m      ║",
                           "╚══════════════════════════════════════════════════╝", "",
                           "Paired Proportions", "",
                           "  Method : Normal Approximation", "",
                           "────────────────────────────────────────────────────",
                           "Hypotheses",
                           "────────────────────────────────────────────────────",
                           "  H₀ (Null)        : P₁₀ - P₀₁ = 0",
                           "  H₁ (Alternative) : P₁₀ - P₀₁ ≠ 0", "",
                           "────────────────────────────────────────────────────",
                           "Key Parameters",
                           "────────────────────────────────────────────────────",
                           "  Odds Ratio (OR) =  2.001",
                           "  P₁₀ - P₀₁       =  0.100",
                           "  μ₁              =  1.824",
                           "  μ₀              =  0",
                           "  Z⁻¹(α, μ₀)       = -1.960 and 1.960", "",
                           "────────────────────────────────────────────────────",
                           "Results",
                           "────────────────────────────────────────────────────",
                           "  \033[34mTarget Effect (P₁₀) = 0.200 (vs. P₀₁ = 0.100)\033[0m  \033[1;35m◄◄\033[0m",
                           "  Paired Sample Size  = 100",
                           "  Type 1 Error (α)    = 0.050",
                           "  Type 2 Error (β)    = 0.554",
                           "  Statistical Power   = 0.446", "",
                           "\033[36m────────────────────────────────────────────────────\033[0m",
                           "\033[36mDefinitions\033[0m",
                           "\033[36m────────────────────────────────────────────────────\033[0m",
                           "  \033[36mOR : P₁₀ / P₀₁\033[0m",
                           "  \033[36mμ₁  : Mean of the alternative distribution\033[0m",
                           "  \033[36mμ₀  : Mean of the null distribution\033[0m", ""))
    # ------------------------------------------------------------------------------------------------------------------


    # .print.pwrss.f.regression ----------------------------------------------------------------------------------------
    crrAsc <- capture.output(power.f.regression(r.squared = 0.15, k.total = 3, power = 0.80, verbose = 2))
    expect_equal(crrAsc, c("+--------------------------------------------------+",
                           "|             SAMPLE SIZE CALCULATION              |",
                           "+--------------------------------------------------+", "",
                           "Linear Regression (F-Test)", "",
                           "----------------------------------------------------",
                           "Hypotheses",
                           "----------------------------------------------------",
                           "  H0 (Null)        : R-squared = 0",
                           "  H1 (Alternative) : R-squared > 0", "",
                           "----------------------------------------------------",
                           "Key Parameters",
                           "----------------------------------------------------",
                           "  R-squared              = 0.150",
                           "  Margin                 = 0",
                           "  Num. Deg. of Freedom   = 3",
                           "  Denom. Deg. of Freedom = 62",
                           "  Non-centrality of Alt. = 11.647",
                           "  Non-centrality of Null = 0",
                           "  Critical Value         = 2.753", "",
                           "----------------------------------------------------",
                           "Results",
                           "----------------------------------------------------",
                           "  Effect Size (R-squared) = 0.150",
                           "  Sample Size             = 66  <<",
                           "  Type 1 Error (alpha)    = 0.050",
                           "  Type 2 Error (beta)     = 0.199",
                           "  Statistical Power       = 0.801", "",
                           "----------------------------------------------------",
                           "Definitions",
                           "----------------------------------------------------",
                           "  Margin : Smallest R-squared that matters", ""))

    crrUTF <- capture.output(power.f.regression(r.squared = 0.15, k.total = 3, power = 0.80, verbose = 2, utf = TRUE))
    expect_equal(crrUTF, c("╔══════════════════════════════════════════════════╗",
                           "║           \033[34m SAMPLE SIZE CALCULATION \033[0m              ║",
                           "╚══════════════════════════════════════════════════╝", "",
                           "Linear Regression (F-Test)", "",
                           "────────────────────────────────────────────────────",
                           "Hypotheses",
                           "────────────────────────────────────────────────────",
                           "  H₀ (Null)        : R² = 0",
                           "  H₁ (Alternative) : R² > 0", "",
                           "────────────────────────────────────────────────────",
                           "Key Parameters",
                           "────────────────────────────────────────────────────",
                           "  R²          = 0.150",
                           "  δ           = 0",
                           "  df1         = 3",
                           "  df2         = 62",
                           "  λ           = 11.647",
                           "  λ₀          = 0",
                           "  F⁻¹(α, λ₀)   = 2.753", "",
                           "────────────────────────────────────────────────────",
                           "Results",
                           "────────────────────────────────────────────────────",
                           "  Effect Size (R²)  = 0.150",
                           "  \033[34mSample Size       = 66\033[0m  \033[1;35m◄◄\033[0m",
                           "  Type 1 Error (α)  = 0.050",
                           "  Type 2 Error (β)  = 0.199",
                           "  Statistical Power = 0.801", "",
                           "\033[36m────────────────────────────────────────────────────\033[0m",
                           "\033[36mDefinitions\033[0m",
                           "\033[36m────────────────────────────────────────────────────\033[0m",
                           "  \033[36mδ  : Margin - ignorable R² or ΔR²\033[0m",
                           "  \033[36mλ  : Non-centrality parameter under alternative\033[0m",
                           "  \033[36mλ₀ : Non-centrality parameter under null\033[0m", ""))

    # ------------------------------------------------------------------------------------------------------------------


    # .print.pwrss.t.regression ----------------------------------------------------------------------------------------
    crrAsc <- capture.output(power.t.regression(beta = 0.20, k.total = 5, r.squared = 0.30, power = 0.80, verbose = 2))
    expect_equal(crrAsc, c("+--------------------------------------------------+",
                           "|             SAMPLE SIZE CALCULATION              |",
                           "+--------------------------------------------------+", "",
                           "Linear Regression Coefficient (T-Test)", "",
                           "----------------------------------------------------",
                           "Hypotheses",
                           "----------------------------------------------------",
                           "  H0 (Null)        : beta - null.beta  = 0",
                           "  H1 (Alternative) : beta - null.beta != 0", "",
                           "----------------------------------------------------",
                           "Key Parameters",
                           "----------------------------------------------------",
                           "  Std. Beta Under Alt.   =  0.200",
                           "  Std. Beta Under Null   =  0",
                           "  Std. Margin            =  0",
                           "  Degrees of Freedom     =  134",
                           "  Non-centrality of Alt. =  2.828",
                           "  Non-centrality of Null =  0",
                           "  Critical Value         = -1.978 and 1.978", "",
                           "----------------------------------------------------",
                           "Results",
                           "----------------------------------------------------",
                           "  Target Effect (Std. beta) = 0.200",
                           "  Sample Size               = 140  <<",
                           "  Type 1 Error (alpha)      = 0.050",
                           "  Type 2 Error (beta)       = 0.198",
                           "  Statistical Power         = 0.802", "",
                           "----------------------------------------------------",
                           "Definitions",
                           "----------------------------------------------------",
                           "  beta                 : Regression coefficient under alt.",
                           "  null.beta            : Regression coefficient under null",
                           "  margin               : Smallest beta - null.beta difference that matters", "",
                           "  Std. Beta Under Alt. = beta * [SD(X) / SD(Y)]",
                           "  Std. Beta Under Null = null.beta * [SD(X) / SD(Y)]",
                           "  Std. Margin          = margin * [SD(X) / SD(Y)]", "",
                           "  SD(X)                : Standard deviation of the predictor",
                           "  SD(Y)                : Standard deviation of the outcome", ""))

    crrUTF <- capture.output(power.t.regression(beta = 0.20, k.total = 5, r.squared = 0.30, power = 0.80, verbose = 2, utf = TRUE))
    expect_equal(crrUTF, c("╔══════════════════════════════════════════════════╗",
                           "║           \033[34m SAMPLE SIZE CALCULATION \033[0m              ║",
                           "╚══════════════════════════════════════════════════╝", "",
                           "Linear Regression Coefficient (T-Test)", "",
                           "────────────────────────────────────────────────────",
                           "Hypotheses",
                           "────────────────────────────────────────────────────",
                           "  H₀ (Null)        : β - β₀ = 0",
                           "  H₁ (Alternative) : β - β₀ ≠ 0", "",
                           "────────────────────────────────────────────────────",
                           "Key Parameters",
                           "────────────────────────────────────────────────────",
                           "  Std. β          =  0.200",
                           "  Std. β₀         =  0",
                           "  Std. δ          =  0",
                           "  df              =  134",
                           "  λ (Alternative) =  2.828",
                           "  λ₀ (Null)       =  0",
                           "  T⁻¹(α, λ₀)       = -1.978 and 1.978", "",
                           "────────────────────────────────────────────────────",
                           "Results",
                           "────────────────────────────────────────────────────",
                           "  Target Effect (Std. β) = 0.200",
                           "  \033[34mSample Size            = 140\033[0m  \033[1;35m◄◄\033[0m",
                           "  Type 1 Error (α)       = 0.050",
                           "  Type 2 Error (β)       = 0.198",
                           "  Statistical Power      = 0.802", "",
                           "\033[36m────────────────────────────────────────────────────\033[0m",
                           "\033[36mDefinitions\033[0m",
                           "\033[36m────────────────────────────────────────────────────\033[0m",
                           "  \033[36mβ       : Regression coefficient under alternative\033[0m",
                           "  \033[36mβ₀      : Regression coefficient under null\033[0m",
                           "  \033[36mδ       : Margin(s) - ignorable β - β₀ difference\033[0m", "",
                           "  \033[36mStd. β  = β  * [σ(X) / σ(Y)]\033[0m",
                           "  \033[36mStd. β₀ = β₀ * [σ(X) / σ(Y)]\033[0m",
                           "  \033[36mStd. δ  = δ  * [σ(X) / σ(Y)]\033[0m", "",
                           "  \033[36mσ(X)    : Standard devition of the predictor\033[0m",
                           "  \033[36mσ(Y)    : Standard devition of the outcome\033[0m", "",
                           "  \033[36mλ       : Non-centrality parameter under alternative\033[0m",
                           "  \033[36mλ₀      : Non-centrality parameter under null\033[0m", ""))

    crrAsc <- capture.output(power.t.regression(beta = 0, margin = c(-0.05, 0.05), alternative = "two.one.sided",
                                                sd.predictor = 0.5, k.total = 5, r.squared = 0.30, n = 9593,
                                                verbose = 2))
    expect_equal(crrAsc, c("+--------------------------------------------------+",
                           "|                POWER CALCULATION                 |",
                           "+--------------------------------------------------+", "",
                           "Linear Regression Coefficient (T-Test)", "",
                           "----------------------------------------------------",
                           "Hypotheses",
                           "----------------------------------------------------",
                           "  H0 (Null)        : beta - null.beta <= min(margin) or",
                           "                     beta - null.beta >= max(margin)",
                           "  H1 (Alternative) : beta - null.beta  > min(margin) and",
                           "                     beta - null.beta  < max(margin)", "",
                           "----------------------------------------------------",
                           "Key Parameters",
                           "----------------------------------------------------",
                           "  Std. Beta Under Alt.   =  0",
                           "  Std. Beta Under Null   =  0",
                           "  Std. Margin            = -0.025 and 0.025",
                           "  Degrees of Freedom     =  9587",
                           "  Non-centrality of Alt. =  0",
                           "  Non-centrality of Null = -2.927 and 2.927",
                           "  Critical Value         = -1.282 and 1.282", "",
                           "----------------------------------------------------",
                           "Results",
                           "----------------------------------------------------",
                           "  Target Effect (Std. beta) = 0",
                           "  Sample Size               = 9593",
                           "  Type 1 Error (alpha)      = 0.050",
                           "  Type 2 Error (beta)       = 0.200",
                           "  Statistical Power         = 0.800  <<", "",
                           "----------------------------------------------------",
                           "Definitions",
                           "----------------------------------------------------",
                           "  beta                 : Regression coefficient under alt.",
                           "  null.beta            : Regression coefficient under null",
                           "  margin               : Smallest beta - null.beta difference that matters", "",
                           "  Std. Beta Under Alt. = beta * [SD(X) / SD(Y)]",
                           "  Std. Beta Under Null = null.beta * [SD(X) / SD(Y)]",
                           "  Std. Margin          = margin * [SD(X) / SD(Y)]", "",
                           "  SD(X)                : Standard deviation of the predictor",
                           "  SD(Y)                : Standard deviation of the outcome", ""))

    crrUTF <- capture.output(power.t.regression(beta = 0, margin = c(-0.05, 0.05), alternative = "two.one.sided",
                                                sd.predictor = 0.5, k.total = 5, r.squared = 0.30, n = 9593,
                                                verbose = 2, utf = TRUE))
    expect_equal(crrUTF, c("╔══════════════════════════════════════════════════╗",
                           "║               \033[34m POWER CALCULATION \033[0m                ║",
                           "╚══════════════════════════════════════════════════╝", "",
                           "Linear Regression Coefficient (T-Test)", "",
                           "────────────────────────────────────────────────────",
                           "Hypotheses",
                           "────────────────────────────────────────────────────",
                           "  H₀ (Null)        : β - β₀ ≤ min(δ) ∪ β - β₀ ≥ max(δ)",
                           "  H₁ (Alternative) : min(δ) < β - β₀ < max(δ)", "",
                           "────────────────────────────────────────────────────",
                           "Key Parameters",
                           "────────────────────────────────────────────────────",
                           "  Std. β          =  0",
                           "  Std. β₀         =  0",
                           "  Std. δ          = -0.025 and 0.025",
                           "  df              =  9587",
                           "  λ (Alternative) =  0",
                           "  λ₀ (Null)       = -2.927 and 2.927",
                           "  T⁻¹(α, λ₀)       = -1.282 and 1.282", "",
                           "────────────────────────────────────────────────────",
                           "Results",
                           "────────────────────────────────────────────────────",
                           "  Target Effect (Std. β) = 0",
                           "  Sample Size            = 9593",
                           "  Type 1 Error (α)       = 0.050",
                           "  Type 2 Error (β)       = 0.200",
                           "  \033[34mStatistical Power      = 0.800\033[0m  \033[1;35m◄◄\033[0m", "",
                           "\033[36m────────────────────────────────────────────────────\033[0m",
                           "\033[36mDefinitions\033[0m",
                           "\033[36m────────────────────────────────────────────────────\033[0m",
                           "  \033[36mβ       : Regression coefficient under alternative\033[0m",
                           "  \033[36mβ₀      : Regression coefficient under null\033[0m",
                           "  \033[36mδ       : Margin(s) - ignorable β - β₀ difference\033[0m", "",
                           "  \033[36mStd. β  = β  * [σ(X) / σ(Y)]\033[0m",
                           "  \033[36mStd. β₀ = β₀ * [σ(X) / σ(Y)]\033[0m",
                           "  \033[36mStd. δ  = δ  * [σ(X) / σ(Y)]\033[0m", "",
                           "  \033[36mσ(X)    : Standard devition of the predictor\033[0m",
                           "  \033[36mσ(Y)    : Standard devition of the outcome\033[0m", "",
                           "  \033[36mλ       : Non-centrality parameter under alternative\033[0m",
                           "  \033[36mλ₀      : Non-centrality parameter under null\033[0m", ""))

    crrAsc <- capture.output(power.t.regression(beta = 0, margin = c(-0.05, 0.05), alternative = "two.one.sided",
                                                sd.predictor = 0.5, k.total = 5, r.squared = 0.30, power = 0.80))
    expect_equal(crrAsc[10:13], c("  H0 (Null)        : beta - null.beta <= min(margin) or",
                                  "                     beta - null.beta >= max(margin)",
                                  "  H1 (Alternative) : beta - null.beta  > min(margin) and",
                                  "                     beta - null.beta  < max(margin)"))

    crrUTF <- capture.output(power.t.regression(beta = 0, margin = c(-0.05, 0.05), alternative = "two.one.sided",
                                                sd.predictor = 0.5, k.total = 5, r.squared = 0.30, power = 0.80, utf = TRUE))
    expect_equal(crrUTF[10:11], c("  H₀ (Null)        : β - β₀ ≤ min(δ) ∪ β - β₀ ≥ max(δ)",
                                  "  H₁ (Alternative) : min(δ) < β - β₀ < max(δ)"))

    crrAsc <- capture.output(power.t.regression(beta = 0, margin = c(0.05, 0.10), alternative = "two.one.sided",
                                                sd.predictor = 0.5, k.total = 5, r.squared = 0.30, power = 0.80))
    expect_equal(crrAsc[10:13], c("  H0 (Null)        : beta - null.beta >= min(margin) and",
                                  "                     beta - null.beta <= max(margin)",
                                  "  H1 (Alternative) : beta - null.beta  < min(margin) or",
                                  "                     beta - null.beta  > max(margin)"))

    crrUTF <- capture.output(power.t.regression(beta = 0, margin = c(0.05, 0.10), alternative = "two.one.sided",
                                                sd.predictor = 0.5, k.total = 5, r.squared = 0.30, power = 0.80, utf = TRUE))
    expect_equal(crrUTF[10:11], c("  H₀ (Null)        : min(δ) ≤ β - β₀ ≤ max(δ)",
                                  "  H₁ (Alternative) : β - β₀ < min(δ) ∪ β - β₀ > max(δ)"))

    # ------------------------------------------------------------------------------------------------------------------


    # .print.pwrss.logistic --------------------------------------------------------------------------------------------
    crrAsc <- capture.output(power.z.logistic(base.prob = 0.15, prob = 0.20, alpha = 0.05, power = 0.80, distribution = "normal", verbose = 2))
    expect_equal(crrAsc, c("+--------------------------------------------------+",
                           "|             SAMPLE SIZE CALCULATION              |",
                           "+--------------------------------------------------+", "",
                           "Logistic Regression Coefficient (Wald's Z-Test)", "",
                           "  Method          : Demidenko (Variance Corrected)",
                           "  Predictor Dist. : Normal", "",
                           "----------------------------------------------------",
                           "Hypotheses",
                           "----------------------------------------------------",
                           "  H0 (Null)        : Odds Ratio (OR)  = 1",
                           "  H1 (Alternative) : Odds Ratio (OR) != 1", "",
                           "----------------------------------------------------",
                           "Key Parameters",
                           "----------------------------------------------------",
                           "  Base Probability   =  0.150",
                           "  Odds Ratio (OR)    =  1.417",
                           "  Var. Corr. Factor  =  1",
                           "  Mean (Alternative) =  2.784",
                           "  SD (Alternative)   =  0.976",
                           "  Mean (Null)        =  0",
                           "  SD (Null)          =  1",
                           "  Critical Value     = -1.960 and 1.960", "",
                           "----------------------------------------------------",
                           "Results",
                           "----------------------------------------------------",
                           "  Effect Size (Odds Ratio) = 1.417",
                           "  Sample Size              = 511  <<",
                           "  Type 1 Error (alpha)     = 0.050",
                           "  Type 2 Error (beta)      = 0.199",
                           "  Statistical Power        = 0.801", "",
                           "----------------------------------------------------",
                           "Definitions",
                           "----------------------------------------------------",
                           "  Odds Ratio = [prob/(1-prob)] / [base.prob/(1-base.prob)]",
                           "  prob       : Base probability when predictor = 0",
                           "  base.prob  : Probability when predictor = 1",
                           "  beta1      = log(Odds Ratio)",
                           "  beta0      = log[base.prob/(1-base.prob)]", ""))

    crrUTF <- capture.output(power.z.logistic(base.prob = 0.15, prob = 0.20, alpha = 0.05, power = 0.80, distribution = "normal",
                                              verbose = 2, utf = TRUE))
    expect_equal(crrUTF, c("╔══════════════════════════════════════════════════╗",
                           "║           \033[34m SAMPLE SIZE CALCULATION \033[0m              ║",
                           "╚══════════════════════════════════════════════════╝", "",
                           "Logistic Regression Coefficient (Wald's Z-Test)", "",
                           "  Method          : Demidenko (Variance Corrected)",
                           "  Predictor Dist. : Normal", "",
                           "────────────────────────────────────────────────────",
                           "Hypotheses",
                           "────────────────────────────────────────────────────",
                           "  H₀ (Null)        : Odds Ratio (OR) = 1",
                           "  H₁ (Alternative) : Odds Ratio (OR) ≠ 1", "",
                           "────────────────────────────────────────────────────",
                           "Key Parameters",
                           "────────────────────────────────────────────────────",
                           "  Base Probability  =  0.150",
                           "  Odds Ratio (OR)   =  1.417",
                           "  Var. Corr. Factor =  1",
                           "  μ (Alternative)   =  2.784",
                           "  σ (Alternative)   =  0.976",
                           "  μ₀ (Null)         =  0",
                           "  σ₀ (Null)         =  1",
                           "  Z⁻¹(α, μ₀, σ₀)    = -1.960 and 1.960", "",
                           "────────────────────────────────────────────────────",
                           "Results",
                           "────────────────────────────────────────────────────",
                           "  Effect Size (Odds Ratio) = 1.417",
                           "  \033[34mSample Size              = 511\033[0m  \033[1;35m◄◄\033[0m",
                           "  Type 1 Error (α)         = 0.050",
                           "  Type 2 Error (β)         = 0.199",
                           "  Statistical Power        = 0.801", "",
                           "\033[36m────────────────────────────────────────────────────\033[0m",
                           "\033[36mDefinitions\033[0m",
                           "\033[36m────────────────────────────────────────────────────\033[0m",
                           "  \033[36mOR = [p / (1 − p)] / [p₀ / (1 − p₀)]\033[0m",
                           "  \033[36mp₀  : Base probability when predictor = 0\033[0m",
                           "  \033[36mp  : Probability when predictor = 1\033[0m",
                           "  \033[36mβ₁  = log(OR)\033[0m",
                           "  \033[36mβ₀  = log[p₀ / (1 − p₀)]\033[0m",
                           "  \033[36mμ  : Mean\033[0m",
                           "  \033[36mσ  : Standard deviation\033[0m", ""))
    # ------------------------------------------------------------------------------------------------------------------


    # .print.pwrss.med -------------------------------------------------------------------------------------------------
    crrAsc <- capture.output(power.z.mediation(beta.a = 0.25, beta.b = 0.25, beta.cp = 0.10, power = 0.80, verbose = 2))
    expect_equal(crrAsc, c("+--------------------------------------------------+",
                           "|             SAMPLE SIZE CALCULATION              |",
                           "+--------------------------------------------------+", "",
                           "Indirect Effect in a Mediation Model", "",
                           "  Method : Sobel", "",
                           "----------------------------------------------------",
                           "Hypotheses",
                           "----------------------------------------------------",
                           "  H0 (Null)        : beta[a*b]  = 0",
                           "  H1 (Alternative) : beta[a*b] != 0", "",
                           "----------------------------------------------------",
                           "Key Parameters",
                           "----------------------------------------------------",
                           "  Std. beta[a]   =  0.250",
                           "  Std. beta[b]   =  0.250",
                           "  Std. beta[a*b] =  0.062",
                           "  Mean of Alt.   =  2.802",
                           "  Mean of Null.  =  0",
                           "  Critical Value = -1.960 and 1.960", "",
                           "----------------------------------------------------",
                           "Results",
                           "----------------------------------------------------",
                           "  Sample Size          = 242  <<",
                           "  Type 1 Error (alpha) = 0.050",
                           "  Type 2 Error (beta)  = 0.200",
                           "  Statistical Power    = 0.800", "",
                           "----------------------------------------------------",
                           "Definitions",
                           "----------------------------------------------------",
                           "  beta[a]        : Regression coefficient for path `a`",
                           "  beta[b]        : Regression coefficient for path `b`",
                           "  beta[a*b]      : Coefficient for the indirect path `a*b`", "",
                           "  Std. beta[a]   = beta[a] * [SD(predictor) / SD(mediator)]",
                           "  Std. beta[b]   = beta[b] * [SD(mediator) / SD(outcome)]",
                           "  Std. beta[a*b] = Std. beta[a] * Std. beta[b]", "",
                           "  SD(predictor)  : Standard deviation of the predictor",
                           "  SD(mediator)   : Standard deviation of the mediator",
                           "  SD(outcome)    : Standard deviation of the outcome", ""))

    crrUTF <- capture.output(power.z.mediation(beta.a = 0.25, beta.b = 0.25, beta.cp = 0.10, power = 0.80, verbose = 2, utf = TRUE))
    expect_equal(crrUTF, c("╔══════════════════════════════════════════════════╗",
                           "║           \033[34m SAMPLE SIZE CALCULATION \033[0m              ║",
                           "╚══════════════════════════════════════════════════╝", "",
                           "Indirect Effect in a Mediation Model", "",
                           "  Method : Sobel", "",
                           "────────────────────────────────────────────────────",
                           "Hypotheses",
                           "────────────────────────────────────────────────────",
                           "  H₀ (Null)        : β[a*b] = 0",
                           "  H₁ (Alternative) : β[a*b] ≠ 0", "",
                           "────────────────────────────────────────────────────",
                           "Key Parameters",
                           "────────────────────────────────────────────────────",
                           "  Std. β[a]       =  0.250",
                           "  Std. β[b]       =  0.250",
                           "  Std. β[a*b]     =  0.062",
                           "  μ (Alternative) =  2.802",
                           "  μ₀ (Null)       =  0",
                           "  Z⁻¹(α, μ₀)       = -1.960 and 1.960", "",
                           "────────────────────────────────────────────────────",
                           "Results",
                           "────────────────────────────────────────────────────",
                           "  \033[34mSample Size       = 242\033[0m  \033[1;35m◄◄\033[0m",
                           "  Type 1 Error (α)  = 0.050",
                           "  Type 2 Error (β)  = 0.200",
                           "  Statistical Power = 0.800", "",
                           "\033[36m────────────────────────────────────────────────────\033[0m",
                           "\033[36mDefinitions\033[0m",
                           "\033[36m────────────────────────────────────────────────────\033[0m",
                           "  \033[36mβ[a]         : Regression coefficient for path `a`\033[0m",
                           "  \033[36mβ[b]         : Regression coefficient for path `b`\033[0m",
                           "  \033[36mβ[a*b]       : Coefficient for the indirect path `a*b`\033[0m", "",
                           "  \033[36mStd. β[a]    = β[a] * [σ(predictor) / σ(mediator)]\033[0m",
                           "  \033[36mStd. β[b]    = β[b] * [σ(mediator) / σ(outcome)]\033[0m",
                           "  \033[36mStd. β[a*b]  = Std. β[a] * Std. β[b]\033[0m", "",
                           "  \033[36mσ(predictor) : Standard devition of the predictor\033[0m",
                           "  \033[36mσ(mediator)  : Standard devition of the mediator\033[0m",
                           "  \033[36mσ(outcome)   : Standard devition of the outcome\033[0m", "",
                           "  \033[36mμ            : Mean of the alternative distribution\033[0m",
                           "  \033[36mμ₀           : Mean of the null distribution\033[0m", ""))

    set.seed(1)
    crrAsc <- capture.output(power.z.mediation(beta.a = 0.25, beta.b = 0.25, beta.cp = 0.10, n = 200, method = "monte.carlo", verbose = 2))
    expect_equal(crrAsc, c("+--------------------------------------------------+",
                           "|                POWER CALCULATION                 |",
                           "+--------------------------------------------------+", "",
                           "Indirect Effect in a Mediation Model", "",
                           "  Method : Monte Carlo", "",
                           "----------------------------------------------------",
                           "Hypotheses",
                           "----------------------------------------------------",
                           "  H0 (Null)        : beta[a*b]  = 0",
                           "  H1 (Alternative) : beta[a*b] != 0", "",
                           "----------------------------------------------------",
                           "Key Parameters",
                           "----------------------------------------------------",
                           "  Std. beta[a]   = 0.250",
                           "  Std. beta[b]   = 0.250",
                           "  Std. beta[a*b] = 0.062", "",
                           "----------------------------------------------------",
                           "Results",
                           "----------------------------------------------------",
                           "  Sample Size          = 200",
                           "  Type 1 Error (alpha) = 0.050",
                           "  Type 2 Error (beta)  = 0.096",
                           "  Statistical Power    = 0.904  <<", "",
                           "----------------------------------------------------",
                           "Definitions",
                           "----------------------------------------------------",
                           "  beta[a]        : Regression coefficient for path `a`",
                           "  beta[b]        : Regression coefficient for path `b`",
                           "  beta[a*b]      : Coefficient for the indirect path `a*b`", "",
                           "  Std. beta[a]   = beta[a] * [SD(predictor) / SD(mediator)]",
                           "  Std. beta[b]   = beta[b] * [SD(mediator) / SD(outcome)]",
                           "  Std. beta[a*b] = Std. beta[a] * Std. beta[b]", "",
                           "  SD(predictor)  : Standard deviation of the predictor",
                           "  SD(mediator)   : Standard deviation of the mediator",
                           "  SD(outcome)    : Standard deviation of the outcome", ""))

    crrUTF <- capture.output(power.z.mediation(beta.a = 0.25, beta.b = 0.25, beta.cp = 0.10, n = 200, method = "joint",
                             verbose = 2, utf = TRUE))
    expect_equal(crrUTF, c("╔══════════════════════════════════════════════════╗",
                           "║               \033[34m POWER CALCULATION \033[0m                ║",
                           "╚══════════════════════════════════════════════════╝", "",
                           "Indirect Effect in a Mediation Model", "",
                           "  Method : Joint", "",
                           "────────────────────────────────────────────────────",
                           "Hypotheses",
                           "────────────────────────────────────────────────────",
                           "  H₀ (Null)        : β[a*b] = 0",
                           "  H₁ (Alternative) : β[a*b] ≠ 0", "",
                           "────────────────────────────────────────────────────",
                           "Key Parameters",
                           "────────────────────────────────────────────────────",
                           "  Std. β[a]   = 0.250",
                           "  Std. β[b]   = 0.250",
                           "  Std. β[a*b] = 0.062", "",
                           "────────────────────────────────────────────────────",
                           "Results",
                           "────────────────────────────────────────────────────",
                           "  Sample Size       = 200",
                           "  Type 1 Error (α)  = 0.050",
                           "  Type 2 Error (β)  = 0.098",
                           "  \033[34mStatistical Power = 0.902\033[0m  \033[1;35m◄◄\033[0m", "",
                           "\033[36m────────────────────────────────────────────────────\033[0m",
                           "\033[36mDefinitions\033[0m",
                           "\033[36m────────────────────────────────────────────────────\033[0m",
                           "  \033[36mβ[a]         : Regression coefficient for path `a`\033[0m",
                           "  \033[36mβ[b]         : Regression coefficient for path `b`\033[0m",
                           "  \033[36mβ[a*b]       : Coefficient for the indirect path `a*b`\033[0m", "",
                           "  \033[36mStd. β[a]    = β[a] * [σ(predictor) / σ(mediator)]\033[0m",
                           "  \033[36mStd. β[b]    = β[b] * [σ(mediator) / σ(outcome)]\033[0m",
                           "  \033[36mStd. β[a*b]  = Std. β[a] * Std. β[b]\033[0m", "",
                           "  \033[36mσ(predictor) : Standard devition of the predictor\033[0m",
                           "  \033[36mσ(mediator)  : Standard devition of the mediator\033[0m",
                           "  \033[36mσ(outcome)   : Standard devition of the outcome\033[0m", ""))
    # ------------------------------------------------------------------------------------------------------------------


    # .print.pwrss.poisson ---------------------------------------------------------------------------------------------
    crrAsc <- capture.output(power.z.poisson(beta0 = 0.50, beta1 = -0.10, alpha = 0.05, power = 0.80, dist = "normal", verbose = 2))
    expect_equal(crrAsc, c("+--------------------------------------------------+",
                           "|             SAMPLE SIZE CALCULATION              |",
                           "+--------------------------------------------------+", "",
                           "Poisson Regression Coefficient (Wald's Z-Test)", "",
                           "  Method          : Demidenko (Variance Corrected)",
                           "  Predictor Dist. : Normal", "",
                           "----------------------------------------------------",
                           "Hypotheses",
                           "----------------------------------------------------",
                           "  H0 (Null)        : Rate Ratio (RR)  = 1",
                           "  H1 (Alternative) : Rate Ratio (RR) != 1", "",
                           "----------------------------------------------------",
                           "Key Parameters",
                           "----------------------------------------------------",
                           "  Base Rate          =  1.649",
                           "  Rate Ratio (RR)    =  0.905",
                           "  Var. Corr. Factor  =  1",
                           "  Mean (Alternative) = -2.803",
                           "  SD (Alternative)   =  1.000",
                           "  Mean (Null)        =  0",
                           "  SD (Null)          =  1",
                           "  Critical Value     = -1.960 and 1.960", "",
                           "----------------------------------------------------",
                           "Results",
                           "----------------------------------------------------",
                           "  Effect Size (Rate Ratio) = 0.905",
                           "  Sample Size              = 474  <<",
                           "  Type 1 Error (alpha)     = 0.050",
                           "  Type 2 Error (beta)      = 0.200",
                           "  Statistical Power        = 0.800", "",
                           "----------------------------------------------------",
                           "Definitions",
                           "----------------------------------------------------",
                           "  Base Rate       = exp(beta0)",
                           "  Rate Ratio (RR) = exp(beta1)", ""))

    crrUTF <- capture.output(power.z.poisson(beta0 = 0.50, beta1 = -0.10, alpha = 0.05, power = 0.80, dist = "normal",
                                             verbose = 2, utf = TRUE))
    expect_equal(crrUTF, c("╔══════════════════════════════════════════════════╗",
                           "║           \033[34m SAMPLE SIZE CALCULATION \033[0m              ║",
                           "╚══════════════════════════════════════════════════╝", "",
                           "Poisson Regression Coefficient (Wald's Z-Test)", "",
                           "  Method          : Demidenko (Variance Corrected)",
                           "  Predictor Dist. : Normal", "",
                           "────────────────────────────────────────────────────",
                           "Hypotheses",
                           "────────────────────────────────────────────────────",
                           "  H₀ (Null)        : Rate Ratio (RR) = 1",
                           "  H₁ (Alternative) : Rate Ratio (RR) ≠ 1", "",
                           "────────────────────────────────────────────────────",
                           "Key Parameters",
                           "────────────────────────────────────────────────────",
                           "  Base Rate         =  1.649",
                           "  Rate Ratio (RR)   =  0.905",
                           "  Var. Corr. Factor =  1",
                           "  μ (Alternative)   = -2.803",
                           "  σ (Alternative)   =  1.000",
                           "  μ₀ (Null)         =  0",
                           "  σ₀ (Null)         =  1",
                           "  Z⁻¹(α, μ₀, σ₀)    = -1.960 and 1.960", "",
                           "────────────────────────────────────────────────────",
                           "Results",
                           "────────────────────────────────────────────────────",
                           "  Effect Size (Rate Ratio) = 0.905",
                           "  \033[34mSample Size              = 474\033[0m  \033[1;35m◄◄\033[0m",
                           "  Type 1 Error (α)         = 0.050",
                           "  Type 2 Error (β)         = 0.200",
                           "  Statistical Power        = 0.800", "",
                           "\033[36m────────────────────────────────────────────────────\033[0m",
                           "\033[36mDefinitions\033[0m",
                           "\033[36m────────────────────────────────────────────────────\033[0m",
                           "  \033[36mBase Rate       = exp(β₀)\033[0m",
                           "  \033[36mRate Ratio (RR) = exp(β₁)\033[0m",
                           "  \033[36mμ               : Mean\033[0m",
                           "  \033[36mσ               : Standard deviation\033[0m", ""))

    crrAsc <- capture.output(power.z.poisson(beta0 = 0.50, beta1 = -0.10, alpha = 0.05, n = 474, dist = "normal", verbose = 2))
    expect_equal(crrAsc, c("+--------------------------------------------------+",
                           "|                POWER CALCULATION                 |",
                           "+--------------------------------------------------+", "",
                           "Poisson Regression Coefficient (Wald's Z-Test)", "",
                           "  Method          : Demidenko (Variance Corrected)",
                           "  Predictor Dist. : Normal", "",
                           "----------------------------------------------------",
                           "Hypotheses",
                           "----------------------------------------------------",
                           "  H0 (Null)        : Rate Ratio (RR)  = 1",
                           "  H1 (Alternative) : Rate Ratio (RR) != 1", "",
                           "----------------------------------------------------",
                           "Key Parameters",
                           "----------------------------------------------------",
                           "  Base Rate          =  1.649",
                           "  Rate Ratio (RR)    =  0.905",
                           "  Var. Corr. Factor  =  1",
                           "  Mean (Alternative) = -2.803",
                           "  SD (Alternative)   =  1.000",
                           "  Mean (Null)        =  0",
                           "  SD (Null)          =  1",
                           "  Critical Value     = -1.960 and 1.960", "",
                           "----------------------------------------------------",
                           "Results",
                           "----------------------------------------------------",
                           "  Effect Size (Rate Ratio) = 0.905",
                           "  Sample Size              = 474",
                           "  Type 1 Error (alpha)     = 0.050",
                           "  Type 2 Error (beta)      = 0.200",
                           "  Statistical Power        = 0.800  <<", "",
                           "----------------------------------------------------",
                           "Definitions",
                           "----------------------------------------------------",
                           "  Base Rate       = exp(beta0)",
                           "  Rate Ratio (RR) = exp(beta1)", ""))

    crrUTF <- capture.output(power.z.poisson(beta0 = 0.50, beta1 = -0.10, alpha = 0.05, n = 474, dist = "normal",
                                             verbose = 2, utf = TRUE))
    expect_equal(crrUTF, c("╔══════════════════════════════════════════════════╗",
                           "║               \033[34m POWER CALCULATION \033[0m                ║",
                           "╚══════════════════════════════════════════════════╝", "",
                           "Poisson Regression Coefficient (Wald's Z-Test)", "",
                           "  Method          : Demidenko (Variance Corrected)",
                           "  Predictor Dist. : Normal", "",
                           "────────────────────────────────────────────────────",
                           "Hypotheses",
                           "────────────────────────────────────────────────────",
                           "  H₀ (Null)        : Rate Ratio (RR) = 1",
                           "  H₁ (Alternative) : Rate Ratio (RR) ≠ 1", "",
                           "────────────────────────────────────────────────────",
                           "Key Parameters",
                           "────────────────────────────────────────────────────",
                           "  Base Rate         =  1.649",
                           "  Rate Ratio (RR)   =  0.905",
                           "  Var. Corr. Factor =  1",
                           "  μ (Alternative)   = -2.803",
                           "  σ (Alternative)   =  1.000",
                           "  μ₀ (Null)         =  0",
                           "  σ₀ (Null)         =  1",
                           "  Z⁻¹(α, μ₀, σ₀)    = -1.960 and 1.960", "",
                           "────────────────────────────────────────────────────",
                           "Results",
                           "────────────────────────────────────────────────────",
                           "  Effect Size (Rate Ratio) = 0.905",
                           "  Sample Size              = 474",
                           "  Type 1 Error (α)         = 0.050",
                           "  Type 2 Error (β)         = 0.200",
                           "  \033[34mStatistical Power        = 0.800\033[0m  \033[1;35m◄◄\033[0m", "",
                           "\033[36m────────────────────────────────────────────────────\033[0m",
                           "\033[36mDefinitions\033[0m",
                           "\033[36m────────────────────────────────────────────────────\033[0m",
                           "  \033[36mBase Rate       = exp(β₀)\033[0m",
                           "  \033[36mRate Ratio (RR) = exp(β₁)\033[0m",
                           "  \033[36mμ               : Mean\033[0m",
                           "  \033[36mσ               : Standard deviation\033[0m", ""))
    # ------------------------------------------------------------------------------------------------------------------

    expect_error(capture.output(.print.pwrss.ttest(list(requested = "n", alternative = "two.sided", d = 1, d = 1))),
                 "`print.obj` contains more than one effect size.")
})

Try the pwrss package in your browser

Any scripts or data that you put into this service are public.

pwrss documentation built on Oct. 14, 2026, 9:06 a.m.