<div><font face="trebuchet ms,sans-serif">Éder,</font></div><div><font face="trebuchet ms,sans-serif"><br></font></div><div><font face="trebuchet ms,sans-serif">Agora entendi suas colocações. Bem, dessa maneira acredito que o modelo deva ser declarado dessa maneira.</font></div>
<div><font face="trebuchet ms,sans-serif"><br></font></div><div><div><font face="courier new, monospace">#------------------------------------------------------------------------------------------</font></div><div><font face="courier new, monospace"># modelo com efeito aleatório e local, cultivar, local:cultivar e resídual</font></div>
<div><font face="courier new, monospace"># só é possível estimar resídual se haver repetições dentro de locais:cultivar</font></div><div><font face="courier new, monospace"><br></font></div><div><font face="courier new, monospace"># número de níveis</font></div>
<div><font face="courier new, monospace">nl <- 10; nc <- 8; nr <- 3</font></div><div><font face="courier new, monospace"># efeitos aleatórios</font></div><div><font face="courier new, monospace">l <- rnorm(nl,0,2); # de local</font></div>
<div><font face="courier new, monospace">c <- rnorm(nc,0,1.5); # de cultivar</font></div><div><font face="courier new, monospace">lc <- rnorm(nl*nc,0,1); # de local:cultivar (interação genótipo:ambiente)</font></div>
<div><font face="courier new, monospace">e <- rnorm(nl*(nc+nr),0,0.5) # residual, var entre rep no mesmo local:cult</font></div><div><font face="courier new, monospace"><br></font></div><div><font face="courier new, monospace"># dados artificiais</font></div>
<div><font face="courier new, monospace">da1 <- expand.grid(local=gl(nl,1), cultivar=gl(nc,1), r=1)</font></div><div><font face="courier new, monospace">da2 <- expand.grid(local=gl(nl,1), cultivar=gl(nr,1), r=2)</font></div>
<div><font face="courier new, monospace">da <- rbind(da1, da2)</font></div><div><font face="courier new, monospace"><br></font></div><div><font face="courier new, monospace"># matriz de delineamento</font></div><div><font face="courier new, monospace">Z <- with(da, cbind(model.matrix(~-1+local),</font></div>
<div><font face="courier new, monospace"> model.matrix(~-1+cultivar),</font></div><div><font face="courier new, monospace"> model.matrix(~-1+local:cultivar)))</font></div><div><font face="courier new, monospace">dim(Z)</font></div>
<div><font face="courier new, monospace">ranef <- c(l, c, lc)</font></div><div><font face="courier new, monospace">length(ranef)</font></div><div><font face="courier new, monospace">y <- Z%*%ranef+e</font></div><div>
<font face="courier new, monospace"><br></font></div><div><font face="courier new, monospace">require(lme4)</font></div><div><font face="courier new, monospace"><br></font></div><div><font face="courier new, monospace">m0 <- lmer(y~(1|local)+(1|cultivar)+(1|local:cultivar), data=da)</font></div>
<div><font face="courier new, monospace">summary(m0)</font></div><div><font face="courier new, monospace"><br></font></div><div><font face="courier new, monospace">#------------------------------------------------------------------------------------------</font></div>
<div style="font-family:'trebuchet ms',sans-serif"><br></div><div style="font-family:'trebuchet ms',sans-serif">À disposição.</div><div style="font-family:'trebuchet ms',sans-serif">Walmes.</div></div>
<font face="trebuchet ms,sans-serif"><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><br>
skype: walmeszeviani<br style="font-family:trebuchet ms,sans-serif"></span><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>