## Not run:
# ## load spontaneous data of 4 putative projection neurons
# ## simultaneously recorded from the cockroach (Periplaneta
# ## americana) antennal lobe
# data(CAL1S)
# ## convert data into spikeTrain objects
# CAL1S <- lapply(CAL1S,as.spikeTrain)
# ## look at the individual trains
# ## first the "raw" data
# CAL1S[["neuron 1"]]
# ## next some summary information
# summary(CAL1S[["neuron 1"]])
# ## next the renewal tests
# renewalTestPlot(CAL1S[["neuron 1"]])
# ## It does not look too bad so let fit simple models
# compModels(CAL1S[["neuron 1"]])
#
# ## Simulate a sample with 100 events from an inverse Gaussian
# set.seed(1102006,"Mersenne-Twister")
# mu.true <- 0.075
# sigma2.true <- 3
# sampleSize <- 100
# sampIG <- rinvgauss(sampleSize,mu=mu.true,sigma2=sigma2.true)
#
# ## Compare models and display QQ plot
# compModels(sampIG,type="qq")
#
# ## Compare models and display survival plot
# compModels(sampIG,type="s")
#
#
# ## Generate a censored sample using an exponential distribution
# sampEXP <- rexp(sampleSize,1/(2*mu.true))
# sampIGtime <- pmin(sampIG,sampEXP)
# sampIGstatus <- as.numeric(sampIG <= sampEXP)
# ## Compare models and display QQ plot
# ## WARNING with censored data like here the QQ plot is misleading
# compModels(yi=sampIGtime,si=sampIGstatus,type="qq")
# ## Compare models and display survival plot
# compModels(yi=sampIGtime,si=sampIGstatus,type="s")
# ## End(Not run)
Run the code above in your browser using DataLab