<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body text="#000000" bgcolor="#ffffff">
Walmes,<br>
<br>
Muito obrigado, agora ficou bem claro. Na verdade fica muito
mais fácil de entender com dados simulados e no caso do pacote
contrast os exemplos são baseados em dados de obesidade que achei de
difícil compreensão.<br>
<br>
Abraco,<br>
Alexandre<br>
<br>
On 08/26/2011 02:03 PM, Walmes Zeviani wrote:
<blockquote
cite="mid:CAFU=EkbjzwkiEniKzaR5chMwKEm+ROSEqFfKLNmOjmL78vBYTw@mail.gmail.com"
type="cite"><font face="trebuchet ms,sans-serif">Alexandre,<br>
<br>
Melhor forma de entender a saída e conhecer a partida. Assim,
simule de um experimento onde você conhece o valor dos
contrastes e veja o que a função retorna. Fiz isso com um
exemplo normal, coloquei variância pequena só para não ter muita
diferença entre parâmetros (theta) e estimativas. Veja se fica
claro.<br>
<br>
<span style="font-family: courier new,monospace;">da <-
expand.grid(A=gl(2,1), B=gl(3,1), rept=1:4)</span><br
style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">X <-
model.matrix(~A*B, da)</span><br style="font-family: courier
new,monospace;">
<span style="font-family: courier new,monospace;">colnames(X)</span><br
style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">theta <-
c(10,1,0,-1,0,0)</span><br style="font-family: courier
new,monospace;">
<span style="font-family: courier new,monospace;">da$y <-
X%*%theta+rnorm(nrow(X),0,0.001)</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~A*B, da)</span><br style="font-family: courier
new,monospace;">
<br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">require(contrast)</span><br
style="font-family: courier new,monospace;">
<br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">c1 <-
contrast(m0,</span><br style="font-family: courier
new,monospace;">
<span style="font-family: courier new,monospace;">
list(A=levels(da$A), B="1"),</span><br style="font-family:
courier new,monospace;">
<span style="font-family: courier new,monospace;">
list(A=levels(da$A), B="2"))</span><br style="font-family:
courier new,monospace;">
<span style="font-family: courier new,monospace;">c1</span><br
style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;"># fez B1 vs B2
dentro de A1 e dentro de A2</span><br style="font-family:
courier new,monospace;">
<span style="font-family: courier new,monospace;">cbind(t(c1$X),
theta)</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">c1$X%*%theta</span><br
style="font-family: courier new,monospace;">
<br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">c2 <-
contrast(m0,</span><br style="font-family: courier
new,monospace;">
<span style="font-family: courier new,monospace;">
list(A=levels(da$A), B="1"),</span><br style="font-family:
courier new,monospace;">
<span style="font-family: courier new,monospace;">
list(A=levels(da$A), B="3"))</span><br style="font-family:
courier new,monospace;">
<span style="font-family: courier new,monospace;"># fez B1 vs B2
dentro de A1 e dentro de A2</span><br style="font-family:
courier new,monospace;">
<span style="font-family: courier new,monospace;">c2</span><br
style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">cbind(t(c2$X),
theta)</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">c2$X%*%theta</span><br
style="font-family: courier new,monospace;">
<br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">c3 <-
contrast(m0,</span><br style="font-family: courier
new,monospace;">
<span style="font-family: courier new,monospace;">
list(A="1", B=levels(da$B)),</span><br style="font-family:
courier new,monospace;">
<span style="font-family: courier new,monospace;">
list(A="2", B=levels(da$B)))</span><br style="font-family:
courier new,monospace;">
<span style="font-family: courier new,monospace;"># fez A1 vs A2
dentro de B1, B2 e B3</span><br style="font-family: courier
new,monospace;">
<span style="font-family: courier new,monospace;">c3</span><br
style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">cbind(t(c3$X),
theta)</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">c3$X%*%theta</span><br
style="font-family: courier new,monospace;">
<br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">c4 <-
contrast(m0, type="average",</span><br style="font-family:
courier new,monospace;">
<span style="font-family: courier new,monospace;">
list(A="1", B=levels(da$B)),</span><br style="font-family:
courier new,monospace;">
<span style="font-family: courier new,monospace;">
list(A="2", B=levels(da$B)))</span><br style="font-family:
courier new,monospace;">
<span style="font-family: courier new,monospace;"># fez A1 vs A2
na média dos níveis de B (efeito principal)</span><br
style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">c4</span><br
style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">cbind(t(c4$X),
theta)</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">c4$X%*%theta</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
moz-do-not-send="true" 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
moz-do-not-send="true" 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>
<pre wrap="">
<fieldset class="mimeAttachmentHeader"></fieldset>
_______________________________________________
R-br mailing list
<a class="moz-txt-link-abbreviated" href="mailto:R-br@listas.c3sl.ufpr.br">R-br@listas.c3sl.ufpr.br</a>
<a class="moz-txt-link-freetext" href="https://listas.inf.ufpr.br/cgi-bin/mailman/listinfo/r-br">https://listas.inf.ufpr.br/cgi-bin/mailman/listinfo/r-br</a>
Leia o guia de postagem (<a class="moz-txt-link-freetext" href="http://www.leg.ufpr.br/r-br-guia">http://www.leg.ufpr.br/r-br-guia</a>) e forneça código mínimo reproduzível.</pre>
</blockquote>
<br>
</body>
</html>