R/simNormCatResp.R

Defines functions simNormCatResp

Documented in simNormCatResp

#
# Build a simulated set of normally distributed responses 
# to categories of stimuli, returning result as a data frame.
#
simNormCatResp<-function(bkgRate,respRates,numRespsPerCat) {
  N<-length(respRates)*numRespsPerCat
	catLabels<-paste('cat',rep(1:length(respRates),numRespsPerCat),sep='')
	bkg<-rnorm(N,bkgRate,bkgRate)
	resp<-rnorm(N,respRates,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.