kappa2n function

Relationship Between Sample Size and the Degree of Freedom of Correlation Distribution

Relationship Between Sample Size and the Degree of Freedom of Correlation Distribution

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.

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).

Returns

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

# 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)