<div dir="ltr">Se a única variável manipulada ("independente") foram os tratamentos, e a resposta é unicamente uma única variável também, matematicamente você não acaba com a mesma análise, apenas por caminhos diferentes?<div><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, Nov 4, 2020 at 12:28 PM Fernando Souza por (R-br) <<a href="mailto:r-br@listas.c3sl.ufpr.br">r-br@listas.c3sl.ufpr.br</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div>Boa tarde pessoal,</div><br><div>Estou analisando um experimento em Switchback com vacas leiteiras e estou com duvidas sobre a montagem do modelo. Gostaria da ajuda de vocês.</div><div>O experimento comparou dois tratamentos A e B. Utilizou 30 vacas, porém as vacas não foram avaliadas simultaneamente. 10 vacas entraram no momento 1, 10 entraram no momento 2 e 10 entraram no momento 3.  As vacas dentro de cada momento foram sorteadas para uma das duas sequencias possíveis  A-B-A  ou B-A-B, sendo a sequencia aplicadas em 3 períodos diferentes de igual duração.</div><div>Entendo que o desenho experimental desse trabalho é semelhante ao descrito nesse trabalho<span>:</span> <a href="https://link.getmailspring.com/link/6AAC746E-76FD-40C3-9BB7-28232AAC3000@getmailspring.com/0?redirect=https%3A%2F%2Fwww.sciencedirect.com%2Fscience%2Farticle%2Fpii%2FS0022030287802734&recipient=ci1ickBsaXN0YXMuYzNzbC51ZnByLmJy" title="https://www.sciencedirect.com/science/article/pii/S0022030287802734" target="_blank">https://www.sciencedirect.com/science/article/pii/S0022030287802734</a><br>sendo o block os momentos (1,2 e 3)</div><br><div>Porém nesse trabalho os autores utilizam o PROC GLM dos SAS. Eu no entanto desejo analisá-lo através da abordagem dos modelos mistos, com a função lme{nlme}</div><div>Fiz o seguinte modelo e gostaria de uma opinião para saber se o modelo está correto? Se não como posso melhorá-lo</div><br><div>dados<-structure(list(Bloco = structure(c(1L, 1L, 1L, 1L, 1L, 1L, 1L, <br>1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, <br>1L, 1L, 1L, 1L, 1L, 1L, 1L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, <br>2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, <br>2L, 2L, 2L, 2L, 2L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, <br>3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, <br>3L, 3L, 3L), .Label = c("1", "2", "3"), class = "factor"), Ordem = structure(c(1L, <br>1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 2L, 2L, <br>2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 1L, 1L, 1L, <br>1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 2L, 2L, 2L, 2L, <br>2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 1L, 1L, 1L, 1L, 1L, <br>1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 2L, 2L, 2L, 2L, 2L, 2L, <br>2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L), .Label = c("1", "2"), class = "factor"), <br>    Periodo = c(1L, 2L, 3L, 1L, 2L, 3L, 1L, 2L, 3L, 1L, 2L, 3L, <br>    1L, 2L, 3L, 1L, 2L, 3L, 1L, 2L, 3L, 1L, 2L, 3L, 1L, 2L, 3L, <br>    1L, 2L, 3L, 1L, 2L, 3L, 1L, 2L, 3L, 1L, 2L, 3L, 1L, 2L, 3L, <br>    1L, 2L, 3L, 1L, 2L, 3L, 1L, 2L, 3L, 1L, 2L, 3L, 1L, 2L, 3L, <br>    1L, 2L, 3L, 1L, 2L, 3L, 1L, 2L, 3L, 1L, 2L, 3L, 1L, 2L, 3L, <br>    1L, 2L, 3L, 1L, 2L, 3L, 1L, 2L, 3L, 1L, 2L, 3L, 1L, 2L, 3L, <br>    1L, 2L, 3L), Tratamento = structure(c(1L, 2L, 1L, 1L, 2L, <br>    1L, 1L, 2L, 1L, 1L, 2L, 1L, 2L, 1L, 2L, 2L, 1L, 2L, 2L, 1L, <br>    2L, 2L, 1L, 2L, 2L, 1L, 2L, 1L, 2L, 1L, 1L, 2L, 1L, 1L, 2L, <br>    1L, 1L, 2L, 1L, 1L, 2L, 1L, 1L, 2L, 1L, 2L, 1L, 2L, 2L, 1L, <br>    2L, 2L, 1L, 2L, 2L, 1L, 2L, 1L, 2L, 1L, 1L, 2L, 1L, 1L, 2L, <br>    1L, 1L, 2L, 1L, 1L, 2L, 1L, 1L, 2L, 1L, 2L, 1L, 2L, 2L, 1L, <br>    2L, 2L, 1L, 2L, 2L, 1L, 2L, 1L, 2L, 1L), .Label = c("A", <br>    "B"), class = "factor"), Sequencia = structure(c(1L, 1L, <br>    1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 2L, 2L, 2L, 2L, 2L, <br>    2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 1L, 1L, 1L, 1L, 1L, <br>    1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 2L, 2L, <br>    2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 1L, 1L, 1L, 1L, 1L, <br>    1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 2L, 2L, <br>    2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 1L, 1L, 1L), .Label = c("1", <br>    "2"), class = "factor"), Vacas = structure(c(1L, 1L, 1L, <br>    2L, 2L, 2L, 3L, 3L, 3L, 4L, 4L, 4L, 5L, 5L, 5L, 6L, 6L, 6L, <br>    7L, 7L, 7L, 8L, 8L, 8L, 9L, 9L, 9L, 10L, 10L, 10L, 11L, 11L, <br>    11L, 12L, 12L, 12L, 13L, 13L, 13L, 14L, 14L, 14L, 15L, 15L, <br>    15L, 16L, 16L, 16L, 17L, 17L, 17L, 18L, 18L, 18L, 19L, 19L, <br>    19L, 20L, 20L, 20L, 21L, 21L, 21L, 22L, 22L, 22L, 23L, 23L, <br>    23L, 24L, 24L, 24L, 25L, 25L, 25L, 26L, 26L, 26L, 27L, 27L, <br>    27L, 28L, 28L, 28L, 29L, 29L, 29L, 30L, 30L, 30L), .Label = c("1", <br>    "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", <br>    "13", "14", "15", "16", "17", "18", "19", "20", "21", "22", <br>    "23", "24", "25", "26", "27", "28", "29", "30"), class = "factor"), <br>    Leite = c(18.28, 15.73, 14.96, 16.08, 15.64, 15.41, 16.21, <br>    15.52, 14.93, 17.29, 14.52, 12.98, 13.28, 12.57, 12.31, 21.82, <br>    19.28, 18.75, 16.69, 15.15, 14, 17.11, 15.51, 14.73, 15.38, <br>    14.77, 13.37, 15.21, 14.46, 13.5, 12.67, 11.91, 11.55, 15.78, <br>    14.68, 14.61, 13.29, 12.12, 11.77, 17.32, 14.81, 14.66, 16.13, <br>    14.81, 14.29, 14.94, 13.45, 13.09, 15.27, 12.36, 11.29, 14.02, <br>    13, 12.06, 15.25, 14.9, 14.59, 12.44, 11.8, 11.56, 12.56, <br>    12.22, 7.68, 15.15, 14.56, 10.08, 14.26, 13.34, 10.21, 13.56, <br>    12.85, 8.9, 14.09, 14.63, 11.52, 17.7, 17.24, 14.89, 16.69, <br>    16.28, 12.25, 12.66, 12.14, 9, 18.74, 18.23, 14.98, 17.62, <br>    17.4, 15.67), Per = structure(c(1L, 2L, 3L, 1L, 2L, 3L, 1L, <br>    2L, 3L, 1L, 2L, 3L, 1L, 2L, 3L, 1L, 2L, 3L, 1L, 2L, 3L, 1L, <br>    2L, 3L, 1L, 2L, 3L, 1L, 2L, 3L, 1L, 2L, 3L, 1L, 2L, 3L, 1L, <br>    2L, 3L, 1L, 2L, 3L, 1L, 2L, 3L, 1L, 2L, 3L, 1L, 2L, 3L, 1L, <br>    2L, 3L, 1L, 2L, 3L, 1L, 2L, 3L, 1L, 2L, 3L, 1L, 2L, 3L, 1L, <br>    2L, 3L, 1L, 2L, 3L, 1L, 2L, 3L, 1L, 2L, 3L, 1L, 2L, 3L, 1L, <br>    2L, 3L, 1L, 2L, 3L, 1L, 2L, 3L), .Label = c("1", "2", "3"<br>    ), class = "factor")), class = "data.frame", row.names = c(NA, <br>-90L))</div><br><div>#install.packages("nlme")</div><div>library(nlme)</div><div>options(contrasts=c("contr.sum","contr.poly"))</div><div>controle<-lmeControl(maxIter = 200, msMaxIter = 200,opt = 'optim')</div><div>mlme <- lme(Leite ~Tratamento,random=~1|Bloco/Vacas/Per,control=controle, data=dados)</div><div>anova(mlme,type='marginal')</div><br>_______________________________________________<br>
R-br mailing list<br>
<a href="mailto:R-br@listas.c3sl.ufpr.br" target="_blank">R-br@listas.c3sl.ufpr.br</a><br>
<a href="https://listas.inf.ufpr.br/cgi-bin/mailman/listinfo/r-br" rel="noreferrer" target="_blank">https://listas.inf.ufpr.br/cgi-bin/mailman/listinfo/r-br</a><br>
Leia o guia de postagem (<a href="http://www.leg.ufpr.br/r-br-guia" rel="noreferrer" target="_blank">http://www.leg.ufpr.br/r-br-guia</a>) e forneça código mínimo reproduzível.<br>
</blockquote></div>