R/calcNumRejects.R

Defines functions calcNumRejects

Documented in calcNumRejects

# 
# Calculate number of cases rejected for repeated simulation
# of Poisson background and responses grouped into categories.
#
calcNumRejects<-function(bkg,resps,numRespsPerCat,numSims,calcPValFnc,sigLevel=0.05,...) {
  numRejected<-0
  for (i in 1:numSims) {
    sim<-simCatResp(bkg,resps,numRespsPerCat)
    pVal<-calcPValFnc(sim,...)
    if (pVal<sigLevel) numRejected = numRejected + 1
  }
  numRejected
}

Try the PsumtSim package in your browser

Any scripts or data that you put into this service are public.

PsumtSim documentation built on May 1, 2019, 8:03 p.m.