<html><body><div style="color:#000; background-color:#fff; font-family:times new roman, new york, times, serif;font-size:12pt"><div style="RIGHT: auto"><SPAN style="RIGHT: auto">Olá Walmes e Benilton muitissimo obrigada pelas sugestões, demorei para responder</SPAN></div>
<div style="RIGHT: auto"><SPAN style="RIGHT: auto">porque estava estudando suas soluções. Acrescentaram muitas informações</SPAN></div>
<div style="RIGHT: auto"><SPAN style="RIGHT: auto">ao meu conhecimento. Até então eu não sabia que a quasipoisson é usada para dados</SPAN></div>
<div style="RIGHT: auto"><SPAN style="RIGHT: auto">com superdispersão. </SPAN></div>
<div style="RIGHT: auto"><SPAN style="RIGHT: auto">Com relação ao teste de médias para interação obrigada pela ajuda, faz pouco tempo</SPAN></div>
<div style="RIGHT: auto"><SPAN style="RIGHT: auto">que estudo o R, tenho muito a aprender. </SPAN></div>
<div style="RIGHT: auto"><SPAN style="RIGHT: auto"></SPAN> </div>
<div style="RIGHT: auto"><SPAN style="RIGHT: auto">Somente a função que coloca as letras não deu certo, mostra um erro!</SPAN></div>
<div style="RIGHT: auto"><SPAN style="RIGHT: auto">confint(glht.mod1)<BR>cld(glht.mod1, level=<VAR id=yui-ie-cursor></VAR>0.05)</SPAN></div>
<DIV></DIV>
<DIV style="RIGHT: auto"><SPAN style="WIDOWS: 2; TEXT-TRANSFORM: none; TEXT-INDENT: 0px; BORDER-COLLAPSE: separate; FONT: 16px Arial; WHITE-SPACE: normal; ORPHANS: 2; LETTER-SPACING: normal; COLOR: rgb(0,0,0); WORD-SPACING: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px" class=Apple-style-span><SPAN style="LINE-HEIGHT: 19px; FONT-FAMILY: 'Lucida Console'; WHITE-SPACE: pre-wrap; FONT-SIZE: 15px" class=Apple-style-span><PRE style="BORDER-BOTTOM-STYLE: none; LINE-HEIGHT: 1.3; BORDER-RIGHT-STYLE: none; MARGIN: 0px; OUTLINE-STYLE: none; FONT-FAMILY: 'Lucida Console'; WHITE-SPACE: pre-wrap !important; BORDER-TOP-STYLE: none; FONT-SIZE: 11pt !important; BORDER-LEFT-STYLE: none" class=GD40030CLR tabIndex=0><SPAN style="RIGHT: auto" class=GD40030CGR>Error: length(object$focus) == 1 is not TRUE</SPAN></PRE><PRE
 style="BORDER-BOTTOM-STYLE: none; LINE-HEIGHT: 1.3; BORDER-RIGHT-STYLE: none; MARGIN: 0px; OUTLINE-STYLE: none; FONT-FAMILY: 'Lucida Console'; WHITE-SPACE: pre-wrap !important; BORDER-TOP-STYLE: none; FONT-SIZE: 11pt !important; BORDER-LEFT-STYLE: none" class=GD40030CLR tabIndex=0><SPAN style="RIGHT: auto" class=GD40030CGR></SPAN> </PRE><PRE style="BORDER-BOTTOM-STYLE: none; LINE-HEIGHT: 1.3; BORDER-RIGHT-STYLE: none; MARGIN: 0px; OUTLINE-STYLE: none; FONT-FAMILY: 'Lucida Console'; WHITE-SPACE: pre-wrap !important; BORDER-TOP-STYLE: none; FONT-SIZE: 11pt !important; BORDER-LEFT-STYLE: none" class=GD40030CLR tabIndex=0><SPAN style="RIGHT: auto" class=GD40030CGR>Reproduzi o código que vc me mandou! Porque será que aconteceu isso</SPAN></PRE><PRE style="BORDER-BOTTOM-STYLE: none; LINE-HEIGHT: 1.3; BORDER-RIGHT-STYLE: none; MARGIN: 0px; OUTLINE-STYLE: none; FONT-FAMILY: 'Lucida Console'; WHITE-SPACE: pre-wrap !important; BORDER-TOP-STYLE: none;
 FONT-SIZE: 11pt !important; BORDER-LEFT-STYLE: none" class=GD40030CLR tabIndex=0><SPAN style="RIGHT: auto" class=GD40030CGR>na hora de colocar as letras?</SPAN></PRE></SPAN></SPAN> </DIV>
