Displaying 1 result from an estimated 1 matches for "sdvec".
Did you mean:
dvec
1998 Oct 16
3
mean and sd of each serial position
..., a2, and a3.
so in this example it would have the contents
4.041452, 4.041452, 2.081666
Can anyone tell me a good way to do this in R? The only thing I can come
up with is
meanvec<-function(a1,a2,a3)
{
temp<-numeric(3)
for(i in 1:3)
temp[i]<-mean(c(a1[i],a2[i], a3[i]))
return(temp)
}
sdvec<-function(a1,a2,a3)
{
temp<-numeric(3)
for(i in 1:3)
temp[i]<-sd(c(a1[i],a2[i], a3[i]))
return(temp)
}
If this simple-minded approach is the way to go, I wonder how to modify
these functions so I don't need to know the number of vectors ahead of
time. That is, make the same function...