| isi {STAR} | R Documentation |
A utility function to create a vector containing the ith preceding inter spike interval (isi) at a given time.
isi(dataFrame, lag = 1)
dataFrame |
a data.frame typically generated by
mkGLMdf. Should at least contain an event
and a time variable. |
lag |
a strictly positive integer. Set to 1 if the previous isi is required, to 2 is the isi preceding the last one is required, etc... |
Look at the (short) source file for details.
A numeric vector with the value of the lagth isi
preceding the time of the corresponding bin center.
Before plugging the result into gssanova, do not forget
to remove the NA elements (see the example).
Christophe Pouzat christophe.pouzat@gmail.com
## Not run: ## load e060517spont data set data(e060517spont) ## make a data frame using a 2 ms bin width e060517spontDF <- mkGLMdf(e060517spont,0.002,0,60) ## Keep data relevant to neuron 1 e060517spontDFn1 <- e060517spontDF[e060517spontDF$neuron == "1",] ## get the isi at lag 1 and 2 e060517spontDFn1$isi1 <- isi(e060517spontDFn1,lag=1) e060517spontDFn1$isi2 <- isi(e060517spontDFn1,lag=2) ## keep only defined elements e060517spontDFn1 <- e060517spontDFn1[!is.na(e060517spontDFn1$isi2),] ## split the data set into an "early" and a "late" part e060517spontDFn1e <- e060517spontDFn1[e060517spontDFn1$time <= 30,] e060517spontDFn1l <- e060517spontDFn1[e060517spontDFn1$time > 30,] ## Fit the late part e060517spontDFn1lGF <- gssanova(event ~ lN.1*isi1+isi2, data=e060517spontDFn1l, family="binomial", seed=20061001) ## Time transform the early part and perform goodness of fit tests e060517spont.n1e.tt <- e060517spontDFn1lGF %tt% e060517spontDFn1e e060517spont.n1e.tt summary(e060517spont.n1e.tt) plot(summary(e060517spont.n1e.tt)) ## End(Not run)