<div>Tentei rodar e não consegui, veja o que aconteceu</div>
<div> </div>
<div> </div>
<div dir="ltr">
<div class="gmail_default" style="font-family: trebuchet ms,sans-serif;">Ana Paula,<span style="font-family: monospace, monospace; font-size: 12.8px;">txt <-</span><br style="font-family: monospace, monospace; font-size: 12.8px;" /><span style="font-family: monospace, monospace; font-size: 12.8px;">"A E Bloco Y</span><br style="font-family: monospace, monospace; font-size: 12.8px;" /><span style="font-family: monospace, monospace; font-size: 12.8px;">0 1 1 3.05</span><br style="font-family: monospace, monospace; font-size: 12.8px;" /><span style="font-family: monospace, monospace; font-size: 12.8px;">0 1 2 4.45</span><br style="font-family: monospace, monospace; font-size: 12.8px;" /><span style="font-family: monospace, monospace; font-size: 12.8px;">0 1 3 3.05</span><br style="font-family: monospace, monospace; font-size: 12.8px;" /><span style="font-family: monospace, monospace; font-size: 12.8px;">0 1 4 3.35</span><br style="font-family: monospace, monospace; font-size: 12.8px;" /><span style="font-family: monospace, monospace; font-size: 12.8px;">0 2 1 3.50</span><br style="font-family: monospace, monospace; font-size: 12.8px;" /><span style="font-family: monospace, monospace; font-size: 12.8px;">0 2 2 3.90</span><br style="font-family: monospace, monospace; font-size: 12.8px;" /><span style="font-family: monospace, monospace; font-size: 12.8px;">0 2 3 3.80</span><br style="font-family: monospace, monospace; font-size: 12.8px;" /><span style="font-family: monospace, monospace; font-size: 12.8px;">0 2 4 4.05</span><br style="font-family: monospace, monospace; font-size: 12.8px;" /><span style="font-family: monospace, monospace; font-size: 12.8px;">25 1 1 4.15</span><br style="font-family: monospace, monospace; font-size: 12.8px;" /><span style="font-family: monospace, monospace; font-size: 12.8px;">25 1 2 3.90</span><br style="font-family: monospace, monospace; font-size: 12.8px;" /><span style="font-family: monospace, monospace; font-size: 12.8px;">25 1 3 4.25</span><br style="font-family: monospace, monospace; font-size: 12.8px;" /><span style="font-family: monospace, monospace; font-size: 12.8px;">25 1 4 3.15</span><br style="font-family: monospace, monospace; font-size: 12.8px;" /><span style="font-family: monospace, monospace; font-size: 12.8px;">25 2 1 2.40</span><br style="font-family: monospace, monospace; font-size: 12.8px;" /><span style="font-family: monospace, monospace; font-size: 12.8px;">25 2 2 3.65</span><br style="font-family: monospace, monospace; font-size: 12.8px;" /><span style="font-family: monospace, monospace; font-size: 12.8px;">25 2 3 3.35</span><br style="font-family: monospace, monospace; font-size: 12.8px;" /><span style="font-family: monospace, monospace; font-size: 12.8px;">25 2 4 3.45</span><br style="font-family: monospace, monospace; font-size: 12.8px;" /><span style="font-family: monospace, monospace; font-size: 12.8px;">50 1 1 3.40</span><br style="font-family: monospace, monospace; font-size: 12.8px;" /><span style="font-family: monospace, monospace; font-size: 12.8px;">50 1 2 5.00</span><br style="font-family: monospace, monospace; font-size: 12.8px;" /><span style="font-family: monospace, monospace; font-size: 12.8px;">50 1 3 3.80</span><br style="font-family: monospace, monospace; font-size: 12.8px;" /><span style="font-family: monospace, monospace; font-size: 12.8px;">50 1 4 2.55</span><br style="font-family: monospace, monospace; font-size: 12.8px;" /><span style="font-family: monospace, monospace; font-size: 12.8px;">50 2 1 2.50</span><br style="font-family: monospace, monospace; font-size: 12.8px;" /><span style="font-family: monospace, monospace; font-size: 12.8px;">50 2 2 4.00</span><br style="font-family: monospace, monospace; font-size: 12.8px;" /><span style="font-family: monospace, monospace; font-size: 12.8px;">50 2 3 3.25</span><br style="font-family: monospace, monospace; font-size: 12.8px;" /><span style="font-family: monospace, monospace; font-size: 12.8px;">50 2 4 2.95</span><br style="font-family: monospace, monospace; font-size: 12.8px;" /><span style="font-family: monospace, monospace; font-size: 12.8px;">75 1 1 3.25</span><br style="font-family: monospace, monospace; font-size: 12.8px;" /><span style="font-family: monospace, monospace; font-size: 12.8px;">75 1 2 3.80</span><br style="font-family: monospace, monospace; font-size: 12.8px;" /><span style="font-family: monospace, monospace; font-size: 12.8px;">75 1 3 3.45</span><br style="font-family: monospace, monospace; font-size: 12.8px;" /><span style="font-family: monospace, monospace; font-size: 12.8px;">75 1 4 3.30</span><br style="font-family: monospace, monospace; font-size: 12.8px;" /><span style="font-family: monospace, monospace; font-size: 12.8px;">75 2 1 3.50</span><br style="font-family: monospace, monospace; font-size: 12.8px;" /><span style="font-family: monospace, monospace; font-size: 12.8px;">75 2 2 4.25</span><br style="font-family: monospace, monospace; font-size: 12.8px;" /><span style="font-family: monospace, monospace; font-size: 12.8px;">75 2 3 3.55</span><br style="font-family: monospace, monospace; font-size: 12.8px;" /><span style="font-family: monospace, monospace; font-size: 12.8px;">75 2 4 3.10</span><br style="font-family: monospace, monospace; font-size: 12.8px;" /><span style="font-family: monospace, monospace; font-size: 12.8px;">100 1 1 3.25</span><br style="font-family: monospace, monospace; font-size: 12.8px;" /><span style="font-family: monospace, monospace; font-size: 12.8px;">100 1 2 3.00</span><br style="font-family: monospace, monospace; font-size: 12.8px;" /><span style="font-family: monospace, monospace; font-size: 12.8px;">100 1 3 4.35</span><br style="font-family: monospace, monospace; font-size: 12.8px;" /><span style="font-family: monospace, monospace; font-size: 12.8px;">100 1 4 3.00</span><br style="font-family: monospace, monospace; font-size: 12.8px;" /><span style="font-family: monospace, monospace; font-size: 12.8px;">100 2 1 2.40</span><br style="font-family: monospace, monospace; font-size: 12.8px;" /><span style="font-family: monospace, monospace; font-size: 12.8px;">100 2 2 4.65</span><br style="font-family: monospace, monospace; font-size: 12.8px;" /><span style="font-family: monospace, monospace; font-size: 12.8px;">100 2 3 4.20</span><br style="font-family: monospace, monospace; font-size: 12.8px;" /><span style="font-family: monospace, monospace; font-size: 12.8px;">100 2 4 3.60"</span><br style="font-family: monospace, monospace; font-size: 12.8px;" /><br style="font-family: monospace, monospace; font-size: 12.8px;" /><span style="font-family: monospace, monospace; font-size: 12.8px;">da <- read.table(textConnection(txt),</span><br style="font-family: monospace, monospace; font-size: 12.8px;" /><span style="font-family: monospace, monospace; font-size: 12.8px;"> header = TRUE,</span><br style="font-family: monospace, monospace; font-size: 12.8px;" /><span style="font-family: monospace, monospace; font-size: 12.8px;"> sep = "\t",</span><br style="font-family: monospace, monospace; font-size: 12.8px;" /><span style="font-family: monospace, monospace; font-size: 12.8px;"> colClasses = c("integer",</span><br style="font-family: monospace, monospace; font-size: 12.8px;" /><span style="font-family: monospace, monospace; font-size: 12.8px;"> "factor",</span><br style="font-family: monospace, monospace; font-size: 12.8px;" /><span style="font-family: monospace, monospace; font-size: 12.8px;"> "factor",</span><br style="font-family: monospace, monospace; font-size: 12.8px;" /><span style="font-family: monospace, monospace; font-size: 12.8px;"> "numeric"))</span><br style="font-family: monospace, monospace; font-size: 12.8px;" /><span style="font-family: monospace, monospace; font-size: 12.8px;">closeAllConnections()</span><br /><br /></div>
<div class="gmail_default" style="font-family: trebuchet ms,sans-serif;"> </div>
<div class="gmail_default" style="font-family: trebuchet ms,sans-serif;">
<div class="gmail_default">+ "numeric"))</div>
<div class="gmail_default">Error in scan(file = file, what = what, sep = sep, quote = quote, dec = dec, : </div>
<div class="gmail_default"> scan() esperava 'an integer', obteve '0113.05'</div>
<div class="gmail_default">> closeAllConnections()</div>
<div class="gmail_default">> da</div>
<div class="gmail_default"> counts outcome treatment</div>
<div class="gmail_default">1 18 1 1</div>
<div class="gmail_default">2 17 2 1</div>
<div class="gmail_default">3 15 3 1</div>
<div class="gmail_default">4 20 1 2</div>
<div class="gmail_default">5 10 2 2</div>
<div class="gmail_default">6 20 3 2</div>
<div class="gmail_default">7 25 1 3</div>
<div class="gmail_default">8 13 2 3</div>
<div class="gmail_default">9 12 3 3</div>
<div> </div>
</div>
<div class="gmail_default" style="font-family: trebuchet ms,sans-serif;"> </div>
<div class="gmail_default" style="font-family: trebuchet ms,sans-serif;"> </div>
<div class="gmail_default" style="font-family: trebuchet ms,sans-serif;"> </div>
<div class="gmail_default" style="font-family: trebuchet ms,sans-serif;"> </div>
<div class="gmail_default" style="font-family: trebuchet ms,sans-serif;">Segue CRM. O guia de contribuição dessa lista de discussão não recomenda o envio de conteúdo anexo as mensagens. Isso por motivos de segurança, reprodutibilidade, portabilidade e economia. Procure fazer códigos reproduzíveis a partir de recorta e cola, como é esse que eu envio. Isso ajuda muito as pessoas dispostas a te ajudar porque elas passam a ter bons motivos para isso. Quando os dados não são grandes (tabelas de poucas linhas/colunas), um mecanismo com textConnection() é suficiente. Estou certo da sua compreensão.<br /><br /><span style="font-family: monospace,monospace;">#-----------------------------------------------------------------------<br /><br />txt <-<br />"A E Bloco Y<br />0 1 1 3.05<br />0 1 2 4.45<br />0 1 3 3.05<br />0 1 4 3.35<br />0 2 1 3.50<br />0 2 2 3.90<br />0 2 3 3.80<br />0 2 4 4.05<br />25 1 1 4.15<br />25 1 2 3.90<br />25 1 3 4.25<br />25 1 4 3.15<br />25 2 1 2.40<br />25 2 2 3.65<br />25 2 3 3.35<br />25 2 4 3.45<br />50 1 1 3.40<br />50 1 2 5.00<br />50 1 3 3.80<br />50 1 4 2.55<br />50 2 1 2.50<br />50 2 2 4.00<br />50 2 3 3.25<br />50 2 4 2.95<br />75 1 1 3.25<br />75 1 2 3.80<br />75 1 3 3.45<br />75 1 4 3.30<br />75 2 1 3.50<br />75 2 2 4.25<br />75 2 3 3.55<br />75 2 4 3.10<br />100 1 1 3.25<br />100 1 2 3.00<br />100 1 3 4.35<br />100 1 4 3.00<br />100 2 1 2.40<br />100 2 2 4.65<br />100 2 3 4.20<br />100 2 4 3.60"<br /><br />da <- read.table(textConnection(txt),<br /> header = TRUE,<br /> sep = "\t",<br /> colClasses = c("integer",<br /> "factor",<br /> "factor",<br /> "numeric"))<br />closeAllConnections()<br />str(da)<br /><br />xtabs(~A + E, data = da)<br /><br />with(da,<br /> interaction.plot(A,<br /> E,<br /> Y,<br /> xlab = "Adubação",<br /> ylab = "ºBrix"))<br /><br /># ATTENTION: o interaction.plot() só te fornece o sinal mas não de dá<br /># uma ideia do ruído para julgar a clareza ou saliência deste sinal.<br /># Recomendo gráficos para isso que incorporem os valores observados e<br /># não somente as médias.<br /><br />library(lattice)<br />library(latticeExtra)<br /><br />xyplot(Y ~ A,<br /> groups = E,<br /> data = da,<br /> type = c("p", "a"))<br /><br /># Gráfico destaca as médias de cada nível de A variando E. Os blocos não<br /># são identificáveis nesse gráfico e parte da variação é explicada<br /># pelos blocos. No gráfico abaixo, observações do mesmo bloco são unidas<br /># por segmentos. As linhas grossas indicam o efeito de A com E.<br /><br />xyplot(Y ~ A,<br /> groups = interaction(E, Bloco),<br /> data = da,<br /> lty = 2,<br /> type = c("p", "a")) +<br /> as.layer(xyplot(Y ~ A,<br /> groups = E,<br /> data = da,<br /> lty = 1, lwd = 2,<br /> type = c("p", "a")))<br /><br /># Note que o ruído domina a expressão do sinal, fazendo com tenhamos<br /># pouca evidência para esperar por uma interação. Ou seja, dentro da<br /># aplitude de variação vista, o sinal de interação é desprezível.<br /><br />xyplot(Y ~ A,<br /> groups = E,<br /> data = da) +<br /> glayer(panel.smoother(x = x, y = y))<br /><br /># Esse gráfico ajusta uma regressão suave e mostra a curva ajustadas com<br /># bandas de confiança. Atenção: o efeito de bloco não foi considerado e<br /># portanto veja isso como algo exploratório.<br /><br /># Passa A para fator.<br />da$A <- factor(da$A, levels = sort(unique(da$A)))<br /><br /># Ajusta o modelo de parcelas subdivididas.<br />m0 <- aov(Y ~ Bloco + E * A + Error(Bloco:E),<br /> data = da)<br /><br /># Quadro de anova.<br />summary(m0)<br /><br />#-----------------------------------------------------------------------<br /></span><br /><br />À disposição.</div>
<div class="gmail_default" style="font-family: trebuchet ms,sans-serif;">Walmes.</div>
</div>
<div> </div>