<font face="trebuchet ms,sans-serif">Rodrigo,<br><br>Seria equivalente sim. O uso do "%in%" tem sido abandonado, usa-se o "/" no lugar. Na formula "y~fator1/fator2", quer dizer que os níveis de fator2 estão aninhados dentro do fator1. Mas não há necessiddade de ter fatores com níveis aninhados para usar essa fórmula, pode-se usá-la com fatores completamente cruzados. Isso é o que fazemos quando queremos desdobrar a interação. O que ela faz é montar uma nova matriz de incidência para os efeitos, e portanto muda sua interpretação. Para ver isso é só pedir model.matrix() do modelo sob duas diferentes fórmulas e observar os nomes das colunas e valores que incidem em cada linha. As diferentes opções para contraste (contr.treatment, contr.helmert, contr.sum, contr.poly, ...) também modificam as interpretação dos coeficientes pois uma restrição diferente é imposta.<br>
<br><span style="font-family: courier new,monospace;">da <- expand.grid(f1=gl(2,2), f2=gl(2,1))</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">da$y <- rnorm(nrow(da))</span><br style="font-family: courier new,monospace;">
<br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">m0 <- lm(y~f1*f2, da) # níveis completamente cruzados</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">model.matrix(m0)</span><br style="font-family: courier new,monospace;">
<br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">m1 <- lm(y~f1/f2, da) # níveis aninhados</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">model.matrix(m1)</span><br style="font-family: courier new,monospace;">
<br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">m2 <- lm(y~f1*f2, da,                 # níveis completamente cruzados </span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">         contrast=list(f1=contr.sum)) # contraste soma efeitos = zero</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">model.matrix(m2)</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" target="_blank">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/%7Ewalmes" 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>