p_2r | R Documentation |
Function utilizes cocor
to perform correlation
comparison for independent, overlapping, and non-overlapping designs.
p_2r(
n,
r.ab1,
r.ab2,
r.ac1,
r.ac2,
r.bc1,
r.bc2,
r.ad1,
r.ad2,
r.bd1,
r.bd2,
r.cd1,
r.cd2,
n2_n1 = 1,
two.tailed = TRUE,
type = c("independent", "overlap", "nonoverlap"),
test = "fisher1925",
gen_fun = gen_2r,
...
)
gen_2r(n, R, ...)
n |
sample size |
r.ab1 |
correlation between variable A and B in sample 1 |
r.ab2 |
correlation between variable A and B in sample 2 |
r.ac1 |
same pattern as |
r.ac2 |
same pattern as |
r.bc1 |
... |
r.bc2 |
... |
r.ad1 |
... |
r.ad2 |
... |
r.bd1 |
... |
r.bd2 |
... |
r.cd1 |
... |
r.cd2 |
... |
n2_n1 |
sample size ratio |
two.tailed |
logical; use two-tailed test? |
type |
type of correlation design |
test |
hypothesis method to use. Defaults to 'fisher1925' |
gen_fun |
function used to generate the required discrete data.
Object returned must be a |
... |
additional arguments to be passed to |
R |
a correlation matrix constructed from the inputs
to |
a single p-value
Phil Chalmers rphilip.chalmers@gmail.com
# independent (same x-y pairing across groups)
p_2r(100, r.ab1=.5, r.ab2=.6)
# estimate empirical power
p_2r(n=100, r.ab1=.5, r.ab2=.6) |> Spower()
# estimate n required to reach 80% power
p_2r(n=NA, r.ab1=.5, r.ab2=.6) |>
Spower(power=.80, interval=c(100, 5000))
# overlap (same y, different xs)
p_2r(100, r.ab1=.5, r.ab2=.7,
r.ac1=.3, r.ac2=.3,
r.bc1=.2, r.bc2=.2, type = 'overlap')
# nonoverlap (different ys, different xs)
p_2r(100, r.ab1=.5, r.ab2=.6,
r.ac1=.3, r.ac2=.3,
r.bc1=.2, r.bc2=.2,
r.ad1=.2, r.ad2=.2,
r.bd1=.4, r.bd2=.4,
r.cd1=.2, r.cd2=.2,
type = 'nonoverlap')
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.