| efa_power | R Documentation |
Analyses power for exploratory factor analysis, in one of two modes chosen with
mode.
mode = "rmsea" (the default) gives the analytic power of the root mean square
error of approximation (RMSEA) tests of close and not-close fit (MacCallum,
Browne, & Sugawara, 1996). Give a sample size to get the power of the test, or
give a target power to get the sample size needed to reach it.
mode = "simulation" runs a Monte-Carlo study: it draws n_datasets samples from
a known population (via efa_simulate()), analyses each one, and reports how well
the analysis recovers that population. See Details for what is reported.
Here the number of variables is p and the number of factors is k (elsewhere in
the package: n_vars and n_factors).
efa_power(
mode = c("rmsea", "simulation"),
type = c("close", "notclose"),
eps0 = NULL,
eps1 = NULL,
N = NULL,
p = NULL,
k = NULL,
df = NULL,
alpha = 0.05,
power = NULL,
group = 1,
Lambda = NULL,
Phi = NULL,
Psi = NULL,
R = NULL,
n_datasets = 500,
criteria = c("EKC", "MAP"),
estimator = "PAF",
rotation = NULL,
recovery_threshold = 0.95,
model_error = c("TKL", "CB", "WB", "none"),
target_rmsea = NULL,
target_cfi = NULL,
seed = NULL
)
mode |
character. The kind of power analysis: |
type |
character. The RMSEA test: |
eps0 |
numeric. The null-hypothesis RMSEA. Default is |
eps1 |
numeric. The alternative-hypothesis RMSEA (the true RMSEA power is
evaluated at). Default is |
N |
numeric. In |
p |
numeric. The number of observed variables. In |
k |
numeric. The number of factors. In |
df |
numeric. The model degrees of freedom. Either supply |
alpha |
numeric. The significance level. Default is |
power |
numeric. The target power. Give |
group |
numeric. The number of groups. Default is |
Lambda |
matrix. Simulation mode. A |
Phi |
matrix. Simulation mode. The |
Psi |
numeric or matrix. Simulation mode. The population unique variances (a
length- |
R |
matrix. Simulation mode. A |
n_datasets |
numeric. Simulation mode. The number of samples to draw and
analyse. Default is |
criteria |
character. Simulation mode. The factor-retention criteria to
evaluate the hit-rate for, any of |
estimator |
character. Simulation mode. The estimator ( |
rotation |
character. Simulation mode. The rotation for the recovery fit,
passed to |
recovery_threshold |
numeric. Simulation mode. The matched-factor Tucker
congruence a replicate must reach to count as recovered. Default is |
model_error |
character. Simulation mode. The |
target_rmsea |
numeric. Simulation mode. The population RMSEA the model should
have relative to the perturbed population, activating model error. Default is
|
target_cfi |
numeric. Simulation mode. The population CFI target (only with
|
seed |
numeric. Simulation mode. Optional seed making the draws and analysis
reproducible and worker-count independent; the caller's random-number stream is
restored afterwards. Default is |
An object of class efa_power. For mode = "rmsea", a list containing:
power |
The power of the test at |
N |
The total sample size across groups: the supplied |
N_per_group |
The per-group sample size |
crit |
The critical chi-square value the fit statistic is compared against. |
ncp |
The noncentrality parameters under the null ( |
solve_for |
|
settings |
A list of the inputs: |
For mode = "simulation", a list containing:
hit_rate |
A named numeric vector of the retention hit-rate per criterion (and,
where a criterion has several variants, per variant); |
hits |
A data frame with one row per criterion ( |
recovery |
For a factor-model population, a list with the structure-recovery
rates ( |
convergence |
A list with the number of datasets ( |
replicates |
The raw per-replicate values: the suggested factor counts
( |
k_true |
The true number of factors. |
model_error |
The |
settings |
A list of the simulation inputs. |
Power rises with a larger sample, a larger model (more degrees of freedom), and a bigger gap between the null and alternative RMSEA (MacCallum, Browne, & Sugawara, 1996).
Two tests are supported, chosen with type (never by the order of eps0 and
eps1):
"close"Tests close fit (MacCallum et al., 1996). The null
hypothesis is that the fit is close (RMSEA \le eps0; conventionally
0.05). Power is the chance of detecting a worse alternative (eps1;
conventionally 0.08, so eps0 < eps1), in the upper tail.
"notclose"Tests not-close fit. The null hypothesis is that the fit
is not close (RMSEA \ge eps0). Power is the chance of detecting a
better alternative (eps1; conventionally 0.01, so eps0 > eps1), in the
lower tail.
When eps0 and eps1 are in the wrong order for the chosen type, a message is
shown but the requested test still runs. Equal eps0 and eps1 leave nothing to
detect and are an error.
Power always increases with N, so the required sample size (the smallest N
reaching power) is found by bisection. N is the total sample size across
groups: with group > 1 the power calculation divides by group (the
1 / group factor), so spreading a fixed total over more groups gives less
power. The matching per-group sample size, N / group, is returned as
N_per_group.
The 1 / group factor makes all group groups the same size, so a required
total is rounded up to the next multiple of group. A solved N_per_group is thus
a whole number of persons, and the reported power is the power at a total that a
study can collect. With group = 2 and df = 102, for example, the required total
is 260, or 130 per group. Bisection on the total alone gives 259, which asks for
129.5 persons in each group.
The population is passed to efa_simulate(), which draws n_datasets samples of
size N from it. The population's true number of factors, k_true, is
ncol(Lambda) for a factor-model population, or k for a bare R. By default
the population fits the factor model exactly, which overstates how well the
criteria and the fit recover its structure; setting a misfit target makes the
population more realistic (MacCallum, 2003).
Each replicate is analysed three ways:
The share of replicates where a criterion's suggested factor
count (from criteria) matches k_true. A replicate where the criterion
errored or gave no answer is left out of this count – it does not count as a
miss.
The k_true-factor
model is fitted with efa_fit(), its loadings are matched to the population
loadings, and the matched-factor Tucker congruences (Lorenzo-Seva & ten Berge,
2006) are compared with recovery_threshold. A replicate succeeds when its
smallest (min) or average (mean) matched congruence reaches the
threshold.
Among the replicates whose fit completed, the share that converged and the share that produced a Heywood case.
A replicate whose fit fails completely is not counted in any of the three measures above. If any fit fails, a warning reports how many failed and the cause of the first failure.
Replicates are analysed in parallel with future.apply; choose a parallel
plan with future::plan(). Each replicate uses its own reproducible
random-number stream, so with a fixed seed the result does not depend on the
number of workers, and the caller's random-number state is left unchanged.
MacCallum, R. C., Browne, M. W., & Sugawara, H. M. (1996). Power analysis and determination of sample size for covariance structure modeling. Psychological Methods, 1(2), 130-149. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1037/1082-989X.1.2.130")}
MacCallum, R. C. (2003). 2001 Presidential Address: Working with imperfect models. Multivariate Behavioral Research, 38(1), 113-139. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1207/S15327906MBR3801_5")}
Lorenzo-Seva, U., & ten Berge, J. M. F. (2006). Tucker's congruence coefficient as a meaningful index of factor similarity. Methodology, 2(2), 57-64. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1027/1614-2241.2.2.57")}
efa_simulate() draws the replicate datasets used in simulation mode.
efa_retain() implements the retention criteria whose hit-rates simulation
mode reports.
Other power analysis:
plot.efa_power(),
print.efa_power()
# Power of the test of close fit at N = 200 for a 100-df model
efa_power(df = 100, N = 200)
# Deriving df from the model dimensions instead of giving it directly
efa_power(p = 20, k = 3, N = 200)
# Required total sample size for 80% power
efa_power(df = 100, power = 0.80)
# Test of not-close fit
efa_power(df = 100, N = 200, type = "notclose")
# Simulation mode: retention hit-rate and structure recovery for a known
# three-factor population at N = 300
efa_power("simulation", Lambda = population_models$loadings$baseline,
Phi = population_models$phis_3$moderate, N = 300,
n_datasets = 50, criteria = c("EKC", "MAP"), seed = 42)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.