diffpwr.one {diffcor}R Documentation

Monte Carlo Simulation for the correlation difference between an expected and an observed correlation

Description

Computation of a Monte Carlo simulation to estimate the statistical power the correlation difference between an observed correlation coefficient and an a fixed value against which the correlation should be tested.

Usage

diffpwr.one(n, emp.r, hypo.r, alpha = .05, n.samples = 1000, seed = 1234)

Arguments

n

Sample size to be tested in the Monte Carlo simulation.

emp.r

Assumed observed correlation.

hypo.r

Correlation coefficient against which to test.

alpha

Type I error. Default is .05.

n.samples

Number of samples generated in the Monte Carlo simulation. The recommended minimum is 1000 iterations, which is also the default.

seed

To make the results reproducible, it is recommended to set a random seed.

Details

Depending on the number of generated samples ('n.samples'), correlation coefficients of the size 'emp.r' are simulated. Confidence intervals are built around the simulated correlation coefficients. For each simulated coefficient, it is then checked whether the hypothesized correlation cofficient ('hypo.r') falls within this interval. All correlations are automatically transformed with the Fisher z-transformation prior to computations. The ratio of simulated confidence intervals excluding the hypothesized coefficient equals the statistical power, given the actual sample size ('n'; see Robert & Casella, 2010 <doi:10.1007/978-1-4419-1576-4>, for an overview of the Monte Carlo method).

Value

emp.r

Empirically observed correlation.

hypo.r

Correlation against which 'emp.r' should be tested.

n

The sample size entered in the function.

cov

Coverage. Indicates the ratio of simulated confidence intervals including the assumed correlation 'emp.r'. Should be between .91 and .98 (Muthén & Muthén, 2002 <doi:10.1207/S15328007SEM0904_8>).

bias

Average relative difference between the assumed 'emp.r' and the simulated correlations.

pwr

Statistical power as the ratio of simulated confidence intervals excluding the hypothesized correlation.

Author(s)

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

Robert, C., & Casella, G. (2010). Introducing Monte Carlo methods with R. Springer. https://doi.org/10.1007/978-1-4419-1576-4

Examples

diffpwr.one(n.samples = 1000, n = 500, emp.r = .30, hypo.r = .40, alpha = .05,
            seed = 1234)

[Package diffcor version 0.8.2 Index]