[R] multiple scores per subject

Christopher Brown c-b at asu.edu
Fri Mar 16 01:07:25 CET 2007


Hi,

I have a data set that looks like this:

 > data
    vara varb S  PC
1  None  250 1  80
2  None  250 1  70
3  Some  250 1  60
4  Some  250 1  70
5  None 1000 1  90
6  None 1000 1  90
7  Some 1000 1  80
8  Some 1000 1  70
9  None  250 2 100
10 None  250 2  80
11 Some  250 2  70
12 Some  250 2  70
13 None 1000 2 100
14 None 1000 2  90
15 Some 1000 2  50
16 Some 1000 2  40

...

And so on. The last column is the dependent variable, and I have made
the other columns factors. As you can see, there are multiple scores for 
each subject in each combination of conditions. How can I reduce the 
dataset so that there is only 1 score per subject, per condition, for 
further analysis? I can use tapply to get means, but I need a data.frame 
for analysis (aov). Any ideas?

-- 
Chris



More information about the R-help mailing list