[R-br] Bandas de confiança em plot de dispersão

Marcelo Cardoso mello marcelo_cm32 em yahoo.com.br
Quarta Maio 9 12:06:53 BRT 2012


Pessoal, gostaria de adicionar bandas de confiança na CMR que segue. Agradeço qualquer dica.

x<-structure(list(week
= c(9L, 10L, 11L, 12L, 9L, 10L, 11L, 12L, 
9L,
10L, 11L, 12L, 9L, 10L, 11L, 12L, 9L, 10L, 11L, 12L, 9L, 
10L,
11L, 12L, 9L, 10L, 11L, 12L, 9L, 10L, 11L, 12L, 9L, 10L, 
11L,
12L, 9L, 10L, 11L, 12L, 9L, 10L, 11L, 12L, 9L, 10L, 11L, 
12L,
9L, 10L, 11L, 12L, 9L, 10L, 11L, 12L, 9L, 10L, 11L, 12L, 
9L,
10L, 11L, 12L, 9L, 10L, 11L, 12L), kid = c(1L, 1L, 1L, 1L, 
2L,
2L, 2L, 2L, 3L, 3L, 3L, 3L, 4L, 4L, 4L, 4L, 5L, 5L, 5L, 5L, 
6L,
6L, 6L, 6L, 7L, 7L, 7L, 7L, 8L, 8L, 8L, 8L, 9L, 9L, 9L, 9L, 
10L,
10L, 10L, 10L, 11L, 11L, 11L, 11L, 12L, 12L, 12L, 12L, 13L, 
13L,
13L, 13L, 14L, 14L, 14L, 14L, 15L, 15L, 15L, 15L, 16L, 16L, 
16L,
16L, 17L, 17L, 17L, 17L), treatment = c(1L, 1L, 1L, 1L, 
1L,
1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 
1L,
1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 2L, 2L, 2L, 2L, 
2L,
2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 
2L,
2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L
),
gain = c(1.2, 1, 1.1, 1.3, 1.2, 1.1, 1.4, 1.5, 1.3, 1.4, 1.4, 
1.6,
1.1, 1.1, 1.2, 1.3, 1.2, 1.3, 1.2, 1.3, 1.1, 1.1, 1.1, 1.2, 
1.1,
1.2, 1.3, 1.5, 1.3, 1.3, 1.3, 1.4, 1.2, 1.5, 1.9, 2.1, 1.3, 
1.2,
1.4, 1.7, 1.5, 1.7, 1.6, 1.7, 1.4, 1.5, 1.7, 1.8, 1.2, 1.2, 
1.4,
1.6, 1, 1.1, 1.4, 1.5, 1.4, 1.8, 2.1, 2.1, 1.1, 1.3, 1.4, 
1.8,
1.2, 1.5, 1.7, 1.9)), .Names = c("week", "kid",
"treatment", 
"gain"),
class = "data.frame", row.names = c(NA, -68L)) 
y<-aggregate(.~week+treatment,
x, FUN=mean)
s1<-subset(y,
treatment==1)
s2<-subset(y,
treatment==2)
 
plot(gain~week,
data=s1, col=1, type="o", ylim=c(1,2), lty=1)
points(gain~week,
data=s2, col=2, type="o", lty=2)
legend(9.5,1.7, c("t1","t2"),
col=c(1,2), lty=c(1,2))
-------------- Próxima Parte ----------
Um anexo em HTML foi limpo...
URL: <http://listas.inf.ufpr.br/pipermail/r-br/attachments/20120509/b00fd473/attachment.html>


Mais detalhes sobre a lista de discussão R-br