Learn R Programming

diffcor (version 0.8.4)

visual_mc: Visualization of the simulated parameters

Description

To evaluate the quality of the Monte Carlo simulation beyond bias and coverage parameters (Muthén & Muthén, 2002), it can be helpful to also inspect the simulated parameters visually. To this end, visual_mc() can be used to visualize the simulated parameters (including corresponding confidence intervals) in relation to the targeted parameter.

Usage

visual_mc(rho,
          n,
          alpha = .05,
          n.intervals = 100,
          seed = 1234)

Value

A plot in which the targeted correlation coefficient is visualized with a dashed red line and the simulated correlation coefficients are visualized by black squares and confidence intervals (level depending on the specification made in the argument alpha).

Arguments

rho

Targeted correlation coefficient of the simulation.

n

An integer reflecting the sample size.

alpha

Type I error. Default is .05.

n.intervals

An integer reflecting the number of simulated parameters that should be visualized in the graphic. Default is 100.

seed

To make the results reproducible, a random seed is specified.

Author

Christian Blötner c.bloetner@gmail.com

References

Muthén, L. K., & Muthén, B. O. (2002). How to use a Monte Carlo study to decide on sample size and determine power. Structural Equation Modeling: A Multidisciplinary Journal, 9(4), 599–620. https://doi.org/10.1207/S15328007SEM0904_8

Examples

Run this code
visual_mc(rho = .25,
                    n = 300,
                    alpha = .05,
                    n.intervals = 100,
                    seed = 1234)

Run the code above in your browser using DataLab