<div dir="ltr"><div dir="ltr"><div class="gmail_default" style="font-family:trebuchet ms,sans-serif">Respostas dentro da mensagem.</div></div><div dir="ltr"><br></div><div style="font-family:trebuchet ms,sans-serif" class="gmail_default">À disposição.</div><div style="font-family:trebuchet ms,sans-serif" class="gmail_default">Walmes.</div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, Nov 28, 2019 at 2:49 PM Luiz Leal <<a href="mailto:richfield1974@yahoo.com">richfield1974@yahoo.com</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><div style="font-family:Helvetica Neue,Helvetica,Arial,sans-serif;font-size:13px"></div><div style="font-family:Helvetica Neue,Helvetica,Arial,sans-serif;font-size:13px">
</div><div style="font-family:Helvetica Neue,Helvetica,Arial,sans-serif;font-size:13px" dir="ltr">Prezado Walmes, muito obrigado.</div><div style="font-family:Helvetica Neue,Helvetica,Arial,sans-serif;font-size:13px" dir="ltr"><br></div><div style="font-family:Helvetica Neue,Helvetica,Arial,sans-serif;font-size:13px" dir="ltr"><br></div><div style="font-family:Helvetica Neue,Helvetica,Arial,sans-serif;font-size:13px" dir="ltr">Pelo que entendi não é possível <span><span style="text-align:left;color:rgb(29,34,40);text-transform:none;text-indent:0px;letter-spacing:normal;font-family:monospace;font-size:13px;font-style:normal;font-variant:normal;font-weight:400;text-decoration:none;word-spacing:0px;display:inline;white-space:normal;float:none;background-color:rgb(255,255,255)">"sigma^2_b"</span></span> e <span><span style="text-align:left;color:rgb(29,34,40);text-transform:none;text-indent:0px;letter-spacing:normal;font-family:monospace;font-size:13px;font-style:normal;font-variant:normal;font-weight:400;text-decoration:none;word-spacing:0px;display:inline;white-space:normal;float:none;background-color:rgb(255,255,255)">"sigma^2_e"</span></span> utilizando a função gls().</div></div></blockquote><div><span class="gmail_default" style="font-family:trebuchet ms,sans-serif">Não. Tem-se que usar um modelo de efeitos aleatórios.</span> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div><div style="font-family:Helvetica Neue,Helvetica,Arial,sans-serif;font-size:13px"><b></b><i></i><u></u><sub></sub><sup></sup><strike></strike><b></b><i></i><u></u><sub></sub><sup></sup><strike></strike><br></div><div style="font-family:Helvetica Neue,Helvetica,Arial,sans-serif;font-size:13px" dir="ltr"><span><span style="text-align:left;color:rgb(29,34,40);text-transform:none;text-indent:0px;letter-spacing:normal;font-family:Helvetica Neue,Helvetica,Arial,sans-serif;font-size:13px;font-style:normal;font-variant:normal;font-weight:400;text-decoration:none;word-spacing:0px;display:inline;white-space:normal;float:none;background-color:rgb(255,255,255)">A função VarCorr(modelo2) fornece <span><span style="text-align:left;color:rgb(0,0,0);text-transform:none;text-indent:0px;letter-spacing:normal;font-family:Helvetica Neue,Helvetica,Arial,sans-serif;font-size:13px;font-style:normal;font-variant:normal;font-weight:400;text-decoration:none;word-spacing:0px;white-space:normal"><span style="background-color:rgb(255,255,255);color:rgb(29,34,40);display:inline;float:none;font-family:monospace;font-size:13px;font-style:normal;font-variant:normal;font-weight:400;letter-spacing:normal;text-align:left;text-decoration:none;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px">"sigma^2_b"</span></span><span style="text-align:left;color:rgb(0,0,0);text-transform:none;text-indent:0px;letter-spacing:normal;font-family:Helvetica Neue,Helvetica,Arial,sans-serif;font-size:13px;font-style:normal;font-variant:normal;font-weight:400;text-decoration:none;word-spacing:0px;display:inline;white-space:normal;float:none;background-color:rgb(255,255,255)"> e </span><span style="text-align:left;color:rgb(0,0,0);text-transform:none;text-indent:0px;letter-spacing:normal;font-family:Helvetica Neue,Helvetica,Arial,sans-serif;font-size:13px;font-style:normal;font-variant:normal;font-weight:400;text-decoration:none;word-spacing:0px;white-space:normal"><span style="background-color:rgb(255,255,255);color:rgb(29,34,40);display:inline;float:none;font-family:monospace;font-size:13px;font-style:normal;font-variant:normal;font-weight:400;letter-spacing:normal;text-align:left;text-decoration:none;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px">"sigma^2_e"</span></span></span>, correto?</span></span></div></div></blockquote><div style="font-family:trebuchet ms,sans-serif" class="gmail_default">Sim. Mas a interpretação é mais específica. "sigma^2_e" é a variância do erro ao redor do ponto médio da curva em um ponto específico do suporte da covariável que eu imagino ser o 0. A variância em outros pontos da curva será outra, obviamente, porque você declarou um modelo heterocedástico.</div><div class="gmail_default"><span style="font-family:monospace"><br></span></div><div style="font-family:trebuchet ms,sans-serif" class="gmail_default"><span style="font-family:monospace"># Média ajustada.<br>m <- unique(fitted(modelo2))<br><br># Modelo ajustado.<br>plot(y ~ as.integer(x))<br>lines(m ~ seq_along(m))<br><br># Variância estimada é função da média.<br># s2(v) = exp(2* t * v)<br>var_estim <- 6041.676 * exp(2 * 0.0009743905 * m)<br>var_amost <- tapply(y, x, var)<br>cbind(var_amost, var_estim)<br><br># Resíduos crus e padronizados.<br>plot(residuals(modelo2) ~ fitted(modelo2))<br>plot(residuals(modelo2, type = "pearson") ~ fitted(modelo2))<br><br># Calculando o resíduo padronizado.<br>r_my <- residuals(modelo2)/<br> sqrt(6041.676 * exp(2 * 0.0009743905 * fitted(modelo2)))<br><br># Comparação.<br>cbind(r_my, residuals(modelo2, type = "pearson"))</span><br></div><div style="font-family:trebuchet ms,sans-serif" class="gmail_default"><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><div style="font-family:Helvetica Neue,Helvetica,Arial,sans-serif;font-size:13px" dir="ltr"><b></b><i></i><u></u><sub></sub><sup></sup><strike></strike><br></div><div style="font-family:Helvetica Neue,Helvetica,Arial,sans-serif;font-size:13px" dir="ltr"> Variance StdDev <br>(Intercept) 667641.149 817.09311<br>Residual 6041.696 77.72834</div><b></b><i></i><u></u><sub></sub><sup></sup><strike></strike><div style="font-family:Helvetica Neue,Helvetica,Arial,sans-serif;font-size:13px" dir="ltr"><br></div><div style="font-family:Helvetica Neue,Helvetica,Arial,sans-serif;font-size:13px" dir="ltr">Tenho uma dúvida: a variância do intercepto é <span><span style="text-align:left;color:rgb(0,0,0);text-transform:none;text-indent:0px;letter-spacing:normal;font-family:Helvetica Neue,Helvetica,Arial,sans-serif;font-size:13px;font-style:normal;font-variant:normal;font-weight:400;text-decoration:none;word-spacing:0px;white-space:normal"><span style="background-color:rgb(255,255,255);color:rgb(29,34,40);display:inline;float:none;font-family:monospace;font-size:13px;font-style:normal;font-variant:normal;font-weight:400;letter-spacing:normal;text-align:left;text-decoration:none;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px">"sigma^2_b"</span></span></span>?</div></div></blockquote><div><span class="gmail_default" style="font-family:trebuchet ms,sans-serif">Sim.</span></div><div><br><span class="gmail_default" style="font-family:trebuchet ms,sans-serif"></span><span class="gmail_default" style="font-family:trebuchet ms,sans-serif"></span></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div><div style="font-family:Helvetica Neue,Helvetica,Arial,sans-serif;font-size:13px" dir="ltr"><br></div><div style="font-family:Helvetica Neue,Helvetica,Arial,sans-serif;font-size:13px" dir="ltr"><br></div><div style="font-family:Helvetica Neue,Helvetica,Arial,sans-serif;font-size:13px" dir="ltr">Muito obrigado. Sua contribuição está sendo muito válida no meu trabalho.</div><div style="font-family:Helvetica Neue,Helvetica,Arial,sans-serif;font-size:13px" dir="ltr">Luiz</div></div></blockquote></div></div>