## Not run:
# ## Get the e070528citronellal data set into workspace
# data(e070528citronellal)
# ## Compute gampsth without a plot for neuron 1
# ## using a cubic regression spline
# n1CitrGAMPSTH <- gampsth(e070528citronellal[[1]],plot=FALSE,bs="cr")
# ## plot the result
# plot(n1CitrGAMPSTH,stim=c(6.14,6.64),colCI=2)
# ## get a summary of the gam fit
# summary(n1CitrGAMPSTH)
# ## perhaps get a more complete check wit gam.check
# n1CitrGAMPSTHgo <- gamObj(n1CitrGAMPSTH)
# gam.check(n1CitrGAMPSTHgo)
# ## It does not look too bad
# ## Now take a look at the observation on which the gam
# ## was actually performed
# plot(n1CitrGAMPSTH$mids,n1CitrGAMPSTH$counts,type="l")
# ## put dots at the positions of the knots
# X <- n1CitrGAMPSTHgo$smooth[[1]][["xp"]]
# rug(X,col=2)
# ## Add the estimated smooth psth after proper scaling
# theBS <- diff(n1CitrGAMPSTH[["mids"]])[1]
# Y <- n1CitrGAMPSTH$lambdaFct(n1CitrGAMPSTH$mids)*theBS*n1CitrGAMPSTH$nbTrials
# lines(n1CitrGAMPSTH$mids,Y,col=4,lwd=2)
# ## End(Not run)
Run the code above in your browser using DataLab