Displaying 1 result from an estimated 1 matches for "number_of_behavior".
Did you mean:
number_of_behaviors
2011 Aug 18
3
Coding question for behavioral data analysis
...specific behavior within that window with the
following syntax.
TimeG=mydata$Time[mydata$Behavior == "g"]
TimeA=mydata$Time[mydata$Behavior == "a"]
out=rep(NA, length(TimeG))
for (i in 1:length(TimeG)){tmp = TimeA-TimeG[i]
out[i]=(sum(0 < tmp & tmp <=1000 )>0 ) }
number_of_behaviors<-length(TimeG)
number_of_affectmirroring<-sum(out)
This generates 2 values: the number of times that the target behavior
"g" occurred, and the number of times that it was followed by the
behavior "a" within 1000 milliseconds.
Question:
What I can't seem to figure ou...