R/simCatResp.R

Defines functions simCatResp

Documented in simCatResp

#
# Build a simulated set of responses to categories of stimuli, 
# returning result as a data frame.
#
simCatResp<-function(bkgRate,respRates,numRespsPerCat) {
  N<-length(respRates)*numRespsPerCat
	catLabels<-paste('cat',rep(1:length(respRates),numRespsPerCat),sep='')
	bkg<-rpois(N,bkgRate)
	resp<-rpois(N,respRates)
	data.frame(category=catLabels,bkg=bkg,resp=resp)
}

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.