Generates percentiles (100 based quantiles) for the distribution of product of two normal random variables and the mediated effect
pprodnormal(
q,
mu.x,
mu.y,
se.x = 1,
se.y = 1,
rho = 0,
lower.tail = TRUE,
type = "dop",
n.mc = 1e+05
)
An object of the type list
that contains the
following values:
probability (percentile) corresponding to
quantile q
estimate of the absolute error
quantile or value of the product
mean of
mean of
standard error (deviation) of
standard error (deviation) of
correlation between rho
< 1.
The default value is 0.
logical; if TRUE
(default), the probability is
method used to compute confidence interval. It takes on the
values "dop"
(default), "MC"
, "asymp"
or "all"
when type="MC"
, n.mc
determines the sample size for
the Monte Carlo method. The default sample size is 1E5.
Davood Tofighi dtofighi@gmail.com
This function returns the percentile (probability) and the
associated error for the distribution of product of mediated effect (two
normal random variables). To obtain a percentile using a specific method,
the argument type
should be specified. The default method is
type="dop"
, which is based on the method described by Meeker and
Escobar (1994) to evaluate the CDF of the distribution of product of two
normal random variables. type="MC"
uses the Monte Carlo approach
(Tofighi & MacKinnon, 2011). type="all"
prints percentiles using all
three options. For the method type="dop"
, the error is the modulus
of absolute error for the numerical integration (for more information see
Meeker and Escobar, 1994). For type="MC"
, the error refers to the
Monte Carlo error.
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
medci
RMediation-package
pprodnormal(q=0, mu.x=.5, mu.y=.3, se.x=1, se.y=1, rho= 0, type="all")
Run the code above in your browser using DataLab