# Perform within-subject mediation analysis
data("example_data", package = "wsMed")
result1 <- wsMed(
data = example_data,
M_C1 = c("A1", "B1"),
M_C2 = c("A2", "B2"),
Y_C1 = "C1",
Y_C2 = "C2",
form = "P",
Na = "FIML",
standardized = FALSE,
alpha = 0.05
)
# Print the results
print(result1)
Run the code above in your browser using DataLab