<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=iso-8859-1"><meta name=Generator content="Microsoft Word 15 (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;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri","sans-serif";
        mso-fareast-language:EN-US;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:#0563C1;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:#954F72;
        text-decoration:underline;}
pre
        {mso-style-priority:99;
        mso-style-link:"Pré-formatação HTML Char";
        margin:0in;
        margin-bottom:.0001pt;
        font-size:10.0pt;
        font-family:"Courier New";}
span.EstiloDeEmail17
        {mso-style-type:personal-compose;
        font-family:"Calibri","sans-serif";
        color:windowtext;}
span.Pr-formataoHTMLChar
        {mso-style-name:"Pré-formatação HTML Char";
        mso-style-priority:99;
        mso-style-link:"Pré-formatação HTML";
        font-family:"Courier New";
        mso-fareast-language:PT-BR;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-family:"Calibri","sans-serif";
        mso-fareast-language:EN-US;}
@page WordSection1
        {size:8.5in 11.0in;
        margin:70.85pt 85.05pt 70.85pt 85.05pt;}
div.WordSection1
        {page:WordSection1;}
--></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="#0563C1" vlink="#954F72"><div class=WordSection1><pre>Prezados,<o:p></o:p></pre><pre><o:p> </o:p></pre><pre>Estou com uma dúvida que pode parecer besteira, porém gostaria da ajuda <o:p></o:p></pre><pre>de vocês! A dúvida é a seguinte<o:p></o:p></pre><pre><o:p> </o:p></pre><pre>como calcular o percentual de "Bias" (percentage prediction error) por <o:p></o:p></pre><pre>linha de um modelo ZINB (package- pscl)? O meu objetivo é fazer um boxplot com esse percentual por ano <o:p></o:p></pre><pre>Eu iniciei da seguinte forma:<o:p></o:p></pre><pre>dois bancos de dados um de try.csv (10% retirados do banco original) e outro original.csv<o:p></o:p></pre><pre><br><span lang=EN-US>try<-read.csv(”try.csv”, header = TRUE, sep = ",", quote="\"", dec=".",fill = TRUE)<o:p></o:p></span></pre><pre><a href="https://www.dropbox.com/s/v7vruztus11nnbi/try.csv" target="_top"><span lang=EN-US>https://www.dropbox.com/s/v7vruztus11nnbi/try.csv</span></a><span lang=EN-US><o:p></o:p></span></pre><pre><span lang=EN-US> <o:p></o:p></span></pre><pre><span lang=EN-US>original<-read.csv(”original.csv”, header = TRUE, sep = ",", quote="\"", dec=".",fill = TRUE)<o:p></o:p></span></pre><pre><span lang=EN-US> </span><a href="https://www.dropbox.com/s/7htqc2bqi45rkku/original.csv" target="_top"><span lang=EN-US style='color:#0066CC'>https://www.dropbox.com/s/7htqc2bqi45rkku/original.csv</span></a><span lang=EN-US><o:p></o:p></span></pre><pre># Criar Fatores para o banco original<br>original$area<-rep(1,nrow(original))<br>original$area[original$lat<=-15&original$lat>=-45]<-2<br>original$A=as.factor(original$area)<br>summary(original)<o:p></o:p></pre><pre>original$S<-factor(original$id.group.fleet)<br>original$Q<-factor(original$Quarter)<br>original$Y<-factor(original$Year)<o:p></o:p></pre><pre>original$logEf<-log(original$effort1)<o:p></o:p></pre><pre>summary(original)<o:p></o:p></pre><pre># Criar Fatores para o banco try<o:p></o:p></pre><pre><span lang=EN-US>try$area<-rep(1,nrow(try))<br>try$area[try$lat<=-15&try$lat>=-45]<-2<br>try$A=as.factor(try$area)<br>summary(try)<o:p></o:p></span></pre><pre><span lang=EN-US>try$S<-factor(try$id.group.fleet)<br>try$Q<-factor(try$Quarter)<br>try$Y<-factor(try$Year)<br>try$logEf<-try$effort1*0<br>summary(try)<o:p></o:p></span></pre><pre><span lang=EN-US> <o:p></o:p></span></pre><pre><span lang=EN-US>zeroinfl.fit_original<-zeroinfl(BSH~Y+S+Q+A+offset(logEf)|Y+S+Q+A,dist="negbin",data=original)<o:p></o:p></span></pre><pre><span lang=EN-US>pred<-predict(zeroinfl.fit_original,newdata=try,type="response")<o:p></o:p></span></pre><pre><span lang=EN-US> <o:p></o:p></span></pre><pre>Daqui em diante não tenho mais ideia de como gerar esse percentage prediction error<o:p></o:p></pre><pre> <o:p></o:p></pre><pre>Alguem poderia me ajudar!<o:p></o:p></pre><pre>Desde já Agradeço<o:p></o:p></pre><pre> <o:p></o:p></pre><pre>Humberto <o:p></o:p></pre><p class=MsoNormal><o:p> </o:p></p></div></body></html>