On 12/06/2013 04:16 PM, mohan.radhakrish...@polarisft.com wrote:
Hi,
Basic question with basic code. I am simulating a set of
'y' values for a standard 'x' value measurement. So here the error bars
are very long because the
number of samples are very small. Is that correct ? I am plotting the mean
of 'y' on the 'y' axis.
Thanks,
Mohan
x<- data.frame(c(5,10,15,20,25,30,35,40,50,60))
colnames(x)<- c("x")
y<- sample(5:60,10,replace=T)
y1<- sample(5:60,10,replace=T)
y2<- sample(5:60,10,replace=T)
y3<- sample(5:60,10,replace=T)
y4<- sample(5:60,10,replace=T)
z<- data.frame(cbind(x,y,y1,y2,y3,y4))
z$mean<- apply(z[,c(2,3,4,5,6)],2,mean)
z$sd<- apply(z[,c(2,3,4,5,6)],2,sd)
z$se<- z$sd / sqrt(5)
Hi Mohan,
As your samples seem to follow a discrete uniform distribution, the
standard deviation is approximately the number of integers in the range
(56) divided by the number of observations (10).
Jim
______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.