Learn R Programming

wsMed (version 1.0.2)

print.wsMed: Print Method for wsMed Objects

Description

Provides a comprehensive summary of results from a wsMed object, including:

  • Input and computed variables with sample size.

  • Model fit indices, regression paths, and variance estimates.

  • Total, direct, and indirect effects with pairwise contrasts.

  • Moderation effects and Monte Carlo confidence intervals for raw and standardized estimates (if applicable).

  • Diagnostic notes for bootstrapping, imputation, and analysis parameters.

The output is formatted for clarity, ensuring an intuitive presentation of mediation analysis results, including dynamic confidence intervals, moderation keys, and C1-C2 coefficients.

Usage

# S3 method for wsMed
print(x, digits = 3, ...)

Value

Invisibly returns the input wsMed object for further use.

Arguments

x

A wsMed object containing the results of within-subject mediation analysis.

digits

Numeric. Number of digits to display in the results.

...

Additional arguments (not used currently).

Details

This function is specifically designed to display results from the within-subject mediation analysis conducted using the wsMed function. Key features include:

  • Variables:

    • Shows input variables (M_C1, M_C2, Y_C1, Y_C2) and computed variables like Ydiff, Mdiff, and Mavg.

    • Reports the sample size used in the analysis.

  • Model Fit Indices:

    • Displays SEM fit indices (e.g., Chi-square, CFI, TLI, RMSEA, SRMR) to assess model quality.

  • Regression Paths and Variance Estimates:

    • Summarizes path coefficients, intercepts, variances, and confidence intervals.

  • Effects:

    • Reports total, direct, and indirect effects with their significance.

    • Highlights pairwise contrasts between indirect effects for mediation paths.

  • Moderation Effects:

    • Provides moderation results for identified variables with corresponding coefficients and paths.

  • Monte Carlo Confidence Intervals:

    • Includes results for raw and standardized estimates obtained using methods such as MI or FIML.

  • Diagnostics:

    • Summarizes analysis parameters like bootstrapping, imputation settings, Monte Carlo iterations, and random seeds.

See Also

wsMed, sem, standardizedSolution_boot_ci

Examples

Run this code

# 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