Error in segment - how to obtain error bars in interaction.plot

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Error in segment - how to obtain error bars in interaction.plot

Oyster
This post has NOT been accepted by the mailing list yet.
I am having trouble trying to add error bars in an interaction.plot.

here is a how my data looks like:

Comb

Date     MR   EsD

11-1     H1    112
11-1     H2    183
11-1     H0    115
11-2     H1    134
11-2     H2    220
11-2     H0    0
12-1     H1    152
12-1     H2    148
12-1     H0    0
12-2     H1    159
12-2     H2    43
12-2     H0    12
13-1     H1    254
13-1     H2    148
13-1     H0    148
13-2     H1    123
13-2     H2    147
13-2     H0    148

and my current script

comb<-read.table("datac.txt",h=T)
attach(comb)
names(comb)

Date   MR    EsD

Date<-factor(Date)
MR<-factor(MR)
EshootD<-log10(EshootD+0.5)

means=by(comb$EsD,list(comb$Date,comb$MR),mean)
se=function(x) sqrt(var(x)/length(x))
ses=by(comb$EsD,list(comb$Date,comb$MR),se)
modEs <-aov(EsD~Date*MR+Error(Date/MR))
summary(modEs)
interaction.plot(Date,MR,EsD)


<nabble_embed>segments(comb$MR, comb$EsD-ses, comb$MR, comb$EsD+ses, col="red") Running this, I obtain an error message: Error in segments(comb$Date, comb$EshootD - ses, comb$Date, comb$EshootD + : dims [product 39] do not match the length of object [390] </nabble_embed>

Anyone could help me solving this? thanks in advance

Oyster