<font face="trebuchet ms,sans-serif">JCF,<br><br>Você pode usar o que já está disponível na agricolae, no caso a função design.lsd() para gerar o delineamento. São funções eu recomendo os usuários aplicarem para fazer o sorteio dos níveis dos fatores às unidades experimentais. A partir dele você obtém a matriz do delineamento e daí o resto todo,<br>
<br><span style="font-family:courier new,monospace">require(agricolae)</span><br style="font-family:courier new,monospace"><span style="font-family:courier new,monospace">help(design.lsd, help_type="html")</span><br style="font-family:courier new,monospace">
<br style="font-family:courier new,monospace"><span style="font-family:courier new,monospace">varieties <- c("perricholi","yungay","maria bonita","tomasa")</span><br style="font-family:courier new,monospace">
<span style="font-family:courier new,monospace">lsd <- design.lsd(varieties, seed=23)</span><br style="font-family:courier new,monospace"><span style="font-family:courier new,monospace">lsd</span><br style="font-family:courier new,monospace">
<span style="font-family:courier new,monospace">str(lsd)</span><br style="font-family:courier new,monospace"><br style="font-family:courier new,monospace"><span style="font-family:courier new,monospace">X <- model.matrix(~row+col+varieties, data=lsd)</span><br style="font-family:courier new,monospace">
<span style="font-family:courier new,monospace">dim(X)</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">betas <- runif(ncol(X)) # use os valores paramétricos aqui</span><br style="font-family:courier new,monospace">
<span style="font-family:courier new,monospace">lsd$Ey <- X%*%betas     # valor esperado de y</span><br style="font-family:courier new,monospace"><span style="font-family:courier new,monospace">lsd$y <- rnorm(nrow(X), mean=lsd$Ey, sd=1) # realização de y</span><br style="font-family:courier new,monospace">
<span style="font-family:courier new,monospace">plot(y~varieties, lsd)</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>