calcNumRejects: Calculate number of cases rejected for repeated simulation of...

Description Usage Arguments Value Author(s) See Also Examples

View source: R/calcNumRejects.R

Description

Calculate number of cases rejected for repeated simulation of Poisson background and responses grouped into categories.

Usage

1
calcNumRejects(bkg, resps, numRespsPerCat, numSims, calcPValFnc, sigLevel = 0.05, ...)

Arguments

bkg

Mean firing rate during a background interval, unrelated to stimulus presentation.

resps

Mean firing rates during a response period, one for each category.

numRespsPerCat

Number of repetitions (presentation of stimuli) in each category.

numSims

Number of simulation to run.

calcPValFnc

Function to be called with simulation output from simCatResp to calculate the achieved significance level, or p-value.

sigLevel

Significance level to use when determining if test is significant. Default is 0.05.

...

Other arguments to pass to calcPValFnc

Value

Number of simulations which were detected as significant, out of numSims

Author(s)

Peter N. Steinmetz <PeterNSteinmetz@steinmetz.org>

See Also

compPowerRespDetection, compPowerGeneralRespDetection, simCatResp

Examples

1
2
3
4
5
  # Calculate number of cases which will be detected as having an effect of 
  # category when there are 4 categories with 2 having different responses and
  # when use a standard F test to detect the category effect.
  pvalFnc<-function(df){anova(glm(resp~category,data=df),test='F')$"Pr(>F)"[2]}
  calcNumRejects(1,c(1,1.5,2,1),6,100,pvalFnc)

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