<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">

<head>
<meta http-equiv=Content-Type content="text/html; charset=utf-8">
<meta name=Generator content="Microsoft Word 12 (filtered medium)">
<style>
<!--
 /* Font Definitions */
 @font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:"Trebuchet MS";
        panose-1:2 11 6 3 2 2 2 2 2 4;}
 /* Style Definitions */
 p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman","serif";}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
p
        {mso-style-priority:99;
        mso-margin-top-alt:auto;
        margin-right:0cm;
        mso-margin-bottom-alt:auto;
        margin-left:0cm;
        font-size:12.0pt;
        font-family:"Times New Roman","serif";}
span.EstiloDeEmail18
        {mso-style-type:personal-reply;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
.MsoChpDefault
        {mso-style-type:export-only;}
@page Section1
        {size:612.0pt 792.0pt;
        margin:70.85pt 3.0cm 70.85pt 3.0cm;}
div.Section1
        {page:Section1;}
-->
</style>
<!--[if gte mso 9]><xml>
 <o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
 <o:shapelayout v:ext="edit">
  <o:idmap v:ext="edit" data="1" />
 </o:shapelayout></xml><![endif]-->
</head>

<body lang=PT-BR link=blue vlink=purple>

<div class=Section1>

<p class=MsoNormal><span style='font-family:"Arial","sans-serif";color:#1F497D'>Muito
obrigado! Deu certo!</span><span style='font-family:"Arial","sans-serif"'><o:p></o:p></span></p>

<div>

<div>

<div>

<div>

<div>

<p class=MsoNormal style='margin-bottom:12.0pt'><span style='color:#1F497D'><o:p> </o:p></span></p>

<p class=MsoNormal style='margin-bottom:12.0pt'>Mauro,<o:p></o:p></p>

</div>

<p class=MsoNormal>A função as.layer esta no pacote latticeExtra. Tive que usar
o biocLite para instalar o pacote.<o:p></o:p></p>

</div>

<div>

<p class=MsoNormal style='margin-bottom:12.0pt'><br>
source("<a href="http://bioconductor.org/biocLite.R">http://bioconductor.org/biocLite.R</a>")<br>
biocLite("latticeExtra")<o:p></o:p></p>

</div>

<p class=MsoNormal style='margin-bottom:12.0pt'>Att.,<o:p></o:p></p>

</div>

<p class=MsoNormal style='margin-bottom:12.0pt'>Alisson<o:p></o:p></p>

</div>

</div>

<div>

<p class=MsoNormal><o:p> </o:p></p>

<div>

<p class=MsoNormal>2015-10-05 21:07 GMT-03:00 Mauro Sznelwar <<a
href="mailto:sznelwar@uol.com.br" target="_blank">sznelwar@uol.com.br</a>>:<o:p></o:p></p>

<div>

<div>

<p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span
style='font-family:"Arial","sans-serif";color:#1F497D'>Não consegui esta
função! Eu usei a biblioteca lattice para o xyplot, rodou o primeiro mas este
não rodou porque não reconhece o as.layer</span><o:p></o:p></p>

<p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span
style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'> </span><o:p></o:p></p>

<p class=MsoNormal style='mso-margin-top-alt:auto;margin-bottom:12.0pt'><span
style='font-family:"Courier New"'>xyplot(imoveis/(moveis+imoveis)~sqrt(tem),
data=db,<br>
       jitter.x=TRUE, ylim=c(0, NA))+<br>
    as.layer(xyplot(p~sqrt(tem), data=pred, type="l"))</span><o:p></o:p></p>

<div>

<div>

<p class=MsoNormal style='mso-margin-top-alt:auto;margin-bottom:12.0pt'><span
style='font-family:"Trebuchet MS","sans-serif";color:#1F497D'> </span><o:p></o:p></p>

<p class=MsoNormal style='mso-margin-top-alt:auto;margin-bottom:12.0pt'><span
style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'> </span><o:p></o:p></p>

<p class=MsoNormal style='mso-margin-top-alt:auto;margin-bottom:12.0pt'><span
style='font-family:"Trebuchet MS","sans-serif"'>O fato de não serem
significativos não é problema. Tem que ter em mente que parametrização você
usou e as hipóteses decorrentes. Nessa parametrização de estimativas por cela
(~trat-1), quando um trat tem estimativa 0, significa que a prob de mobilidade
é 0.5. Então esse teste de hipótese, apesar de feito e retornado, não traz nada
de interessante na maioria dos casos. Eu considero que os interesses sejam
sobre as diferenças entre trat e não se eles tem ou não prob=0.5.</span><o:p></o:p></p>

</div>

<div>

<p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span
style='font-family:"Trebuchet MS","sans-serif"'>Vamos agora aos potenciais
problemas. Os níveis A, B, B-12 e B-24 tem probabilidades amostrais nas bordas,
ou seja, 0 e 1. Na binomial, o espaço de p é (0, 1), ou seja, não os incluem.
No glm, tais valores são obtidos no limite, quando \eta = X\beta vai para
-\infty ou \infty, o p aproxima de 0 ou 1. Aplique o inverso da função de
ligação em -23 e verá que isso é zero. Pelo  sufixo que usou nos
tratamentos, isso tem cara avaliação no tempo, com algumas testemunhas (sem
sufixo), como é de costume em muitos experimentos. Uma solução, seria ajustar a
curva para usando de T-0 à T-12. As testemunhas ficam de fora. Obtenha para
elas o IC por perfil de verossimilhança, pois, embora o limite inferir e
estimativa sejam 0, o limite superior será algo >0 (inverta o raciocínio
para a outra borda).<br>
<br>
</span><span style='font-family:"Courier New"'>## Estimativa zero implica em
prob=0.5.<br>
glm_out$family$linkinv(0)<br>
glm_out$family$linkinv(-23)<br>
<br>
sub_data$tem <- as.numeric(gsub(x=sub_data$tratamento, "\\D",
""))<br>
<br>
db <- subset(sub_data, !<a href="http://is.na" target="_blank">is.na</a>(tem))<br>
<br>
xyplot(imoveis/(moveis+imoveis)~sqrt(tem), data=db,<br>
       jitter.x=TRUE)<br>
<br>
m0 <- glm(cbind(imoveis, moveis) ~ sqrt(tem),<br>
          family=binomial,
data=db)<br>
summary(m0)<br>
<br>
pred <- data.frame(tem=seq(0, 24, length.out=30))<br>
<br>
pred$p <- predict(m0, newdata=pred, type="response")<br>
<br>
xyplot(imoveis/(moveis+imoveis)~sqrt(tem), data=db,<br>
       jitter.x=TRUE, ylim=c(0, NA))+<br>
    as.layer(xyplot(p~sqrt(tem), data=pred, type="l"))<br>
</span><span style='font-family:"Trebuchet MS","sans-serif"'><br>
À disposição.</span><o:p></o:p></p>

</div>

<div>

<p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span
style='font-family:"Trebuchet MS","sans-serif"'>Walmes.</span><o:p></o:p></p>

</div>

<p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span
style='font-family:"Cambria Math","serif"'>​</span><o:p></o:p></p>

</div>

</div>

</div>

</div>

</div>

</div>


<br /><br />
<hr style='border:none; color:#909090; background-color:#B0B0B0; height: 1px; width: 99%;' />
<table style='border-collapse:collapse;border:none;'>
        <tr>
                <td style='border:none;padding:0px 15px 0px 8px'>
                        <a href="https://www.avast.com/antivirus">
                                <img border=0 src="http://static.avast.com/emails/avast-mail-stamp.png" alt="Avast logo" />
                        </a>
                </td>
                <td>
                        <p style='color:#3d4d5a; font-family:"Calibri","Verdana","Arial","Helvetica"; font-size:12pt;'>
                                Este email foi escaneado pelo Avast antivírus.
                                <br><a href="https://www.avast.com/antivirus">www.avast.com</a>
                        </p>
                </td>
        </tr>
</table>
<br />
</body>

</html>