Learn R Programming

PsumtSim (version 0.4)

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

Description

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

Usage

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

See Also

compPowerRespDetection, compPowerGeneralRespDetection, simCatResp

Examples

Run this code
  # 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)

Run the code above in your browser using DataLab