Learn R Programming

PsumtSim (version 0.4)

compPowerGeneralRespDetection: Compute power to detect differences from background where all categories differ from background.

Description

Compute power to detect responses differing from background in a simulation of responses to a number of categories of stimuli, all of which differ from the background level of firing.

Usage

compPowerGeneralRespDetection(bkgLevel, generalRespLevel, respLevel, numCats, numCatsWithResp, normDistribution = FALSE, showProgress = FALSE, numTrialsPerCat = 15, numBootIters = 1000, numRuns = 1000, alpha = 0.05)

Arguments

bkgLevel
Background firing rate, prior to stimulus onset.
generalRespLevel
Response firing rate applied to categories not having the respLevel of firing.
respLevel
Response firing rate during categories which have a response other than background.
numCats
Total number of categories of stimulus.
numCatsWithResp
Number of categories to be given respLevel responses.
normDistribution
TRUE if normally distributed response and background counts should be used, otherwise Poisson distributed counts are used. Default is FALSE.
showProgress
TRUE if run count should be printed. Default is FALSE.
numTrialsPerCat
Number of trials of responses and backgrounds for each category. Default is 15.
numBootIters
Number of boot iterations, passed as 'R' argument to boot function. Default is 1000.
numRuns
Number of simulations to perform followed by bootstrap testing. Default is 1000.
alpha
Significance level, alpha, to use in counting if simulated results are significant. Default is 0.05.

Value

Number of trials, out of numRuns which were detected as significant in the bootstrap testing.

See Also

compPowerRespDetection

Examples

Run this code
# Simulate responses in 3 of 6 categories and compute how often these responses 
# are detected. Will return a random number generally between 10 and 15, so 
# the estimate of power would be between 20% and 30%.
require(EffectsRelBaseline)
require(boot)
compPowerGeneralRespDetection(1,1,2,6,3,numBootIters=50,numRuns=25)

Run the code above in your browser using DataLab