[R] Equal Standard Error bar

Ogbos Okike giftedlife2014 @ending from gm@il@com
Tue Sep 4 21:34:36 CEST 2018


Dear List,

I have a dataset of high variability. I conducted epoch analysis and
attempted to plot the standard error bar alongside.

I am, however, surprised that the error bars are of equal length. I do not
think that the variability in the data is captured, except there is a kind
of averaging that smooths out the differences in daily variations. Should
that be the case, I don't know how and as such need your assistance to
explain what is going on.

The plot is attached. 71 events are represented in the plot.

The code I use to generate the plot is:
oodf<-data.frame(A,B)
library(plotrix)
std.error<-function(x) return(sd(x)/(sum(!is.na(x))))
oomean<-as.vector(by(oodf$B,oodf$A,mean))
oose<-as.vector(by(oodf$B,oodf$A,std.error))
plot(-5:10,oomean,type="b",ylim=c(145000,162000),
 xlab="days (epoch is the day of Fd)",ylab="strikes/day",main="Superposed
Epoch of all the Events")
dispersion(-5:10,oomean,oose).

The sample data is:
-5 64833
-4 95864
-3 82322
-2 95591
-1 69378
0 74281
1 103261
2 92473
3 84344
4 127415
5 123826
6 100029
7 76205
8 105162
9 119533
10 106490
-5 82322
-4 95591
-3 69378
-2 74281
-1 103261
0 92473
1 84344
2 127415
3 123826
4 100029
5 76205
6 105162
7 119533
8 106490
9 114771
10 55593
-5 85694
-4 65205
-3 80995
-2 51723
-1 62310
0 53401
1 65677
2 76094
3 64035
4 68290
5 73306
6 82176
7 75566
8 89762
9 88063
10 94395
-5 80651
-4 81291
-3 63702
-2 70297
-1 64117
0 71219
1 57354
2 62111
3 42252
4 35454
5 33469
6 38899
7 64981
8 85694
9 79452
10 85216
-5 71219
-4 57354
-3 62111
-2 42252
-1 35454
0 33469
1 38899
2 64981
3 85694
4 79452
5 85216
6 81721
7 91231
8 107074
9 108103
10 75768


You kind help will be greatly appreciated.

Many thanks

Ogbos

-------------- next part --------------
A non-text attachment was scrubbed...
Name: A8.png
Type: image/png
Size: 10229 bytes
Desc: not available
URL: <https://stat.ethz.ch/pipermail/r-help/attachments/20180904/a9a19f5a/attachment.png>


More information about the R-help mailing list