Planning sample size with the SSA framework

The idea

A study is adequate when four requirements hold at the same time, all of them for the parameters that carry the study’s claims (the focal parameters):

Criterion Requirement
Detectability power of the focal Wald tests is at least π
Precision the 95% confidence interval width is at most δ (in expectation, or with assurance γ)
Stability the absolute relative bias is at most τ
Feasibility the rate of admissible (converged, Heywood-free) solutions is at least κ

The minimum adequate sample size N* is the largest of the four criterion-specific requirements. The criterion that attains this maximum is the bottleneck. ssadequacy predicts the bottleneck analytically and then verifies it by simulation.

The power–precision crossover

Let r = δ/|θ| be the target interval width relative to the effect size. Under unit-information asymptotics, the precision requirement divided by the power requirement equals (r*/r)², where

ssa_crossover()              # alpha = .05, power = .80
#> [1] 1.399182
ssa_crossover(power = .90)
#> [1] 1.209289

Precision binds whenever r < r*. This ordering does not depend on the method, the model size, or the distribution of the data.

Regression and ANOVA

d_reg <- ssa_design_regression(k = 3, R2 = .10, rho = .30)
ssa_analytic(d_reg, delta = .25)
#> <ssa_analytic> Regression k = 3, R2 = 0.10, normal 
#>   r = delta/|theta| = 1.732   crossover r* = 1.399  -> Detectability binds between power and precision
#>   N required by Detectability      396
#>   N required by Precision          260
#>   N* (analytic) = 396, binding criterion: Detectability

The focal parameters are the standardized coefficients. Their 80% power requirement (about 400) is much larger than that of the omnibus test of R² (about 100). Planning with the omnibus test would therefore understate the sample needed for coefficient-level claims.

d_aov <- ssa_design_anova(k = 2, f = .25)          # d = .50
ssa_analytic(d_aov, delta = .50, assurance = .80)
#> <ssa_analytic> ANOVA k = 2, f = 0.25, normal 
#>   r = delta/|theta| = 1.000   crossover r* = 1.399  -> Precision binds between power and precision
#>   N required by Detectability      128
#>   N required by Precision          267
#>   N* (analytic) = 267, binding criterion: Precision

Confirmatory factor analysis

d_cfa <- ssa_design_cfa(nfactors = 3, nind = 5, loadings = c(.35, .40))
ssa_analytic(d_cfa, delta = .20)
#> <ssa_analytic> CFA 3F x 5, lambda 0.35-0.40, normal 
#>   r = delta/|theta| = 0.533   crossover r* = 1.399  -> Precision binds between power and precision
#>   N required by Detectability      117
#>   N required by Precision          798
#>   N required by Feasibility        152
#>   N* (analytic) = 798, binding criterion: Precision
#>   Feasibility uses a calibrated weak-identification law (see ?ssa_feasibility); verify with ssa_simulate().
ssa_feasibility(d_cfa, N = c(100, 150, 200))
#> [1] 0.7919673 0.9477927 0.9812836

For weak loadings, admissible solutions are rare at N = 100. The calibrated scaling law places the feasibility floor near N = 150. Precision is nevertheless the bottleneck at δ = .20.

Planning from a fitted model

The planning population can be taken from a pilot or published solution:

fit <- lavaan::cfa("visual  =~ x1 + x2 + x3
                    textual =~ x4 + x5 + x6
                    speed   =~ x7 + x8 + x9",
                   data = lavaan::HolzingerSwineford1939, std.lv = TRUE)
d_hs <- ssa_design_from_lavaan(fit)
a_hs <- ssa_analytic(d_hs, delta = .20, assurance = .80, se_cv = 1)
a_hs
#> <ssa_analytic> CFA from fitted model (3 factors x 3), lambda 0.42-0.86, normal 
#>   r = delta/|theta| = 0.287   crossover r* = 1.399  -> Precision binds between power and precision
#>   N required by Detectability       15
#>   N required by Precision          245
#>   N required by Feasibility         65
#>   N* (analytic) = 245, binding criterion: Precision
#>   Feasibility uses a calibrated weak-identification law (see ?ssa_feasibility); verify with ssa_simulate().

Verifying by simulation

ssa_simulate() simulates the design on a grid centred on the analytic N*, solves each criterion with theory-based smoothing, and re-simulates at the solution. The call below takes several minutes and is therefore not run here:

s_hs <- ssa_simulate(d_hs, delta = .20, assurance = .80, reps = 1000, cores = 4)
s_hs

For this model the simulation gave N* = 243 (analytic: 245), with precision as the binding criterion. At N* the assurance was .80 and power was 1.00.

Reporting

ssa_report(a_hs)
#> Sample size was planned with the Sample Size Adequacy (SSA) framework (Ergen<U+00E7> <U+00D6>zda<U+015F>, in
#> preparation) for CFA from fitted model (3 factors x 3), lambda 0.42-0.86, normal. The
#> focal parameters were the standardized factor loadings (mean |theta| = 0.698). We
#> required power of at least 0.80 for two-sided Wald tests (alpha = 0.05) of each focal
#> parameter, an expected 95% confidence interval width of at most 0.200 with assurance
#> 0.80. Under unit-information asymptotics these requirements imply N = 15 for
#> detectability and N = 245 for precision; because the ratio of the target width to the
#> effect size (r = 0.29) is below the crossover value r* = 1.40, precision is the binding
#> criterion and the minimum adequate sample size is N* = 245. Because admissibility of
#> latent variable solutions is not governed by regular asymptotics, this value should be
#> verified by simulation (ssa_simulate()).

Interactive use

run_ssa_app() opens a Shiny planner that runs the analytic analysis, draws the crossover plot, and runs the simulation on demand.