Description Usage Arguments Details Value Note Author(s) References See Also Examples

Produces confidence intervals for the mediated effect and the product of two normal random variables.

1 2 |

`mu.x` |
mean of |

`mu.y` |
mean of |

`se.x` |
standard error (deviation) of |

`se.y` |
standard error (deviation) of |

`rho` |
correlation between |

`alpha` |
significance level for the confidence interval. The default value is .05. |

`type` |
method used to compute confidence interval. It takes on
the values |

`plot` |
when |

`plotCI` |
when |

`n.mc` |
when |

`...` |
additional arguments to be passed on to the function. |

This function returns a (*1-α*)% confidence interval for the
mediated effect (product of two normal random variables). To obtain a confidence interval
using a specific method, the argument `type`

should be
specified. The default is `type="dop"`

, which uses the code we wrote in **R** to
implement the distribution of product of the coefficients method described
by Meeker and Escobar (1994) to evaluate the CDF of the distribution
of product. `type="MC"`

uses the Monte Carlo approach to compute
the confidence interval (Tofighi & MacKinnon, 2011). `type="asymp"`

produces the asymptotic normal confidence interval. Note that except for the Monte Carlo method, the standard error for the indirect effect is based on the analytical results by Craig (1936):

*√(se.y^2 μ.x^2+se.x^2 μ.y^2+2 μ.x μ.y ρ se.x se.y+ se.x^2 se.y^2+se.x^2 se.y^2 ρ^2) *

In addition, the estimate of indirect effect is *μ.xμ.y +σ.xy *; `type="all"`

prints confidence intervals using all four options.

A vector of lower confidence limit and upper confidence limit.
When `type`

is `"prodclin"`

(default), `"DOP"`

, `"MC"`

or `"asymp"`

, `medci`

returns a list that contains:

`(` |
a vector of lower and upper confidence limits, |

`Estimate` |
a point estimate of the quantity of interest, |

`SE` |
standard error of the quantity of interest, |

`MC Error` |
When |

Note that when `type="all"`

, `medci`

returns a list of *four*
objects, each of which a list that contains the
results produced by each method as described above.

The PRODCLIN programs may be downloaded from http://www.public.asu.edu/~davidpm/ripl/Prodclin/. A web application of the RMediation program is available from http://amp.gatech.edu/RMediation.

Davood Tofighi [email protected] and David P. MacKinnon [email protected]

Craig, C. C. (1936). On the frequency function of *xy*. *The Annals of Mathematical Statistics*, **7**, 1–15.

MacKinnon, D. P., Fritz, M. S., Williams, J., and Lockwood, C. M. (2007). Distribution of the product confidence limits for the indirect effect: Program PRODCLIN. *Behavior
Research Methods*, **39**, 384–389.

Meeker, W. and Escobar, L. (1994). An algorithm to compute the CDF of
the product of two normal random variables. *Communications in
Statistics: Simulation and Computation*, **23**, 271–280.

Tofighi, D. and MacKinnon, D. P. (2011). RMediation: An R package for
mediation analysis confidence intervals. *Behavior Research
Methods*, **43**, 692–700. doi:10.3758/s13428-011-0076-x

`qprodnormal`

`pprodnormal`

`ci`

`RMediation-package`

1 2 3 4 5 6 7 8 9 10 | ```
##produces CI using PRODCLIN and density plot of distribution of xy
(res <- medci(mu.x=.2, mu.y=.4, se.x=1, se.y=1, rho=0, alpha=.05,
type="prodclin", plot=TRUE, plotCI=TRUE) )
## To get a vector of CI estimates
res[[1]]
## To get the point estimate of the indirect effect
res[["Estimate"]] # Estimate
## To get the SE of the indirect effect
res[["SE"]] # SE
``` |

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.