[R] Question about creating error bars
Dan Bolser
dmb at mrc-dunn.cam.ac.uk
Thu Dec 23 18:38:21 CET 2004
I have data that looks (very roughly) like this...
Declarative:
Several 'groups', each group with a very variable number of
data points associated.
Procedural:
v.1 <- c(rep(50,1), rep(5,5), rep(2,10)) # Set up
v.2 <- c('a','b','c','d','e','f','g','h', # the
'i','j','k','l','m','n','o','p') # groups
v.3 <- rep(v.2,v.1) # here.
v.4 <- rnorm(length(v.3)) # Simulate data.
v.5 <- tapply(v.4,v.3,mean) # My analysis.
plot(v.5)
As the number of data points in a group gets smaller, so the variance of
the mean value for that group goes up. I would like to bootstrap some
error bars to show roughly how variable the value for each group is. Here
we have a normal distribution, but mostly my data is binary (i.e. each
group has a different number of (nearly) binary observations). The groups
are ordered, and I want to see any trend in my data accross the groups.
Dan.
More information about the R-help
mailing list