search.best.n.bisection {hscovar}R Documentation

Method of bisection for estimating optimal sample size

Description

A grid [nstart, nmax] for possible sample size is considered. Instead of executing a time-consuming grid search, the method of bisection is applied to this interval. For each step, the function pwr.normtest is called for the given set of parameters.

Usage

search.best.n.bisection(
  R,
  betaSE,
  lambda,
  pos,
  nstart,
  nmax,
  weights = 1,
  typeII = 0.2,
  alpha = 0.01
)

Arguments

R

(p x p) matrix containing theoretical correlation between SNP pairs

betaSE

effect size relative to residual standard deviation

lambda

shrinkage parameter

pos

vector (LEN nqtl) of SNP indices for assumed QTL positions

nstart

minimum value for grid search

nmax

maximum value for grid search

weights

vector (LEN p) of SNP-specific weights or scalar if weights are equal for all SNPs; default value 1

typeII

type-II error level; default value 0.2

alpha

type-I error level; default value 0.01

Value

integer of optimal sample size

Examples

  ### correlation matrix (should depend on sire haplotypes)
  R <- AR1(100, rho = 0.1)
  ### positions of putative QTL signals
  pos <- c(14, 75)
  ### optimal sample size
  search.best.n.bisection(R, 0.35, 1200, pos, 10, 5000)

[Package hscovar version 0.4.2 Index]