<span class="Apple-style-span" style="border-collapse: collapse; font-family: arial, sans-serif; font-size: 13px; ">Esqueci, poderia criar esta matrix por partes, porem no problema real os niveis são desbalanceados, complicando a confecção na "mão".</span><br>
<br><div class="gmail_quote">Em 4 de junho de 2011 16:54, Eder David Borges da Silva <span dir="ltr"><<a href="mailto:eder@leg.ufpr.br">eder@leg.ufpr.br</a>></span> escreveu:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div>Pessoal, </div><div>gostaria da ajuda de vocês para criar uma matrix do modelo, como exemplo abaixo:</div><div>LOCAL <- rep(c('local1','local2'),each=4)</div><div>Rep <- 1:8</div><div>CLONE <- rep(1:2,4)</div>

<div>BLOCO <- rep(1:4,each=2)</div><div>dados <- data.frame(LOCAL,BLOCO,CLONE,Rep)</div><div>dados$Int <- paste(dados$LOCAL,dados$CLONE,sep='')</div><div>dados$Obs <- 1</div><div>dados$TCH <- sort(rnorm(nrow(dados),10,1))</div>

<div><br></div><div>dados$IND <- as.factor(dados$IND)</div><div>dados$CLONE <- as.factor(dados$CLONE)</div><div>dados$BLOCO <- as.factor(dados$BLOCO)</div><div>summary(dados)</div><div><br></div><div>op <- options(contrasts=c("contr.treatment", "contr.poly"))</div>

<div>MM <- model.matrix(~BLOCO+CLONE+LOCAL:CLONE,dados)</div><div>MM</div><div><span style="font-family:'DejaVu Sans Mono';font-size:13px;line-height:17px;white-space:pre-wrap"><pre style="font-family:'DejaVu Sans Mono';font-size:10pt !important;outline-style:none;outline-width:initial;outline-color:initial;border-top-style:none;border-right-style:none;border-bottom-style:none;border-left-style:none;border-width:initial;border-color:initial;white-space:pre-wrap !important;margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px;line-height:1.3">
  (Intercept) BLOCO2 BLOCO3 BLOCO4 CLONE2 CLONE1:LOCALlocal2 CLONE2:LOCALlocal2
1           1      0      0      0      0                  0                  0
2           1      0      0      0      1                  0                  0
3           1      1      0      0      0                  0                  0
4           1      1      0      0      1                  0                  0
5           1      0      1      0      0                  1                  0
6           1      0      1      0      1                  0                  1
7           1      0      0      1      0                  1                  0
8           1      0      0      1      1                  0                  1</pre><pre style="font-family:'DejaVu Sans Mono';font-size:10pt !important;outline-style:none;outline-width:initial;outline-color:initial;border-top-style:none;border-right-style:none;border-bottom-style:none;border-left-style:none;border-width:initial;border-color:initial;white-space:pre-wrap !important;margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px;line-height:1.3">
esta foi a matrix criado pelo model.matrix, porem gostaria de uma matrix diferente, pois nesta criada pela model.matrix o bloco1 não aparece pois é estimado por direfença, assim como o clone1, eu quero que todos os niveis aparecem tendo como nome das colunas: </pre>

<pre style="font-family:'DejaVu Sans Mono';font-size:10pt !important;outline-style:none;outline-width:initial;outline-color:initial;border-top-style:none;border-right-style:none;border-bottom-style:none;border-left-style:none;border-width:initial;border-color:initial;white-space:pre-wrap !important;margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px;line-height:1.3">
<pre style="font-family:'DejaVu Sans Mono';font-size:10pt !important;outline-style:none;outline-width:initial;outline-color:initial;border-top-style:none;border-right-style:none;border-bottom-style:none;border-left-style:none;border-width:initial;border-color:initial;white-space:pre-wrap !important;margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px;line-height:1.3">
 (Intercept) BLOCO1 BLOCO2 BLOCO3 BLOCO4 CLONE1 CLONE2 CLONE1:LOCAL1 CLONE1:LOCAL2 CLONE2:LOCAL1 CLONE2:LOCAL2</pre><pre style="font-family:'DejaVu Sans Mono';font-size:10pt !important;outline-style:none;outline-width:initial;outline-color:initial;border-top-style:none;border-right-style:none;border-bottom-style:none;border-left-style:none;border-width:initial;border-color:initial;white-space:pre-wrap !important;margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px;line-height:1.3">
Alguem tem uma dica?</pre><pre style="font-family:'DejaVu Sans Mono';font-size:10pt !important;outline-style:none;outline-width:initial;outline-color:initial;border-top-style:none;border-right-style:none;border-bottom-style:none;border-left-style:none;border-width:initial;border-color:initial;white-space:pre-wrap !important;margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px;line-height:1.3">
Att</pre></pre></span></div>
</blockquote></div><br>