[R] help with two layers of factors

haettulegur haettulegur at gmail.com
Thu Apr 2 18:54:06 CEST 2009


I have a data frame that looks something like...

Column 1 is an experiment_id, Column 2 is the type of treatment ("control",
"full treatment", or "partial treatment"), and Column 3 is a value.

Experiment_id Treament_type Value
12345    "control"    3
12345    "full treatment"    4
12345    "full treatment"    5
12345    "partial treatment"    4
10000    "control"    1

What I want to do is this:
For each experiment_id, compute the mean "control" value, the mean "full
treatment" value, and the mean "partial treatment" value.
Is there an easy way to do this?

(Also, for each experiment_id, I then want to find 
1) "mean full treatment value" - "mean control value"
2) "mean partial treatment value" - "mean control value".)

Thanks!
-- 
View this message in context: http://www.nabble.com/help-with-two-layers-of-factors-tp22851129p22851129.html
Sent from the R help mailing list archive at Nabble.com.




More information about the R-help mailing list