Skip to contents

The function generates Monte Carlo method confidence intervals for the mediation model \(X \to M \to Y\).

Usage

MCXMY(phi_hat, delta_t = 1:30, R = 20000L, seed = NULL)

Arguments

phi_hat

R object. Output of the PhiHat() function.

delta_t

Numeric vector. Vector of time intervals.

R

Positive integer. Number of Monte Carlo replications.

seed

Integer. Random seed.

Examples

if (FALSE) { # \dontrun{
set.seed(42)
library(dynr)
sim <- GenData(taskid = 1)
data <- RandomMeasurement(sim)
fit <- FitDynr(data, taskid = 1)
phi_hat <- PhiHat(fit)
ci <- MCXMY(phi_hat, seed = 42)
plot(ci)
} # }