<div dir="ltr"><div>Alexandre, bom dia!</div><div><br></div><div>Adotando a mesma ideia utilizada no caso da Fátima, dá pra fazer algo bem simples, mas que pode servir.</div><div><br></div><div><font face="courier new, monospace">### <BEGIN></font></div>
<div><font face="courier new, monospace">require(gplots)</font></div><div><font face="courier new, monospace"><br></font></div><div><font face="courier new, monospace"># plot means and</font></div><div><font face="courier new, monospace">data(state)</font></div>
<div><span style="font-family:'courier new',monospace">### pra apagar o que não vai usar:</span><font face="courier new, monospace"><br></font></div><div><font face="courier new, monospace">rm(list=ls(patt='^state')[!(ls() %in% c('state.area', 'state.region'))]) </font></div>
<div><font face="courier new, monospace"><br></font></div><div><font face="courier new, monospace">tmp <- split(state.area, state.region)</font></div><div><font face="courier new, monospace">means <- sapply(tmp, mean)</font></div>
<div><font face="courier new, monospace">stdev <- sqrt(sapply(tmp, var))</font></div><div><font face="courier new, monospace">n <- sapply(tmp,length)</font></div><div><font face="courier new, monospace">ciw <- qt(0.975, n) * stdev / sqrt(n)</font></div>
<div><font face="courier new, monospace"><br></font></div><div><font face="courier new, monospace"># plain</font></div><div><font face="courier new, monospace">plotCI(x=means, uiw=ciw)</font></div><div><font face="courier new, monospace"><br>
</font></div><div><font face="courier new, monospace">###</font></div><div><font face="courier new, monospace"><br></font></div><div><font face="courier new, monospace">rbind(means,stdev,n,ciw) ### sumário</font></div><div>
<font face="courier new, monospace"><br></font></div><div><font face="courier new, monospace">### envelope simples</font></div><div><font face="courier new, monospace">plotCI(x=means, uiw=ciw)</font></div><div><font face="courier new, monospace">eixoX <- 1:4</font></div>
<div><font face="courier new, monospace">lines(eixoX, means+ciw, lty='dashed', col=2)</font></div><div><font face="courier new, monospace">lines(eixoX, means-ciw, lty='dashed', col=2)</font></div><div><font face="courier new, monospace"><br>
</font></div><div><font face="courier new, monospace">### envelope simples hachurado</font></div><div><font face="courier new, monospace">plotCI(x=means, uiw=ciw)</font></div><div><font face="courier new, monospace">polX <- c(eixoX,rev(eixoX))</font></div>
<div><font face="courier new, monospace">polY <- c(means+ciw,rev(means-ciw))</font></div><div><font face="courier new, monospace">#colors()[grep("light",colors())] ### pesquisando cores</font></div><div><font face="courier new, monospace">#polygon(polX, polY, lty='dashed', col='lightgray', bor=NA) ### sem borda ao redor do polígono</font></div>
<div><font face="courier new, monospace">polygon(polX, polY, lty='dashed', col='lightgray', bor=2) ### com borda vermelha</font></div><div><font face="courier new, monospace">plotCI(x=means, uiw=ciw, add=T)</font></div>
<div><font face="courier new, monospace">### <END></font><br></div><div class="gmail_extra"><br clear="all"><div><div dir="ltr">Éder Comunello <<a href="mailto:comunello.eder@gmail.com" target="_blank">c</a><a href="mailto:omunello.eder@gmail.com" target="_blank">omunello.eder@gmail.com</a>> <br>
Dourados, MS - [22 16.5'S, 54 49'W]<br></div></div>
<br></div></div>