kappa2n: Relationship Between Sample Size and the Degree of Freedom of...

Description Usage Arguments Details Value Author(s) See Also Examples

View source: R/kappa2n.R

Description

The function kappa2n returns the sample size that corresponds to a given degree of freedom kappa, whereas n2kappa converts sample size to the corresponding degree of freedom.

Usage

1
2
kappa2n(kappa, p=2)
n2kappa(n, p=2)

Arguments

kappa

degree of freedom

p

number of variables (p=2 corresponds to simple correlation)

n

sample size

Details

The degree of freedom kappa of the sample distribution of the empirical correlation coefficient depends both on the sample size n and the number p of investigated variables, i.e. whether simple or partial correlation coefficients are being considered. For p=2 (simple correlation coefficient) the degree of freedom equals kappa = n-1, whereas for arbitrary p (with p-2 variables eliminated in the partial correlation coefficient) kappa = n-p+1 (see also dcor0).

Value

The sample size n corresponding to a given kappa, or the degree of freedom kappa corresponding to a given p.

Author(s)

Juliane Sch\"afer and Korbinian Strimmer (https://strimmerlab.github.io).

See Also

dcor0.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
# load GeneNet library
library("GeneNet")


# sample sizes corresponding to kappa=7
kappa2n(7)     # simple correlation
kappa2n(7, 40) # partial correlation with p=40 variables

# degree of freedom corresponding to n=100
n2kappa(100)
n2kappa(100,40)

GeneNet documentation built on Nov. 15, 2021, 1:07 a.m.

Related to kappa2n in GeneNet...