pwr_z_fisher_test: Power and sample size to test Pearson's correlation.

Description Usage Arguments Details Value Examples

View source: R/pwr_z_fisher_test.R

Description

pwr_z_fisher_test computes the power and the sample size for testing Pearson's correlation using Fisher's Z transform.

Usage

1
2
pwr_z_fisher_test(rho, rho0, n = NULL, pwr = NULL,
alternative = "two.sided", sig_level = 0.05)

Arguments

rho

Pearson's correlation

rho0

Pearson's correlation under null hypothesis

n

number of observations (sample size)

pwr

power of test 1 + β (1 minus type II error probability)

alternative

a character string specifying the alternative hypothesis, must be one of "two.sided" (default), "greater" or "less"

sig_level

significance level (Type I error probability)

Details

It can be proved that \frac{1}{2} \log≤ft(\frac{1 + r}{1 - r}\right) has asympotc normal distribution with mean #' \frac{1}{2} \log≤ft(\frac{1 + ρ}{1 - ρ}\right) and variance √{\frac{1}{n - 3}}, where n is the sample size, ρ is the populational Pearson's correlation, and r is the sample correlation.

It's require to give the population Pearson's correlation and Pearson's correlation under null hypothesis.

Value

pwr_z_fisher_test returns a list with the following components:

rho

Pearson's correlation

rho0

Pearson's correlation under null hypothesis

sig_level

significance level

power_sampleSize

A tibble with sample size n and power pwr

Examples

1
2
3
4
5
6
# Power
pwr_z_fisher_test(rho = 0.8, rho0 = 0.7, n = 100, pwr = NULL,
alternative = "two.sided", sig_level = 0.05)
# Sample size
pwr_z_fisher_test(rho = 0.8, rho0 = 0.7, n = NULL, pwr = 0.99,
alternative = "two.sided", sig_level = 0.05)

gilberto-sassi/power documentation built on July 17, 2020, 1:02 p.m.