The function that initializes the search process. The powerNLSEM
function actually is a wrapper function for power_search
.
power_search(
POI,
method,
lavModel,
lavModel_Analysis,
data_transformations,
search_method,
power_modeling_method,
R = 1000,
power_aim = 0.8,
alpha = 0.05,
alpha_power_modeling = 0.05,
CORES,
verbose,
Ns = NULL,
N_start = nrow(lavModel[lavModel$op != "~1", ]) * 10,
distRj = "increasing",
steps = 10,
nlb = nrow(lavModel[lavModel$op != "~1", ]) * 5,
switchStep = round(steps/2),
FSmethod = "SL",
test = "onesided",
matchPI = TRUE,
PIcentering = "doubleMC",
liberalInspection = FALSE,
constrainRelChange = TRUE,
seeds,
pathLMS = tempdir()
)
Returns a list
that includes the results on model-implied simulation-based power estimation.
Parameter Of Interest as a vector of strings. Must be in lavaan-syntax without any spaces. Nonlinear effects should have the same ordering as in model.
Method used to fit to the data. Can be LMS or UPI.
lavModel object describing the model.
lavModel object containg the parameters to be estimated.
Object containing info on data transformations.
String stating the search method. Default to "adaptive"
(synonyme is "smart"
). Alternative is "bruteforce"
.
Power modeling method used to model significant parameter estimates. Default to "probit"
indicating glm with probit link function with sqrt(n) as predictor. Alternative is "logit"
.
Total number of models to be fitted. Higher number results in higher precision and longer runtime.
Minimal power value to approximate. Default to .8.
Type I-error rate for significance decision. Default to .05
.
Type I-error rate for confidence band around predicted power rate. Used to ensure that the computed N
keeps the desired power value (with the given Type I-error rate alpha_power_modeling
divided by 2). If set to 1, no confidence band is used. Default to .05
.
Number of cores used for parallelization. Default to number of available cores - 2.
Logical whether progress should be printed in console. Default to TRUE.
Sample sizes used in power estimation process. Default to NULL
.
Starting sample size for smart algorithm. Default to 10*nrow(lavModel[lavModel$op != "~1", ])
(10 times the number of parameters, excluding the mean structure, without the generation of e.g., factor scores or product indicators).
Indicator how the samples sizes should be used in the steps of the smart algorithm: "u"
for many to few to many, "increasing"
for increasing replications and "even"
for evenly distributed replications across steps. Default to "u"
.
Steps used in search_method = "smart"
, i.e., the smart algorithm. This is ignored if bruteforce is used. Default to 10.
Lower bound of N used in search. Default to 5*nrow(lavModel[lavModel$op != "~1", ])
(5 times the number of parameters, excluding the mean structure, in the model without the generation of e.g., factor scores or product indicators), however, some methods can deal with much smaller sample sizes so this can be adjusted. The rule of thumb of 5 times number of parameters is motivated by Wolf et al. (2013)
Steps after which smart search method changes from exploration to exploitation. Default to round(steps/2)
. Exploration phase searches for the interval for N so that the resulting power is within [.15, .85]
since the power curve is steepest at .5 and becomes less step towards plus/min Inf
. Exploitation phase searches for an interval for N around the power_aim
argument which shrinks from plus/minus .1 to .01. If swicthStep = Inf
, then only exploration is used. If switchStep
is used then the search process is reset at that point, which results in a new estimation in the bounds of the interval of N independent of the previous ones which might be restricted in change (see also argument( constrainRelChange
).
Method to be used to extract factor scores. Default to "SL"
for the Skrondal and Laake approach that uses regression ("regression"
) factor scores for the independendent variables and "Bartlett"
factor scores for the dependent variables.
Should the parameter be tested with a directed hypothesis (onesided) or with an undirected hypothesis (twosided, also equivalent to Wald-Test for single parameter). Default to "onesided"
.
Logical passed to semTools::indProd
in order to compute the product indicators: Specify TRUE to use match-paired approach (Marsh, Wen, & Hau, 2004). If FALSE, the resulting products are all possible products. Default to TRUE
. The observations are matched by order given when specifying the measurement model.
String indicating which method of centering should be used when constructing product indicators. String is converted to the arguments meanC
, doubleMC
, and residualMC
, of the semTools::indProd
function. Default to "doubleMC"
for double mean centering the resulting products (Lin et. al., 2010). Use "meanC"
for mean centering the main effect indicator before making the products or "residualC"
for residual centering the products by the main effect indicators (Little, Bovaird, & Widaman, 2006). "none"
or any other input than the previously described results in no centering (use with caution!).
Logical whether the inspection of estimation truthworthiness should be very liberal (i.e., allowing for non-positive definite Hessians in standard error estimation or non-positive residual covariance matrices or latent covariance matrices). Default to FALSE
. Being liberal is not adviced and should be checked for a single data set!
Logical whether the change in the bounds of the interval for N using the smart algorithm should be constrained. This prevents divergence (which is especially an issue for small effect sizes and small R
) but results in biased estimates if the number of steps is too small. Default to TRUE
.
Seeds for reproducibility.
path where (temporal) data and scripts for running LMS using Mplus are stored (using MplusAutomation
). Default to NULL
, then tempdir()
is used.
Wolf, E. J., Harrington, K. M., Clark, S. L., & Miller, M. W. (2013). Sample Size Requirements for Structural Equation Models: An Evaluation of Power, Bias, and Solution Propriety. Educational and Psychological Measurement, 76(6), 913–934. tools:::Rd_expr_doi("10.1177/0013164413495237")
Irmer, J. P., Klein, A. G., & Schermelleh-Engel, K. (2024). Behavior Research Methods, 0(00), Advance Online Publication.