Bias-Corrected and Accelerated Confidence Intervals
bcaci( thetahatstar, thetahatstarjack = NULL, thetahat, theta = NULL, data, std = FALSE, complete = TRUE, alpha = c(0.001, 0.01, 0.05), par = TRUE, ncores = NULL, blas_threads = TRUE, mc = TRUE, lb = FALSE )
thetahatstar | Numeric vector. Sampling distribution of thetahat. |
---|---|
thetahatstarjack | Numeric vector.
Jackknife vector of parameter estimates.
If |
thetahat | Numeric. Parameter estimate. |
theta | Numeric. Parameter. Optional argument. |
data |
|
std | Logical. Standardize the indirect effect \(\hat{\alpha} \hat{\beta} \frac{\sigma_x}{\sigma_y}\). |
complete | Logical.
If |
alpha | Numeric vector.
Alpha level.
By default |
par | Logical.
If |
ncores | Integer.
Number of cores to use if |
blas_threads | Logical.
If |
mc | Logical.
If |
lb | Logical.
If |
Other confidence intervals functions:
bcci()
,
evalci()
,
len()
,
pcci()
,
shape()
,
theta_hit()
,
zero_hit()
Ivan Jacob Agaloos Pesigan
B <- 5000 data <- jeksterslabRdatarepo::thirst n <- nrow(data) muthetahat <- colMeans(data) Sigmathetahat <- cov(data) thetahat <- fit.ols(data, minimal = TRUE) thetahatstar <- pb.mvn( muthetahat = muthetahat, Sigmathetahat = Sigmathetahat, n = n, B = 5000, par = FALSE ) bcaci( thetahatstar = thetahatstar, thetahat = thetahat, theta = 0.15, # assuming that the true indirect effect is 0.15 data = data, par = FALSE )#> est se reps ci_0.05 ci_0.5 #> 1.527185e-01 7.733199e-02 5.000000e+03 -2.433815e-02 7.725781e-03 #> ci_2.5 ci_97.5 ci_99.5 ci_99.95 zero_hit_99.9 #> 3.826733e-02 3.513996e-01 4.127810e-01 5.210673e-01 1.000000e+00 #> zero_hit_99 zero_hit_95 len_99.9 len_99 len_95 #> 0.000000e+00 0.000000e+00 5.454055e-01 4.050552e-01 3.131323e-01 #> shape_99.9 shape_99 shape_95 theta_hit_99.9 theta_hit_99 #> 2.080401e+00 1.793624e+00 1.735947e+00 1.000000e+00 1.000000e+00 #> theta_hit_95 theta_miss_99.9 theta_miss_99 theta_miss_95 theta #> 1.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 1.500000e-01thetahat <- fit.ols(data, minimal = TRUE, std = TRUE) thetahatstar <- pb.mvn( muthetahat = muthetahat, Sigmathetahat = Sigmathetahat, n = n, std = TRUE, B = 5000, par = FALSE ) bcaci( thetahatstar = thetahatstar, thetahat = thetahat, theta = 0.15, # assuming that the true indirect effect is 0.15 data = data, std = TRUE, par = FALSE )#> est se reps ci_0.05 ci_0.5 #> 0.15303271 0.07212713 5000.00000000 -0.01705917 0.01281978 #> ci_2.5 ci_97.5 ci_99.5 ci_99.95 zero_hit_99.9 #> 0.04354391 0.33414392 0.39591032 0.45179941 1.00000000 #> zero_hit_99 zero_hit_95 len_99.9 len_99 len_95 #> 0.00000000 0.00000000 0.46885858 0.38309055 0.29060001 #> shape_99.9 shape_99 shape_95 theta_hit_99.9 theta_hit_99 #> 1.75650188 1.73220550 1.65415281 1.00000000 1.00000000 #> theta_hit_95 theta_miss_99.9 theta_miss_99 theta_miss_95 theta #> 1.00000000 0.00000000 0.00000000 0.00000000 0.15000000