<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=Windows-1252">
<style type="text/css" style="display:none;"><!-- P {margin-top:0;margin-bottom:0;} --></style>
</head>
<body dir="ltr">
<div id="divtagdefaultwrapper" dir="ltr" style="font-size:12pt; color:rgb(0,0,0); font-family:Calibri,Helvetica,sans-serif,"EmojiFont","Apple Color Emoji","Segoe UI Emoji",NotoColorEmoji,"Segoe UI Symbol","Android Emoji",EmojiSymbols">
<p>Boa tarde!</p>
<p><br>
</p>
<p>Prezados, <br>
</p>
<p>estou tentando ajustar o número de filhos/mulheres para 4 municípios a partir do modelo de poisson e ZIP.</p>
<p><br>
</p>
<p>1) Tentei colocar no modelo o número de filhos/mulheres (Y), mas o resultado foi:</p>
<p></p>
<pre tabindex="0" class="GCWXI2KCJKB" id="rstudio_console_output" style="font-family: 'Lucida Console'; font-size: 10pt !important; outline: none; border: none; word-break: break-all; margin: 0px; -webkit-user-select: text; white-space: pre-wrap !important; line-height: 15px; color: rgb(0, 0, 0); font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: -webkit-left; text-indent: 0px; text-transform: none; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: rgb(255, 255, 255);"><span class="GCWXI2KCDKB  ace_constant" style="color: rgb(197, 6, 11);">Error: não é possível encontrar valores iniciais válidos: especifique alguns</span></pre>
Não sei se isso está relacionado com o fato desse vetor ter como respostas NaN e Inf. ou pq o Y seja mesmo o C (número de filhos).<br>
<p></p>
<p><br>
</p>
<p><span>2) E para plotar o gráfico de linhas com o número de filhos/mulheres já ajustado pelo modelo o comando (inicialmente) seria<br>
</span></p>
<p><span></span></p>
<div>plot(F$Idade, (modelo.z$fitted.values)) ?<br>
</div>
<p></p>
<p><br>
</p>
<p>3) e qual comando posso usar para ter um gráfico para cada município?<br>
</p>
<p><br>
</p>
<p>C= número de filhos segundo a idade simples da mulher</p>
<p>M = número de mulheres por idade simples</p>
<p>Idade = as idades simples das mulheres.</p>
<p><br>
</p>
<p>###saída GLM<br>
</p>
<p></p>
<div>
<pre tabindex="0" class="GCWXI2KCJKB" id="rstudio_console_output" style="font-family: 'Lucida Console'; font-size: 10pt !important; outline: none; border: none; word-break: break-all; margin: 0px; -webkit-user-select: text; white-space: pre-wrap !important; line-height: 15px; color: rgb(0, 0, 0); font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: -webkit-left; text-indent: 0px; text-transform: none; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: rgb(255, 255, 255);"><pre tabindex="0" class="GCWXI2KCJKB" id="rstudio_console_output" style="font-family: 'Lucida Console'; font-size: 10pt !important; outline: none; border: none; word-break: break-all; margin: 0px; -webkit-user-select: text; white-space: pre-wrap !important; line-height: 15px; color: rgb(0, 0, 0); font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: -webkit-left; text-indent: 0px; text-transform: none; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: rgb(255, 255, 255);">Call:
glm(formula = C ~ M + Idade, family = poisson(), data = F)

Deviance Residuals: 
    Min       1Q   Median       3Q      Max  
-7.3875  -2.6026  -2.3316   0.9828   9.5008  

Coefficients:
              Estimate Std. Error z value Pr(>|z|)    
(Intercept)  1.2374245  0.1272825   9.722   <2e-16 ***
M            0.0051281  0.0002939  17.451   <2e-16 ***
Idade       -0.0073104  0.0035070  -2.084   0.0371 *  
---
Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1

(Dispersion parameter for poisson family taken to be 1)

    Null deviance: 2080.1  on 163  degrees of freedom
Residual deviance: 1675.9  on 161  degrees of freedom
AIC: 1941.2

Number of Fisher Scoring iterations: 6
</pre><br class="Apple-interchange-newline"><br class="Apple-interchange-newline"></pre>
##Saída ZIP</div>
<div>
<pre tabindex="0" class="GCWXI2KCJKB" id="rstudio_console_output" style="font-family: 'Lucida Console'; font-size: 10pt !important; outline: none; border: none; word-break: break-all; margin: 0px; -webkit-user-select: text; white-space: pre-wrap !important; line-height: 15px; color: rgb(0, 0, 0); font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: -webkit-left; text-indent: 0px; text-transform: none; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: rgb(255, 255, 255);"><span class="GCWXI2KCDKB  ace_constant" style="color: rgb(197, 6, 11);"><br></span></pre>
<pre tabindex="0" class="GCWXI2KCJKB" id="rstudio_console_output" style="font-family: 'Lucida Console'; font-size: 10pt !important; outline: none; border: none; word-break: break-all; margin: 0px; -webkit-user-select: text; white-space: pre-wrap !important; line-height: 15px; color: rgb(0, 0, 0); font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: -webkit-left; text-indent: 0px; text-transform: none; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: rgb(255, 255, 255);">Call:
zeroinfl(formula = C ~ M + Idade, data = F, dist = "poisson")

Pearson residuals:
    Min      1Q  Median      3Q     Max 
-2.1522 -0.6622 -0.5179  0.4001  3.8106 

Count model coefficients (poisson with log link):
              Estimate Std. Error z value Pr(>|z|)    
(Intercept)  2.1878890  0.1359308  16.096   <2e-16 ***
M            0.0035164  0.0003052  11.521   <2e-16 ***
Idade       -0.0026143  0.0040649  -0.643     0.52    

Zero-inflation model coefficients (binomial with logit link):
             Estimate Std. Error z value Pr(>|z|)   
(Intercept)  0.277153   0.538864   0.514  0.60702   
M           -0.005364   0.001954  -2.745  0.00605 **
Idade        0.022874   0.015151   1.510  0.13111   
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 

Number of iterations in BFGS optimization: 14 
Log-likelihood: -389.5 on 6 Df</pre>
<br>
</div>
Desde já agradeço!
<p></p>
<p>Anna Cruz.<br>
</p>
<p><br>
</p>
</div>
</body>
</html>