<DIV style="RIGHT: auto">Grata,</DIV>
<div style="RIGHT: auto" align=center><FONT style="RIGHT: auto" color=#0000bf face="times new roman, new york, times, serif">Daniele Portela de Oliveira</FONT></div>
<div align=center><FONT color=#0000bf face="times new roman, new york, times, serif">Mestranda Produção Animal - UEM</FONT></div>
<div align=center><FONT color=#0000bf>Cel: 44 9949 3525</FONT></div>
<div align=center><FONT color=#0000bf>       67 9617 0965</FONT></div>
<div align=center> </div>
<div><BR></div>
<DIV style="FONT-FAMILY: times new roman, new york, times, serif; FONT-SIZE: 12pt">
<DIV style="FONT-FAMILY: times new roman, new york, times, serif; FONT-SIZE: 12pt"><FONT size=2 face=Arial>
<DIV style="BORDER-BOTTOM: #ccc 1px solid; BORDER-LEFT: #ccc 1px solid; PADDING-BOTTOM: 0px; LINE-HEIGHT: 0; MARGIN: 5px 0px; PADDING-LEFT: 0px; PADDING-RIGHT: 0px; HEIGHT: 0px; FONT-SIZE: 0px; BORDER-TOP: #ccc 1px solid; BORDER-RIGHT: #ccc 1px solid; PADDING-TOP: 0px" class=hr readonly="true" contenteditable="false"></DIV><B><SPAN style="FONT-WEIGHT: bold">De:</SPAN></B> Walmes Zeviani <walmeszeviani@gmail.com><BR><B><SPAN style="FONT-WEIGHT: bold">Para:</SPAN></B> r-br@listas.c3sl.ufpr.br; Daniele Portela de oliveira <dane_portela@yahoo.com.br><BR><B><SPAN style="FONT-WEIGHT: bold">Enviadas:</SPAN></B> Terça-feira, 1 de Novembro de 2011 14:13<BR><B><SPAN style="FONT-WEIGHT: bold">Assunto:</SPAN></B> Re: [R-br] teste de médias para interação<BR></FONT><BR>
<DIV id=yiv945157072><FONT face="trebuchet ms,sans-serif">É como o Benilton disse, vai ter que montar a matriz que identifica esse contraste do desdobramento. É possível pegar uma atalho usando a contrast::contrast(), e passar a matriz para a multcomp::glht() usar. Porém, os seus dados só apresentaram interação porque eles têm superdispersão. Se usar um modelo quasiPoisson, a interação some. De qualquer forma segue o código **reproduzível** para você. Evite dados em anexo. Torne as coisas o mais fácil possível para quem quer te ajudar. A coisa tem que reproduzir com um ctrol+c ctrol+v.<BR><BR><SPAN style="FONT-FAMILY: courier new, monospace">da <- read.table("clipboard", header=TRUE, sep="\t") # tive que ler do arquivo anexo</SPAN><BR style="FONT-FAMILY: courier new, monospace"><SPAN style="FONT-FAMILY: courier new, monospace">names(da) <- tolower(names(da))</SPAN><BR style="FONT-FAMILY: courier new, monospace"><SPAN
 style="FONT-FAMILY: courier new, monospace">da <- transform(da, avali=factor(avali), trat=factor(trat))</SPAN><BR style="FONT-FAMILY: courier new, monospace"><SPAN style="FONT-FAMILY: courier new, monospace"># tive que passar para fator (isso não é código reproduzível)</SPAN><BR style="FONT-FAMILY: courier new, monospace"><SPAN style="FONT-FAMILY: courier new, monospace">dput(da) # cole o dput dos seus dados na mensagem, o código fica reproduzível com 1 ctrol+c</SPAN><BR style="FONT-FAMILY: courier new, monospace"><BR style="FONT-FAMILY: courier new, monospace"><SPAN style="FONT-FAMILY: courier new, monospace"># na mensagem faça assim, carrege os dados pelo resultado do dput()</SPAN><BR style="FONT-FAMILY: courier new, monospace"><SPAN style="FONT-FAMILY: courier new, monospace">da <-</SPAN><BR style="FONT-FAMILY: courier new, monospace"><SPAN style="FONT-FAMILY: courier new, monospace">  structure(list(avali = structure(c(1L, 1L, 1L,
 1L, 1L, 1L, 1L,</SPAN><BR style="FONT-FAMILY: courier new, monospace"><SPAN style="FONT-FAMILY: courier new, monospace">                   1L, 1L, 1L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 3L, 3L, 3L,</SPAN><BR style="FONT-FAMILY: courier new, monospace"><SPAN style="FONT-FAMILY: courier new, monospace">                   3L, 3L, 3L, 3L, 3L, 3L, 3L), .Label = c("1", "2", "3"), class = "factor"),</SPAN><BR style="FONT-FAMILY: courier new, monospace"><SPAN style="FONT-FAMILY: courier new, monospace">trat = structure(c(1L, 1L, 1L, 1L, 1L, 2L, 2L, 2L, 2L, 2L,</SPAN><BR style="FONT-FAMILY: courier new, monospace"><SPAN style="FONT-FAMILY: courier new, monospace">  1L, 1L, 1L, 1L, 1L, 2L, 2L, 2L, 2L, 2L, 1L, 1L, 1L, 1L, 1L,</SPAN><BR style="FONT-FAMILY: courier new,
 monospace"><SPAN style="FONT-FAMILY: courier new, monospace">  2L, 2L, 2L, 2L, 2L), .Label = c("1", "2"), class = "factor"),</SPAN><BR style="FONT-FAMILY: courier new, monospace"><SPAN style="FONT-FAMILY: courier new, monospace">nasc = c(53L, 98L, 51L, 62L, 55L, 98L, 104L, 32L, 96L, 51L,</SPAN><BR style="FONT-FAMILY: courier new, monospace"><SPAN style="FONT-FAMILY: courier new, monospace">  5L, 6L, 3L, 67L, 1L, 2L, 8L, 2L, 102L, 2L, 11L, 15L, 7L,</SPAN><BR style="FONT-FAMILY: courier new, monospace"><SPAN style="FONT-FAMILY: courier new, monospace">  4L, 6L, 11L, 15L, 37L, 33L, 17L)), .Names = c("avali", "trat",</SPAN><BR style="FONT-FAMILY: courier new, monospace"><SPAN style="FONT-FAMILY: courier new, monospace">"nasc"), row.names = c(NA, -30L), class = "data.frame")</SPAN><BR style="FONT-FAMILY: courier new, monospace"><BR style="FONT-FAMILY: courier new, monospace"><SPAN style="FONT-FAMILY: courier new, monospace">mod.p1 <-
 glm(nasc~avali*trat, family=poisson(link="log"), data=da,</SPAN><BR style="FONT-FAMILY: courier new, monospace"><SPAN style="FONT-FAMILY: courier new, monospace">              contrasts=list(avali="contr.sum", trat="contr.sum"))</SPAN><BR style="FONT-FAMILY: courier new, monospace"><SPAN style="FONT-FAMILY: courier new, monospace">an.p1 <- anova(mod.p1, test="Chisq")</SPAN><BR style="FONT-FAMILY: courier new, monospace"><SPAN style="FONT-FAMILY: courier new, monospace">an.p1 # superdispersão!!!</SPAN><BR style="FONT-FAMILY: courier new, monospace"><BR style="FONT-FAMILY: courier new, monospace"><SPAN style="FONT-FAMILY: courier new, monospace">mod.p2 <- glm(nasc~avali*trat, family=quasipoisson(link="log"), data=da,</SPAN><BR style="FONT-FAMILY: courier new, monospace"><SPAN style="FONT-FAMILY: courier new,
 monospace">              contrasts=list(avali="contr.sum", trat="contr.sum"))</SPAN><BR style="FONT-FAMILY: courier new, monospace"><SPAN style="FONT-FAMILY: courier new, monospace">an.p2 <- anova(mod.p2, test="F")</SPAN><BR style="FONT-FAMILY: courier new, monospace"><SPAN style="FONT-FAMILY: courier new, monospace">an.p2 # sem interação, que foi causada pela suposição de equidispersão</SPAN><BR style="FONT-FAMILY: courier new, monospace"><BR style="FONT-FAMILY: courier new, monospace"><SPAN style="FONT-FAMILY: courier new, monospace">#------------------------------------------------------------------------------------------</SPAN><BR style="FONT-FAMILY: courier new, monospace"><SPAN style="FONT-FAMILY: courier new, monospace"># você vai ter que montar as matrizes dessas interações, um meio fácil é usar a contrast()</SPAN><BR style="FONT-FAMILY: courier new, monospace"><SPAN
 style="FONT-FAMILY: courier new, monospace">require(contrast)</SPAN><BR style="FONT-FAMILY: courier new, monospace"><SPAN style="FONT-FAMILY: courier new, monospace">c0 <- contrast(mod.p2,</SPAN><BR style="FONT-FAMILY: courier new, monospace"><SPAN style="FONT-FAMILY: courier new, monospace">               list(avali=levels(da$avali), trat="1"),</SPAN><BR style="FONT-FAMILY: courier new, monospace"><SPAN style="FONT-FAMILY: courier new, monospace">               list(avali=levels(da$avali), trat="2"))</SPAN><BR style="FONT-FAMILY: courier new, monospace"><SPAN style="FONT-FAMILY: courier new, monospace">c0</SPAN><BR style="FONT-FAMILY: courier new, monospace"><SPAN style="FONT-FAMILY: courier new, monospace">c0$X</SPAN><BR style="FONT-FAMILY: courier new, monospace"><BR style="FONT-FAMILY: courier new,
 monospace"><SPAN style="FONT-FAMILY: courier new, monospace"># acabou que a interação trat dentro de avali foi desdobrada com a contrast</SPAN><BR style="FONT-FAMILY: courier new, monospace"><SPAN style="FONT-FAMILY: courier new, monospace"># usando a multicomp passando a matriz do contraste</SPAN><BR style="FONT-FAMILY: courier new, monospace"><BR style="FONT-FAMILY: courier new, monospace"><SPAN style="FONT-FAMILY: courier new, monospace">library(multcomp)</SPAN><BR style="FONT-FAMILY: courier new, monospace"><SPAN style="FONT-FAMILY: courier new, monospace">glht.mod1 <- glht(mod.p2, linfct=c0$X)</SPAN><BR style="FONT-FAMILY: courier new, monospace"><SPAN style="FONT-FAMILY: courier new, monospace">summary(glht.mod1)</SPAN><BR style="FONT-FAMILY: courier new, monospace"><BR style="FONT-FAMILY: courier new, monospace"><SPAN style="FONT-FAMILY: courier new,
 monospace">#------------------------------------------------------------------------------------------</SPAN><BR style="FONT-FAMILY: courier new, monospace"><BR>À disposição.<BR>Walmes.<BR><BR clear=all></FONT><SPAN style="FONT-FAMILY: trebuchet ms, sans-serif">==========================================================================</SPAN><BR style="FONT-FAMILY: trebuchet ms, sans-serif"><SPAN style="FONT-FAMILY: trebuchet ms, sans-serif">Walmes Marques Zeviani</SPAN><BR style="FONT-FAMILY: trebuchet ms, sans-serif"><SPAN style="FONT-FAMILY: trebuchet ms, sans-serif">LEG (Laboratório de Estatística e Geoinformação, 25.450418 S, 49.231759 W)</SPAN><BR style="FONT-FAMILY: trebuchet ms, sans-serif"><SPAN style="FONT-FAMILY: trebuchet ms, sans-serif">Departamento de Estatística - Universidade Federal do Paraná</SPAN><BR style="FONT-FAMILY: trebuchet ms, sans-serif"><SPAN style="FONT-FAMILY: trebuchet ms, sans-serif">fone: (+55) 41 3361
 3573</SPAN><BR style="FONT-FAMILY: trebuchet ms, sans-serif"><SPAN style="FONT-FAMILY: trebuchet ms, sans-serif">VoIP: (3361 3600) 1053 1173</SPAN><BR style="FONT-FAMILY: trebuchet ms, sans-serif"><SPAN style="FONT-FAMILY: trebuchet ms, sans-serif">e-mail: <A href="mailto:walmes@ufpr.br" rel=nofollow target=_blank ymailto="mailto:walmes@ufpr.br">walmes@ufpr.br</A></SPAN><BR style="FONT-FAMILY: trebuchet ms, sans-serif"><SPAN style="FONT-FAMILY: trebuchet ms, sans-serif">twitter: @walmeszeviani</SPAN><BR style="FONT-FAMILY: trebuchet ms, sans-serif"><SPAN style="FONT-FAMILY: trebuchet ms, sans-serif">homepage: <A href="http://www.leg.ufpr.br/~walmes" rel=nofollow target=_blank>http://www.leg.ufpr.br/~walmes</A></SPAN><BR style="FONT-FAMILY: trebuchet ms, sans-serif"><SPAN style="FONT-FAMILY: trebuchet ms, sans-serif">linux user number: 531218</SPAN><BR style="FONT-FAMILY: trebuchet ms, sans-serif"><SPAN style="FONT-FAMILY: trebuchet ms,
 sans-serif">==========================================================================</SPAN><BR></DIV><BR><BR></DIV></DIV></div></body></html>