Learn R Programming

pbatR (version 1.2)

power: Power And Sample Size Calculations

Description

Does power and sample size calculations. Note that this may be very highly pbat version specific, and more finicky than other methods in this package, as it requires that the menuing interface does not change.

The Windows version requires a slight hack to control PBAT, which appears to be stable, but may have a race condition on heavily loaded systems. Unix/Linux users should not encounter this.

'pbat.power()' starts the GUI interface (strongly recommended) 'pbat.binaryFamily(...)' is for family based designs with binary 'pbat.continuous(...)' is for family based designs with continuous 'pbat.caseControl(...)' is for case/control designs 'pbat.popQuant(...)' is for population designs with quantitative Currently less extensive range checking is done in these routines unlike the rest of the routines in pbatR.

Usage

pbat.power()

pbat.binaryFamily( numOffspring=1, missingParents=0, numFam=0, addiOffspringPheno=1, ## only when you have missing parents ascertainment="unaffected", model="additive", model.afreq=0.2, model.incrAfreq=0, model.disLocIsMarker=TRUE, model.popPrev=NULL, ## Options 1, 3, & 4 model.genAF=NULL, ## Option 1 model.penAA=NULL, model.penAB=NULL, model.penBB=NULL, ## Option 2 model.OR=NULL, ## Option 3 model.aOR=NULL, ## Option 4 stat.sigLevel=0.01, stat.offset="", ## defaults to population prevalence comp="numerical", log="pbatLog.txt")

pbat.continuousFamily( numOffspring=1, missingParents=0, numFam=0, addiOffspringPheno, ## only when you have missing parents ascertainment="unaffected", model="additive", model.afreq=0.1, model.incrAfreq=0, model.disLocIsMarker=FALSE, model.heritability=0.1, model.afreqMarker=0, model.prDiseaseGivenMarker=1, stat.sigLevel=0.05, stat.offset="", comp="numerical", log="pbatLog.txt")

pbat.caseControl( model="additive", model.minafreq=0.1, model.incrAfreq=0.1, model.prevalence=0.1, model.ORofABvsBB=NULL, # Option 1 - default 1.5 model.aOR=NULL, # Option 2 - default 1.481 comp.cases=500, comp.controls=500, comp.caseControlRatio=1.5, comp.power=0.8, comp.sigLevel=0.05, comp.numSim=1000, mode="power", log="pbatLog.txt")

pbat.popQuant( model="additive", model.minafreq=0.2, model.incrAfreq=0.1, model.heritability=0.001, comp.numProbands=2000, comp.power=0.8, comp.sigLevel=0.05, comp.numSim=10000, mode="power", log="pbatLog.txt")

Arguments

numOffspring
Family - number of offspring
missingParents
Family - number of missing parents (0,1,2)
numFam
Family - number of families
addiOffspringPheno
Only used when you have missing parents; additional offspring phenotypes. 1 for yes, 0 for no.
ascertainment
'unaffected', 'affected', or 'not applicable'
model
'additive', 'dominant', 'recessive' or (only for binary / case control) 'multi'
model.afreq
allele frequency
model.incrAfreq
increment allele frequency
model.disLocIsMarker
TRUE/FALSE - whether the disease locus is the same as the marker locus
model.popPrev
population prevalence
model.prevalence
population prevalence
model.genAF
genetic attributable fraction of the gene
model.penAA
penetrance of AA genotype
model.penAB
penetrance of AB genotype
model.penBB
penetrance of BB genotype
model.OR
odds ratio
model.aOR
allelic odds ratio
model.heritability
heritibility
model.afreqMarker
marker allele frequency
model.prDiseaseGivenMarker
Pr(Disease|marker)
model.ORofABvsBB
odds ratio of AB to BB
model.minafreq
minimum allele frequency
stat.sigLevel
significance level
stat.offset
offset; defaults to population prevalence
comp
'numerical':numerical integration, 'approximation':approximation, 'simulation':simulation
comp.cases
number of cases
comp.controls
number of controls
comp.caseControlRatio
case control ratio
comp.power
power
comp.sigLevel
significance level
comp.numSim
number of simulations to run
comp.numProbands
number of probands
mode
'power' for power result given parameter specification, 'ss' for sample size result given parameter specification; note that not all parameters will be used for 'power' and 'ss'.
log
logfile to write to (results will be stored here) - this will be over-written if the file exists

References

http://www.biostat.harvard.edu/~clange/default.htm http://www.people.fas.harvard.edu/~tjhoffm/pbatR.html

See Also

pbat, pbat.last