bootPhi: Coverage for bootstrap confidence intervals

Description Usage Arguments Details Value Examples

View source: R/bootPhi.R

Description

Currently we only consider parametric bootstrap and the kinship coefficient.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
bootPhi(
  ped,
  ids = NULL,
  N = 2,
  B = 2,
  CItype = "bca",
  conf.level = 0.95,
  plot = F,
  seed = NULL,
  verbose = F
)

Arguments

ped

ped object with allele frequencies.

ids

Id of pair.

N

Integer. No of simulations.

B

Integer. No of bootstraps.

CItype

Logical

conf.level

Double

plot

Logical

seed

Integer.

verbose

Logical.

Details

See note coverage.pdf

Value

Returns a l

Returns a list with two elements, a dataframe and the result of last simulation called 'lastBoot'(see documentation of 'ibdBootstrap'). The columns of the data frame are

* 'phi.hat' The estimate for each bootstrap

* 'skew' See details

* 'dist' See documentation of 'ibdBootstrap'

* 'lower' Lower bound for interval

* 'upper' Upper bound for interval

* 'coverage'

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
library(forrel)
library(ribd)
library(coxed) # for bca confidence intervals

# Example Estimate coverage and more
ped = halfSibPed()
ped = setMarkers(ped, locusAttributes = NorwegianFrequencies)
ids = leaves(ped)
N = 2 # no of confidence intervals
B = 100 # no of  bootstraps
CItype = "bca"
conf.level = 0.8
plot = FALSE
seed = 2
res1 = bootPhi(ped = ped, ids = ids, N = N, B = B,
               CItype = CItype, conf.level = conf.level, plot = plot, seed = seed)

boot1 = res1$lastBoot
phi.hat = 0.25*boot1$k1 + 0.5*boot1$k2
plot(density(phi.hat), main = "", xlab = "Kinship coefficient")
qqnorm(phi.hat)

thoree/inbred documentation built on March 28, 2021, 7:42 p.m.