| Title: | Conditional Process Analysis (CPA) via SEM Approach |
|---|---|
| Description: | Utilizes the Reliability-Adjusted Product Indicator (RAPI) method to estimate effects among latent variables, thus allowing for more precise definition and analysis of mediation and moderation models. Our simulation studies reveal that while 'silp' may exhibit instability with smaller sample sizes and lower reliability scores (e.g., N = 100, 'omega' = 0.7), implementing nearest positive definite matrix correction and bootstrap confidence interval estimation can significantly ameliorate this volatility. When these adjustments are applied, 'silp' achieves estimations akin in quality to those derived from LMS. In conclusion, the 'silp' package is a valuable tool for researchers seeking to explore complex relational structures between variables without resorting to commercial software. Cheung et al.(2021)<doi:10.1007/s10869-020-09717-0> Hsiao et al.(2018)<doi:10.1177/0013164416679877>. |
| Authors: | Yi-Hsuan Tseng [aut, cre], Po-Hsien Huang [aut] |
| Maintainer: | Yi-Hsuan Tseng <[email protected]> |
| License: | MIT + file LICENSE |
| Version: | 1.0.3 |
| Built: | 2026-06-01 10:44:53 UTC |
| Source: | https://github.com/tombjjj/silp |
Generates data based on the simulation settings provided by Cheung et al. (2021). Note that the reliability used here is omega.
generate_data( n_obs = 100, corr = 0.3, effect = 0.42, ld = c(1, 1, 1, 1), alp = 0.9, effect_x = 0.4, effect_z = 0.2 )generate_data( n_obs = 100, corr = 0.3, effect = 0.42, ld = c(1, 1, 1, 1), alp = 0.9, effect_x = 0.4, effect_z = 0.2 )
n_obs |
Integer. The number of observations. |
corr |
Numeric. The correlation of the latent variables. |
effect |
Numeric. The effect of the moderator. |
ld |
Numeric. The factor loading of the latent variable to its indicators. |
alp |
Numeric. The reliability of the latent variable. |
effect_x |
Numeric. The direct effect of x. |
effect_z |
Numeric. The direct effect of z. |
A dataset simulated from the argument settings.
n_obs = 100 corr = 0.1 effect = 0.12 ld = c(1,1,1,1) alp = 0.9 generate_data(n_obs, corr, effect, ld, alp)n_obs = 100 corr = 0.1 effect = 0.12 ld = c(1,1,1,1) alp = 0.9 generate_data(n_obs, corr, effect, ld, alp)
An extended function from silp, applying the bootstrap method to obtain standard error estimation.
Note: When using silp with the nearest positive definite matrix (npd = TRUE), this function should be used to obtain
reliable inference.
resilp(fit, R = 2000, progress = T, max_try = 100)resilp(fit, R = 2000, progress = T, max_try = 100)
fit |
A result object from |
R |
Integer. The number of bootstrap samples. Default is 2000. |
progress |
Logical. Whether to display a progress bar. Default is |
max_try |
Maximum resampling attempts per bootstrap sample. |
An object of class "Silp".
n_obs = 100 corr = 0.1 effect = 0.12 ld = c(1,1,1,1) alp = 0.9 data = generate_data(n_obs, corr, effect, ld, alp) model = " fy =~ y1 + y2 + y3 + y4 fx =~ x1 + x2 + x3 + x4 fz =~ z1 + z2 + z3 + z4 fy ~ fx + fz + fx:fz " fit = silp(model, data) resilp(fit, R = 10)n_obs = 100 corr = 0.1 effect = 0.12 ld = c(1,1,1,1) alp = 0.9 data = generate_data(n_obs, corr, effect, ld, alp) model = " fy =~ y1 + y2 + y3 + y4 fx =~ x1 + x2 + x3 + x4 fz =~ z1 + z2 + z3 + z4 fy ~ fx + fz + fx:fz " fit = silp(model, data) resilp(fit, R = 10)
This function extends the lavaan function, allowing users to define moderation effects using the symbol ":".
The RAPI method is used to estimate moderation effects.
silp(model, data, center = "double", tau.eq = F, npd = F, ...)silp(model, data, center = "double", tau.eq = F, npd = F, ...)
model |
A |
data |
The dataset for |
center |
Character. Whether single or double mean centering is used for the product indicator. Default is "double". |
tau.eq |
Logical. Specifies the type of reliability used to estimate error variance. If |
npd |
Logical. Specifies the type of input used in |
... |
Other parameters passed to the |
An "Silp" class object.
n_obs = 100 corr = 0.1 effect = 0.12 ld = c(1,1,1,1) alp = 0.9 data = generate_data(n_obs, corr, effect, ld, alp) model = " fy =~ y1 + y2 + y3 + y4 fx =~ x1 + x2 + x3 + x4 fz =~ z1 + z2 + z3 + z4 fy ~ fx + fz + fx:fz " silp(model, data)n_obs = 100 corr = 0.1 effect = 0.12 ld = c(1,1,1,1) alp = 0.9 data = generate_data(n_obs, corr, effect, ld, alp) model = " fy =~ y1 + y2 + y3 + y4 fx =~ x1 + x2 + x3 + x4 fz =~ z1 + z2 + z3 + z4 fy ~ fx + fz + fx:fz " silp(model, data)
Define silp class
raw_modelThe user-specified lavaan syntax model.
rapi_modelThe revised model with the RAPI method.
timeThe operation time for silp (in seconds).
npdLogical. Whether the nearest positive definite matrix is used.
raw_dataThe input data.
faAn object of class lavaan representing the CFA result.
reliabilityThe reliability index.
composite_dataThe composite data for RAPI.
paThe result of silp.
bootThe results of resilp from R bootstrap samples.
origineThe original silp estimation.
time_resilpThe operation time for resilp (in seconds).
techdetail of resilp operation
Silp in Package silp
Summary Methods for Class Silp in Package silp.
signature(object = "Silp", method = "Bootstrap")Returns the summary result of 'silp' or 'resilp'. This method is for 'resilp' only. If method = "Bootstrap", the percentile bootstrap result is presented. If method = "BC_b", the bias-corrected bootstrap result is presented.