[R] within and between subject calculation

From: Kerry Bush <kerryrekky_at_yahoo.com>
Date: Wed 15 Jun 2005 - 07:28:27 EST


Dear helpers in this forum,

I have the following question:

Suppose I have the following data set:

id x y
023 1 2

023 2 5
023 4 6
023 5 7
412 2 5
412 3 4
412 4 6
412 7 9
220 5 7
220 4 8
220 9 8
......

and i want to calculate sum_{i=1}^k
sum_{j=1}^{n_i}x_{ij}*y_{ij}

is there a simple way to do this within and between subject summation in R?



R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html Received on Wed Jun 15 07:33:07 2005

This archive was generated by hypermail 2.1.8 : Fri 03 Mar 2006 - 03:32:38 EST