<font color="#000066"><font face="courier new,monospace">Amigos de R,</font></font><div><font color="#000066"><font face="courier new,monospace"><br></font></font></div><div><font color="#000066"><font face="courier new,monospace">Estou tentando comparar alguns métodos de estimação e um dos passos necessários é encontrar valores maximos ou minimos de vetores numéricos. </font></font></div>
<div><font color="#000066"><font face="courier new,monospace"><br></font></font></div><div><font color="#000066"><font face="courier new,monospace">O problema numero 1 é que quando comparo visualmente os vetores ocorre que ocasionalmente acontece 2 ou 3 empates nos valores máximos ou mínimos como no vetor abaixo. Reparem que o valor .7 aparece na posição 21 e 23. Mas quando utilizo a função which.max ou max eu so encontro a posição 23. POssivlemente ha alguma coisa relacionado com precisão nume´rica apesar de não fazer muito sentido no momento.</font></font></div>
<div><font color="#000066"><font face="courier new,monospace"><br></font></font></div><div><span class="Apple-style-span" style="border-collapse:separate;font-size:medium"><span class="Apple-style-span" style="font-size:13px;line-height:15px;text-align:-webkit-left"><pre tabindex="0" class="GJWPQFQDK4" style="font-family:'Lucida Console';font-size:10pt!important;outline-style:none;outline-width:initial;outline-color:initial;border-top-style:none;border-right-style:none;border-bottom-style:none;border-left-style:none;border-width:initial;border-color:initial;margin-top:0px;margin-bottom:0px;line-height:1.2">
<span class="GJWPQFQDN4 ace_keyword" style="white-space:pre-wrap!important;color:blue">> </span><span class="GJWPQFQDB4 ace_keyword" style="white-space:pre-wrap!important;color:blue">test.values$Youden
</span><span style="white-space:pre-wrap!important"> [1] 0.00 0.05 0.10 0.15 0.20 0.25 0.30 0.35 0.40 0.45 0.50 0.55 0.60 0.55 0.60 0.65 0.60 0.65 0.60 0.65
[21] 0.70 0.65 0.70 0.65 0.60 0.65 0.60 0.65 0.60 0.55 0.50 0.45 0.40 0.35 0.30 0.25 0.20 0.15 0.10 0.05
</span><span class="GJWPQFQDN4 ace_keyword" style="white-space:pre-wrap!important;color:blue">> </span><span class="GJWPQFQDB4 ace_keyword" style="white-space:pre-wrap!important;color:blue">max(test.values$Youden)
</span>[1] 0.7
<span class="GJWPQFQDF4"><span class="Apple-style-span" style="border-collapse:separate;font-family:Arial;line-height:normal;white-space:normal;font-size:medium"><span class="Apple-style-span" style="font-family:'Lucida Console';font-size:13px;line-height:15px;white-space:pre-wrap"><pre tabindex="0" class="GJWPQFQDK4" style="font-family:'Lucida Console';font-size:10pt!important;outline-style:none;outline-width:initial;outline-color:initial;border-top-style:none;border-right-style:none;border-bottom-style:none;border-left-style:none;border-width:initial;border-color:initial;white-space:pre-wrap!important;margin-top:0px;margin-bottom:0px;line-height:1.2">
<span class="GJWPQFQDN4 ace_keyword" style="white-space:pre;color:blue">> </span><span class="GJWPQFQDB4 ace_keyword" style="color:blue">which.max(test.values$Youden)
</span>[1] 23</pre></span></span></span><span class="GJWPQFQDN4 ace_keyword" style="white-space:pre-wrap!important;color:blue">> </span><span class="GJWPQFQDB4 ace_keyword" style="white-space:pre-wrap!important;color:blue">which(test.values$Youden==max(test.values$Youden))
</span><span style="white-space:pre-wrap!important">[1] 23
</span><span class="GJWPQFQDN4 ace_keyword" style="white-space:pre-wrap!important;color:blue">> </span><span class="GJWPQFQDB4 ace_keyword" style="white-space:pre-wrap!important;color:blue">test.values$Youden[21]==test.values$Youden[23]</span></pre>
<pre tabindex="0" class="GJWPQFQDK4" style="font-family:'Lucida Console';font-size:10pt!important;outline-style:none;outline-width:initial;outline-color:initial;border-top-style:none;border-right-style:none;border-bottom-style:none;border-left-style:none;border-width:initial;border-color:initial;margin-top:0px;margin-bottom:0px;line-height:1.2">
<span class="GJWPQFQDB4 ace_keyword" style="white-space:pre-wrap!important;color:blue"><pre tabindex="0" class="GJWPQFQDK4" style="color:rgb(0,0,0);font-family:'Lucida Console';font-size:10pt!important;outline-style:none;outline-width:initial;outline-color:initial;border-top-style:none;border-right-style:none;border-bottom-style:none;border-left-style:none;border-width:initial;border-color:initial;margin-top:0px;margin-bottom:0px;line-height:1.2">
<span style="white-space:pre-wrap!important">[1] FALSE</span></pre>
</span></pre><pre tabindex="0" class="GJWPQFQDK4" style="font-size:10pt!important;outline-style:none;outline-width:initial;outline-color:initial;border-top-style:none;border-right-style:none;border-bottom-style:none;border-left-style:none;border-width:initial;border-color:initial;margin-top:0px;margin-bottom:0px;line-height:1.2">
<font face="'courier new', monospace" color="#000066"><span class="GJWPQFQDB4 ace_keyword">O problema 2 é que quando de fato ocorrem empates a função which.max retorna somente a primeira posição. Então, a questão</span></font></pre>
<pre tabindex="0" class="GJWPQFQDK4" style="font-size:10pt!important;outline-style:none;outline-width:initial;outline-color:initial;border-top-style:none;border-right-style:none;border-bottom-style:none;border-left-style:none;border-width:initial;border-color:initial;margin-top:0px;margin-bottom:0px;line-height:1.2">
<font face="'courier new', monospace" color="#000066"><span class="GJWPQFQDB4 ace_keyword">seria como retornar todas as posições com valores máximos ou encontrar uma mediana dos valores empatados?
</span><span style="white-space:pre-wrap"><br></span></font></pre><pre tabindex="0" class="GJWPQFQDK4" style="font-size:10pt!important;outline-style:none;outline-width:initial;outline-color:initial;border-top-style:none;border-right-style:none;border-bottom-style:none;border-left-style:none;border-width:initial;border-color:initial;margin-top:0px;margin-bottom:0px;line-height:1.2">
<font face="'courier new', monospace" color="#000066"><span style="white-space:pre-wrap">Qualquer luz é bem vinda. </span></font></pre></span></span></div><div><font color="#000066"><font face="courier new,monospace"><br clear="all">
</font></font><font face="'courier new', monospace" style="background-color:rgb(255,255,255)" color="#000066">Dr. Pedro Emmanuel A. A. do Brasil</font><div><font face="'courier new', monospace" style="background-color:rgb(255,255,255)" color="#000066">Curriculum Lattes:
<span style="text-align:left"><a href="http://lattes.cnpq.br/6597654894290806" target="_blank">http://lattes.cnpq.br/6597654894290806</a></span> <br>Instituto de Pesquisa Clínica Evandro Chagas<br>Fundação Oswaldo Cruz<br>
Rio de Janeiro - Brasil<br>Av. Brasil 4365, <br>CEP 21040-360,<br>Tel 55 21 3865-9648<br>email: <a href="mailto:pedro.brasil@ipec.fiocruz.br" target="_blank">pedro.brasil@ipec.fiocruz.br</a><br>email: <a href="mailto:emmanuel.brasil@gmail.com" target="_blank">emmanuel.brasil@gmail.com</a><br>
<br>---Apoio aos softwares livres<br><a href="http://www.zotero.org" target="_blank">www.zotero.org</a> - gerenciamento de referências bibliográficas. <br><a href="http://www.broffice.org" target="_blank">www.broffice.org</a> ou <a href="http://www.libreoffice.org/" target="_blank">www.libreoffice.org</a> - textos, planilhas ou apresentações.<br>
<a href="http://www.epidata.dk" target="_blank">www.epidata.dk</a> - entrada de dados.<br><a href="http://www.r-project.org" target="_blank">www.r-project.org</a> - análise de dados.<br><a href="http://www.ubuntu.com" target="_blank">www.ubuntu.com</a> - sistema operacional</font></div>
<br>
</div>