Does this do what you want?
> x <- data.frame(subj=sample(1:3,20,TRUE), cond=sample(1:2,20,TRUE),
> time=runif(20,1,10))
> # add mean and sd
> x$mean <- ave(x$time, x$subj, x$cond)
> x$sd <- ave(x$time, x$subj, x$cond, FUN=sd)
> x
subj cond time mean sd
1 32 3.563114 5.63
I have been trying to figure out how Hadley Wickhams
"reshape" package works and I tried it on what may be
your problem. Here is my example. Does it do
something like what you want?
===
# Test Data
zz <- "subj cond t1 t2 t3
A1 4 5 7
A
Dear List,
I have a data frame containing reaction times of participants in some
experiment.
As usual each line is single trial in the experiment. Two factors denote the
conditions in the experiment. Each participant completes different trials for
each condition.
Now, the question:
I want to
3 matches
Mail list logo