<table cellspacing="0" cellpadding="0" border="0" ><tr><td valign="top" style="font: inherit;">Ok Fábio, vou conferir a análise bayesiana quando tiver um tempo. Quanto a solução do problema, encontrei um texto na web que pode ajudar, mas não estou conseguindo aplicar. Parece que tem haver com alteração nas funções. Mas não entendo muito desta parte de programação. Segue abaixo. Se vc enxergar uma luz e puder aplicar neste exemplo avise.<div><br></div><div>Obrigado.</div><div><br></div><div><span class="Apple-style-span" style="font-family: Helvetica, Arial, sans-serif; font-size: 21px; font-weight: bold; line-height: 25px; ">pedigreemm with one observation per individual </span></div><div><span class="Apple-style-span" style="border-collapse: collapse; font-family: Helvetica, Arial, sans-serif; line-height: 16px; "><pre style="margin-top: 0px; margin-right: 0px; margin-bottom: 1em; margin-left: 0px; padding-top: 0px; padding-right: 0px;
 padding-bottom: 0px; padding-left: 0px; font-family: monospace; line-height: 1.3em; font-size: 0.93em; width: 540px; overflow-x: auto; white-space: pre-wrap; word-wrap: break-word; ">Here is a somewhat crude fix; it adds an additional parameter
(checklevels) to the lmer_finalize and glmer_finalize functions in
lme4 that turns off the unwanted sanity check.  The default is
checklevels=TRUE, which maintains the previous behavior.  The
pedigreemm function is then changed to set checklevels=FALSE before
calling the appropriate finalizing function.  I'm running these
changes locally and they seem to work fine.

Comments or suggestions are welcome, as is consideration of this
change or some variant on it for inclusion in the pedigreemm and lme4
packages.


