rConfInt: Calculate Confidence Interval for Sample Correlation

Description Usage Arguments Details Value Author(s) Examples

Description

Calculate confidence interval for sample correlation using Fisher's transformation.

Usage

1
rConfInt(r, N, alpha = 0.05)

Arguments

r

A vector of sample correlations.
Can be output of prsInf.

N

Sample size.

alpha

Confidence level. By default it is 5%.

Details

The function uses Fisher's transformation to convert sample correlations r into a z-score. A confidence interval is then constructed for the z-score. The inverse transformation is used to construct the confidence interval for the sample correlations r.

Value

The function returns a data frame with lower and upper bounds of the confidence intervals.

Author(s)

Andrey A Shabalin andrey.shabalin@gmail.com

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
signal = genSignal(
            NSignalSnps = 10,
            NTotalSNPs = 20,
            heritability = 0.1,
            signalDistr = "Same")
            
gwas = gwasFast(signal = signal, N = 85)

cbind(beta = gwas$beta, pv = gwas$pv)

prs = prsInf(
            gwasPV = gwas$pv,
            gwasBt = gwas$beta,
            signal = signal)

cbind(pv = prs$pv, r = prs$r)

rci = rConfInt(r = prs$r, N = 1000)

cbind(pv = prs$pv, r = prs$r, rci)

andreyshabalin/simPRS documentation built on May 21, 2019, 2 p.m.