Func | R Documentation |
Calculates Monte Carlo confidence intervals for defined parameters.
Func(coef, func, ..., est, alpha = c(0.001, 0.01, 0.05), ncores = NULL)
coef |
List. A list of parameters. |
func |
R function.
|
... |
Additional arguments to pass to |
est |
Numeric vector. Vector of original parameter estimates. |
alpha |
Numeric vector.
Significance level |
ncores |
Positive integer.
Number of cores to use.
If |
The distribution of parameters is provided as a list (params
)
and the definition of the function of paremeters
is provided by a function (func
).
Confidence intervals for defined parameters
are generated using the generated sampling distribution.
Returns an object of class semmcci
which is
a list with the following elements:
Function call.
List of function arguments.
Parameter estimates \hat{\theta}
.
Sampling distribution of parameter estimates
\hat{\theta}^{\ast}
.
Function used ("Func").
Ivan Jacob Agaloos Pesigan
MacKinnon, D. P., Lockwood, C. M., & Williams, J. (2004). Confidence limits for the indirect effect: Distribution of the product and resampling methods. Multivariate Behavioral Research, 39(1), 99-128. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1207/s15327906mbr3901_4")}
Pesigan, I. J. A., & Cheung, S. F. (2023). Monte Carlo confidence intervals for the indirect effect with missing data. Behavior Research Methods. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.3758/s13428-023-02114-4")}
Preacher, K. J., & Selig, J. P. (2012). Advantages of Monte Carlo confidence intervals for indirect effects. Communication Methods and Measures, 6(2), 77–98. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1080/19312458.2012.679848")}
Other Monte Carlo in Structural Equation Modeling Functions:
MC()
,
MCFunc()
,
MCGeneric()
,
MCMI()
,
MCStd()
library(semmcci)
## Generate Parameters -----------------------------------------------------
coef <- lapply(
X = 1:5,
FUN = function(i) {
rnorm(n = 1)
}
)
## Func() ------------------------------------------------------------------
### Define func ------------------------------------------------------------
func <- function(x) {
out <- exp(x)
names(out) <- "exp"
return(out)
}
### Generate Confidence Intervals ------------------------------------------
Func(
coef,
func = func,
est = 1,
alpha = 0.05
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.