----- in lmer.R in the lme4 package -----
lmer_finalize <- function(fr, FL, start, REML, verbose, checklevels=TRUE)
{
...
### This checks that the number of levels in a grouping factor < n
### Only need to check the first factor because it is the one with
### the most levels.
    if (checklevels & !(length(levels(dm$flist[[1]])) < length(Y)))
...

glmer_finalize <- function(fr, FL, glmFit, start, nAGQ, verbose,
checklevels=TRUE)
{
...
### This checks that the number of levels in a grouping factor < n
### Only need to check the first factor because it is the one with
### the most levels.
    if (checklevels & !(length(levels(dm$flist[[1]])) < ncol(dm$Zt)))
...

----- in pedigree.R in the pedigreemm package -----
pedigreemm <-
    function(formula, data, family = NULL, REML = TRUE, pedigree = list(),
...
    lmf$checklevels <- FALSE;
    ans <- do.call(if (!is.null(lmf$glmFit)) lme4:::glmer_finalize
else lme4:::lmer_finalize, lmf)
...</pre></span><br>--- Em <b>dom, 22/5/11, Fabio Mathias Corrêa <i><fabio.ufla@yahoo.com.br></i></b> escreveu:<br><blockquote style="border-left: 2px solid rgb(16, 16, 255); margin-left: 5px; padding-left: 5px;"><br>De: Fabio Mathias Corrêa <fabio.ufla@yahoo.com.br><br>Assunto: Re: [R-br] Modelo Animal - Pedigreemm<br>Para: "r-br@listas.c3sl.ufpr.br" <r-br@listas.c3sl.ufpr.br><br>Data: Domingo, 22 de Maio de 2011, 22:22<br><br><div id="yiv2019252848"><div style="color:#000;background-color:#fff;font-family:times new roman, new york, times, serif;font-size:12pt;"><div><span><div>Qual o tipo de variável resposta que vc tem?</div><div><br></div><div>O fato de vc ter apenas uma repetição por indivíduo pode ser o problema!</div><div><br></div><div>A solução que posso oferecer é com o uso de Inferência Bayesiana. Tem uma library muito boa para glmm utilizando bayesiana, ela se chama MCMCglmm. Vc pode colocar a estrutura de
 covariância que desejar.</div><div><br></div><div>Ela é muito rápida, pelo menos nos exemplos que testei!!!</div><div><br></div><div>Qualquer coisa é só falar!</div><div><br></div><div>Valeu!!!</div></span></div><div> </div><div>        Fábio Mathias Corrêa<br><br></div><div>     Universidade Estadual de Santa Cruz<br>Departamento de Ciências Exatas e da
 Terra - DCET</div><br><br><div>Campus Soane Nazaré de Andrade, km 16 Rodovia Ilhéus-Itabuna<br>CEP 45662-900. Ilhéus-Bahia</div><div><br><br></div><div>Tel.: 73-3680-5076<br><div style="font-size:12pt;font-family:times, serif;"><div style="font-size:12pt;font-family:times, serif;"><font size="2" face="Arial"><hr size="1"><b><span style="font-weight:bold;">De:</span></b> Marcelo Cardoso mello <marcelo_cm32@yahoo.com.br><br><b><span style="font-weight:bold;">Para:</span></b> r-br@listas.c3sl.ufpr.br; Fabio Mathias Corrêa <fabio.ufla@yahoo.com.br><br><b><span style="font-weight:bold;">Enviadas:</span></b> Domingo, 22 de Maio de 2011 15:39<br><b><span style="font-weight:bold;">Assunto:</span></b> Re: [R-br] Modelo Animal - Pedigreemm<br></font><br><div id="yiv2019252848"><table cellspacing="0" cellpadding="0" border="0"><tbody><tr><td valign="top" style="font:inherit;">Ok Fábio, verifiquei no Technical note: An R package for fitting
 generalized linear mixed models in animal. Os exemplos tem dados do próprio pacote e consegui reproduzir. A questão é que estes exemplos tem mais de uma observação por indivíduo e no exemplo que estou pedindo um help tenho indivíduos sem repetição. Este é o problema que gostaria de contornar. Se tiver como resolver e um material sobre esta solução específica me indique. Se não tiver solução via R me avise também. <div><br></div><div>Grato.</div><div><br></div><div>Marcelo.<br><br>--- Em <b>sex, 20/5/11, Fabio Mathias Corrêa <i><fabio.ufla@yahoo.com.br></i></b> escreveu:<br><blockquote style="border-left:2px solid rgb(16, 16, 255);margin-left:5px;padding-left:5px;"><br>De: Fabio Mathias Corrêa <fabio.ufla@yahoo.com.br><br>Assunto: Re: [R-br] Modelo
 Animal - Pedigreemm<br>Para: "r-br@listas.c3sl.ufpr.br" <r-br@listas.c3sl.ufpr.br><br>Data: Sexta-feira, 20 de Maio de 2011, 16:08<br><br><div id="yiv2019252848"><div style="color:rgb(0, 0, 0);background-color:rgb(255, 255, 255);font-size:12pt;font-family:times, serif;"><div><span>Eu só consegui reproduzir o exemplo depois de ler o artigo. Recomendo o mesmo.</span></div><div><span><br></span></div><div>São dois artigos citados na library. Veja na documentação!</div><div><br></div><div>Valeu!!!</div><div> </div><div>        Fábio Mathias Corrêa<br><br></div><div>     Universidade Estadual de Santa Cruz<br>Departamento de Ciências Exatas e da Terra - DCET</div><br><br><div>Campus Soane Nazaré de Andrade, km 16 Rodovia Ilhéus-Itabuna<br>CEP 45662-900. Ilhéus-Bahia</div><div><br><br></div><div>Tel.: 73-3680-5076<br><div style="font-size:12pt;font-family:times, serif;"><div
 style="font-size:12pt;font-family:times, serif;"><font size="2" face="Arial"><hr size="1"><b><span style="font-weight:bold;">De:</span></b> Marcelo Cardoso mello <marcelo_cm32@yahoo.com.br><br><b><span style="font-weight:bold;">Para:</span></b> r-br@listas.c3sl.ufpr.br; Ivan Bezerra Allaman <ivanalaman@yahoo.com.br><br><b><span style="font-weight:bold;">Enviadas:</span></b> Sexta-feira, 20 de Maio de 2011 13:04<br><b><span style="font-weight:bold;">Assunto:</span></b> Re: [R-br] Modelo Animal - Pedigreemm<br></font><br><div id="yiv2019252848"><table cellspacing="0" cellpadding="0" border="0"><tbody><tr><td valign="top" style="font:inherit;">Certo Ivan. Corrigido o problema de digitação. Mas o erro persiste.<div>???????</div><div><br></div><div>Rode os dados abaixo:</div><div><br></div><div><div class="yiv2019252848MsoNormal" style="margin-bottom:0cm;margin-bottom:.0001pt;line-height:normal;"><span lang="EN-US"
 style="font-size:10.0pt;color:black;">Herd<-as.factor(c(1,2,1,2,1))</span><span lang="EN-US" style="font-size:8.0pt;color:black;"></span></div> 

<div class="yiv2019252848MsoNormal" style="margin-bottom:0cm;margin-bottom:.0001pt;line-height:normal;"><span lang="EN-US" style="font-size:10.0pt;color:black;">Animal<-as.factor(c(1,2,3,4,5))</span><span lang="EN-US" style="font-size:8.0pt;color:black;"></span></div> 

<div class="yiv2019252848MsoNormal" style="margin-bottom:0cm;margin-bottom:.0001pt;line-height:normal;"><span lang="EN-US" style="font-size:10.0pt;color:black;">Sire<-c(0,0,0,1,4)</span><span lang="EN-US" style="font-size:8.0pt;color:black;"></span></div> 

<div class="yiv2019252848MsoNormal" style="margin-bottom:0cm;margin-bottom:.0001pt;line-height:normal;"><span lang="EN-US" style="font-size:10.0pt;color:black;">Dam<-c(0,0,0,2,3)</span><span lang="EN-US" style="font-size:8.0pt;color:black;"></span></div> 

<div class="yiv2019252848MsoNormal" style="margin-bottom:0cm;margin-bottom:.0001pt;line-height:normal;"><span lang="EN-US" style="font-size:10.0pt;color:black;">Phenotyp<-c(100,130,120,110,140)</span><span lang="EN-US" style="font-size:8.0pt;color:black;"></span></div> 

<div class="yiv2019252848MsoNormal" style="margin-bottom:0cm;margin-bottom:.0001pt;line-height:normal;"><span lang="EN-US" style="font-size:10.0pt;color:black;"> </span><span lang="EN-US" style="font-size:8.0pt;color:black;"></span></div> 

<div class="yiv2019252848MsoNormal" style="margin-bottom:0cm;margin-bottom:.0001pt;line-height:normal;"><span lang="EN-US" style="font-size:10.0pt;color:black;">require(pedigreemm)</span><span lang="EN-US" style="font-size:8.0pt;color:black;"></span></div> 

<div class="yiv2019252848MsoNormal" style="margin-bottom:0cm;margin-bottom:.0001pt;line-height:normal;"><span lang="EN-US" style="font-size:10.0pt;color:black;"> </span><span lang="EN-US" style="font-size:8.0pt;color:black;"></span></div> 

<div class="yiv2019252848MsoNormal" style="margin-bottom:0cm;margin-bottom:.0001pt;line-height:normal;"><span lang="EN-US" style="font-size:10.0pt;color:black;">p<- pedigree(sire = Sire,</span><span lang="EN-US" style="font-size:8.0pt;color:black;"></span></div> 

<div class="yiv2019252848MsoNormal" style="margin-bottom:0cm;margin-bottom:.0001pt;line-height:normal;"><span lang="EN-US" style="font-size:10.0pt;color:black;">dam = Dam, label= 1:5)</span><span lang="EN-US" style="font-size:8.0pt;color:black;"></span></div> 

<div class="yiv2019252848MsoNormal" style="margin-bottom:0cm;margin-bottom:.0001pt;line-height:normal;"><span lang="EN-US" style="font-size:10.0pt;color:black;"> </span><span lang="EN-US" style="font-size:8.0pt;color:black;"></span></div> 

<div class="yiv2019252848MsoNormal" style="margin-bottom:0cm;margin-bottom:.0001pt;text-align:justify;line-height:normal;"><span lang="EN-US" style="font-size:10.0pt;color:black;">model<-pedigreemm(Phenotyp~
(1|Animal)+ Herd, pedigree=list(Animal=p))</span><span lang="EN-US" style="font-size:8.0pt;color:black;"></span></div> 

<div class="yiv2019252848MsoNormal" style="margin-bottom:0cm;margin-bottom:.0001pt;text-align:justify;line-height:normal;"><span lang="EN-US" style="font-size:10.0pt;color:black;"> </span><span lang="EN-US" style="font-size:8.0pt;color:black;"></span></div><br>--- Em <b>sex, 20/5/11, Ivan Bezerra Allaman <i><ivanalaman@yahoo.com.br></i></b> escreveu:<br><blockquote style="border-left:2px solid rgb(16, 16, 255);margin-left:5px;padding-left:5px;"><br>De: Ivan Bezerra Allaman <ivanalaman@yahoo.com.br><br>Assunto: Re: [R-br] Modelo Animal - Pedigreemm<br>Para: "R Brasil" <r-br@listas.c3sl.ufpr.br><br>Data: Sexta-feira, 20 de Maio de 2011, 11:59<br><br><div id="yiv2019252848"><div style="color:rgb(0, 0, 0);background-color:rgb(255, 255, 255);font-size:14pt;font-family:arial, helvetica, sans-serif;"><div><span>Olhe novamente para o seu exemplo. O fator 'Animal' está com seis observações!! Deveria estar como mesmo número de
 observações das demais fontes de variação e variáveis, ou seja, cinco observações.</span></div><div><span><br></span></div><div><span>Allaman</span></div><div><span>(S,f,P)</span></div><div> </div><div style="background-color:transparent;color:rgb(115, 115, 115);" align="center"><b>M.Sc Ivan Bezerra Allaman</b> <br>Zootecnista<br><font style="background-color:transparent;" face="comic sans ms" size="2"><font style="background-color:transparent;">Doutorando em Produção Animal/Aquicultura - UFLA</font> <br></font><font size="2"><i><b></b></i></font><font style="background-color:transparent;" face="comic sans ms" size="2">email e msn - ivanalaman@yahoo.com.br <br><font size="1">Tel:
 (35)3826-6608/9900-2924</font></font></div></div></div><br>-----Anexo incorporado-----<br><br><div class="yiv2019252848plainMail">_______________________________________________<br>R-br mailing list<br><a rel="nofollow">R-br@listas.c3sl.ufpr.br</a><br><a rel="nofollow" target="_blank" href="https://listas.inf.ufpr.br/cgi-bin/mailman/listinfo/r-br">https://listas.inf.ufpr.br/cgi-bin/mailman/listinfo/r-br</a><br></div></blockquote></div></td></tr></tbody></table></div><br>_______________________________________________<br>R-br mailing list<br><a rel="nofollow">R-br@listas.c3sl.ufpr.br</a><br><a rel="nofollow" target="_blank" href="https://listas.inf.ufpr.br/cgi-bin/mailman/listinfo/r-br">https://listas.inf.ufpr.br/cgi-bin/mailman/listinfo/r-br</a><br><br><br></div></div></div></div></div><br>-----Anexo incorporado-----<br><br><div class="yiv2019252848plainMail">_______________________________________________<br>R-br mailing list<br><a
 rel="nofollow">R-br@listas.c3sl.ufpr.br</a><br><a rel="nofollow" target="_blank" href="https://listas.inf.ufpr.br/cgi-bin/mailman/listinfo/r-br">https://listas.inf.ufpr.br/cgi-bin/mailman/listinfo/r-br</a><br></div></blockquote></div></td></tr></tbody></table></div><br><br></div></div></div></div></div><br>-----Anexo incorporado-----<br><br><div class="plainMail">_______________________________________________<br>R-br mailing list<br><a ymailto="mailto:R-br@listas.c3sl.ufpr.br" href="/mc/compose?to=R-br@listas.c3sl.ufpr.br">R-br@listas.c3sl.ufpr.br</a><br><a href="https://listas.inf.ufpr.br/cgi-bin/mailman/listinfo/r-br" target="_blank">https://listas.inf.ufpr.br/cgi-bin/mailman/listinfo/r-br</a><br></div></blockquote></div></td></tr></table>