powerNLSEM {powerNLSEM} | R Documentation |
powerNLSEM function
Description
powerNLSEM function
Usage
powerNLSEM(
model,
POI,
method,
test = "onesided",
power_modeling_method = "probit",
search_method = "adaptive",
R = 2000,
power_aim = 0.8,
alpha = 0.05,
alpha_power_modeling = 0.05,
CORES = max(c(parallel::detectCores() - 2, 1)),
verbose = TRUE,
seed = NULL,
...
)
Arguments
model |
Model in lavaan syntax. See documentation for help and examples. |
POI |
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 |
Method used to fit to the data. Implemented methods are |
test |
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 |
power_modeling_method |
Power modeling method used to model significant parameter estimates. Default to |
search_method |
String stating the search method. Default to |
R |
Total number of models to be fitted. Higher number results in higher precision and longer runtime. Default to 2000. |
power_aim |
Minimal power value to approximate. Default to |
alpha |
Type I-error rate for significance decision. Default to |
alpha_power_modeling |
Type I-error rate for confidence band around predicted power rate. Used to ensure that the computed |
CORES |
Number of cores used for parallelization. Default to number of available cores - 2. |
verbose |
Logical whether progress should be printed in console. Default to |
seed |
Seed for replicability. Default to |
... |
Additional arguments passed on to the search functions. |
Value
Returns an list object of class powerNLSEM
.
References
Klein, A. G., & Moosbrugger, H. (2000). Maximum likelihood estimation of latent interaction effects with the LMS method. Psychometrika, 65(4), 457–474. doi:10.1007/BF02296338
Kelava, A., & Brandt, H. (2009). Estimation of nonlinear latent structural equation models using the extended unconstrained approach. Review of Psychology, 16(2), 123–132.
Lin, G. C., Wen, Z., Marsh, H. W., & Lin, H. S. (2010). Structural equation models of latent interactions: Clarification of orthogonalizing and double-mean-centering strategies. Structural Equation Modeling, 17(3), 374–391. doi:10.1080/10705511.2010.488999
Little, T. D., Bovaird, J. A., & Widaman, K. F. (2006). On the merits of orthogonalizing powered and product terms: Implications for modeling interactions among latent variables. Structural Equation Modeling, 13(4), 497–519. doi:10.1207/s15328007sem1304_1
Marsh, H. W., Wen, Z. & Hau, K. T. (2004). Structural equation models of latent interactions: Evaluation of alternative estimation strategies and indicator construction. Psychological Methods, 9(3), 275–300. doi:10.1037/1082-989X.9.3.275
Ng, J. C. K., & Chan, W. (2020). Latent moderation analysis: A factor score approach. Structural Equation Modeling: A Multidisciplinary Journal, 27(4), 629–648. doi:10.1080/10705511.2019.1664304.
Irmer, J. P., Klein, A. G., & Schermelleh-Engel, K. (2024). Behavior Research Methods, 0(00), Advance Online Publication.
See Also
For further details for specific uses see corresponding functions: power_search()
for all inputs possible, UPI()
for specifics for the unconstrained product indicator approach, LMS()
for the latent moderated structured equations approach, FSR()
for factor score approaches, SR()
for scale regression approaches.
Examples
# write model in lavaan syntax
model <- "
# measurement models
X =~ 1*x1 + 0.8*x2 + 0.7*x3
Y =~ 1*y1 + 0.85*y2 + 0.78*y3
Z =~ 1*z1 + 0.9*z2 + 0.6*z3
# structural models
Y ~ 0.3*X + .2*Z + .2*X:Z
# residual variances
Y~~.7975*Y
X~~1*X
Z~~1*Z
# covariances
X~~0.5*Z
# measurement error variances
x1~~.1*x1
x2~~.2*x2
x3~~.3*x3
z1~~.2*z1
z2~~.3*z2
z3~~.4*z3
y1~~.5*y1
y2~~.4*y2
y3~~.3*y3
"
# run model-implied simulation-based power estimation
# for the effects: c("Y~X", "Y~Z", "Y~X:Z")
Result_Power <- powerNLSEM(model = model, POI = c("Y~X", "Y~Z", "Y~X:Z"),
method = "UPI", search_method = "adaptive",
steps = 10, power_modeling_method = "probit",
R = 1000, power_aim = .8, alpha = .05,
alpha_power_modeling = .05,
CORES = 1, seed = 2024)
Result_Power