On Mon, 3 Nov 2014 12:45:03 PM CJ Davies wrote: > ... > On 30/10/14 21:33, Jim Lemon wrote: > If I understand, you mean to calculate deviations for each individual > 'chunk' of each transition & then aggregate the results? This is what > I'd been thinking about, but is there a sensible manner within R to > achieve this, or is it something for which it would be easier to > preprocess the data in an external tool? Is there some way to subset the > data such that I can work over just contiguous 'chunks'? > Exactly. If there is some combination of existing variables that can be combined to make a set of unique values for each "chunk", you can calculate the deviations within each "chunk", then average the squared deviations for each type of "chunk", weighting by the duration of the "chunks" so that you don't bias the pooled variance toward the longer "chunks".
Jim ______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.