<html>
  <head>
    <meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    Boa noite Hélio,<br>
    <br>
            Estou mexendo ainda, mas ainda não funcionou, veja o CRM
    abaixo, comparando a sua função e a do Walmes:<br>
    <br>
    #Variáveis artificiais<br>
    var1<-sort(rnorm(30,1), decreasing = TRUE)<br>
    var2<-rnorm(30,10)<br>
    var3<-sort(rnorm(30,22))<br>
    var4<-sort(rnorm(30,10))<br>
    var5<-sort(rnorm(30,0.5), decreasing = TRUE)<br>
    var6<-sort(rnorm(30,25), decreasing = TRUE)<br>
    var7<-rnorm(30,10)<br>
    dados<-cbind(var1,var2,var3,var4,var5,var6,var7)<br>
    <br>
    #Função by IFSULDEMINAS<br>
    cor.probC <- function(x){<br>
    <br>
        results <- x<br>
        ifelse(row(x)<
    col(x),ifelse(x<=0.05,NA,x),ifelse(x<=0.08,NA,x))<br>
    }<br>
    #<br>
    <br>
    #Teste<br>
    cor.probC(dados)<br>
    <br>
    <br>
    require(Hmisc)## Pacote<br>
    <br>
    <br>
    #Função que dispõem p valor na diagonal superior e r valor na
    inferior<br>
    <br>
    pn <- function(X){crossprod(!is.na(X))}<br>
    <br>
    cor.prob <- function(X){<br>
        pair.SampSize <- pn(X)<br>
        above1 <- row(pair.SampSize) < col(pair.SampSize)<br>
        pair.df <- pair.SampSize[above1] - 2<br>
        R <- cor(X, use="pair")<br>
        above2 <- row(R) < col(R)<br>
        r2 <- R[above2]^2<br>
        Fstat <- (r2 * pair.df)/(1 - r2)<br>
        R[above2] <- 1 - pf(Fstat, 1, pair.df)<br>
        R<br>
    }<br>
    <br>
    #Resultado da matriz<br>
    cor.prob(dados)<br>
    #<br>
    <br>
    <pre class="moz-signature" cols="72">-- 
======================================================================
Alexandre dos Santos
Proteção Florestal 
IFMT - Instituto Federal de Educação, Ciência e Tecnologia de Mato Grosso
Campus Cáceres
Caixa Postal 244
Avenida dos Ramires, s/n
Bairro: Distrito Industrial 
Cáceres - MT                      CEP: 78.200-000
Fone: (+55) 65 8132-8112 (TIM)   (+55) 65 9686-6970 (VIVO)
<a class="moz-txt-link-abbreviated" href="mailto:e-mails:alexandresantosbr@yahoo.com.br">e-mails:alexandresantosbr@yahoo.com.br</a> 
        <a class="moz-txt-link-abbreviated" href="mailto:alexandre.santos@cas.ifmt.edu.br">alexandre.santos@cas.ifmt.edu.br</a> 
Lattes: <a class="moz-txt-link-freetext" href="http://lattes.cnpq.br/1360403201088680">http://lattes.cnpq.br/1360403201088680</a>                   
======================================================================</pre>
    <br>
    <br>
    <br>
    <br>
    <br>
    <br>
    <div class="moz-cite-prefix">Em 29/08/2015 11:35, Hélio Gallo Rocha
      escreveu:<br>
    </div>
    <blockquote
cite="mid:CA+ppPW7EM0tq-3j4ha-cOthd_djz8FCm0PEd0VLTnt2h4Q3LZA@mail.gmail.com"
      type="cite">
      <div dir="ltr">Alexandre,
        <div><br>
        </div>
        <div>Conseguimos resolver, mas não rodando dentro da função,
          testa ai</div>
        <div><br>
        </div>
        <div>
          <div>correla <- cor.prob(dados) </div>
          <div>correla</div>
          <div>  </div>
          <div> </div>
          <div>corr <- ifelse(row(correla)<
col(correla),ifelse(correla<=0.05,NA,correla),ifelse(correla<=0.08,NA,correla));corr</div>
        </div>
        <div><br>
        </div>
        <div><br>
        </div>
        <div class="gmail_extra"><br>
          <div class="gmail_quote">Em 24 de agosto de 2015 16:50,
            ASANTOS [via R-br] <span dir="ltr"><<a
                moz-do-not-send="true"
                href="mailto:ml-node+s2285057n4664976h24@n4.nabble.com"
                target="_blank"><a class="moz-txt-link-abbreviated" href="mailto:ml-node+s2285057n4664976h24@n4.nabble.com">ml-node+s2285057n4664976h24@n4.nabble.com</a></a>></span>
            escreveu:<br>
            <blockquote class="gmail_quote" style="margin:0px 0px 0px
0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
              Boa tarde Helio,<br>
              <br>
                    Ainda não estou quebrando a cabeça nas partes above1
              <- row(pair.SampSize) < col(pair.SampSize) e  above2
              <- row(R) < col(R) que é onde vão as condições, mas
              esse é um caso para Programming master em R. Se funcionar
              essa seria uma boa função para seleção de variáveis
              multivariadas quando se trabalha com um p muito grande,<br>
              <br>
                    Vou continuar tentando,<br>
              <br>
              Abraços,<span><br>
                <br>
                <br>
                <pre cols="72">-- 
======================================================================
Alexandre dos Santos
Proteção Florestal 
IFMT - Instituto Federal de Educação, Ciência e Tecnologia de Mato Grosso
Campus Cáceres
Caixa Postal 244
Avenida dos Ramires, s/n
Bairro: Distrito Industrial 
Cáceres - MT                      CEP: 78.200-000
Fone: <a moz-do-not-send="true" href="tel:%28%2B55%29%2065%208132-8112" value="+556581328112" target="_blank">(+55) 65 8132-8112</a> (TIM)   <a moz-do-not-send="true" href="tel:%28%2B55%29%2065%209686-6970" value="+556596866970" target="_blank">(+55) 65 9686-6970</a> (VIVO)
<a moz-do-not-send="true" href="http:///user/SendEmail.jtp?type=node&node=4664976&i=0" rel="nofollow" link="external" target="_blank">[hidden email]</a> 
        <a moz-do-not-send="true" href="http:///user/SendEmail.jtp?type=node&node=4664976&i=1" rel="nofollow" link="external" target="_blank">[hidden email]</a> 
Lattes: <a moz-do-not-send="true" href="http://lattes.cnpq.br/1360403201088680" rel="nofollow" link="external" target="_blank">http://lattes.cnpq.br/1360403201088680</a>                   
======================================================================
</pre>
                <br>
                <br>
              </span><span>
                <div>Em 24/08/2015 15:35, Hélio Gallo Rocha escreveu:<br>
                </div>
              </span>
              <blockquote
                style="border-left-width:2px;border-left-style:solid;border-left-color:rgb(204,204,204);padding:0px
                1em" type="cite"><span>
                  <div dir="ltr"><span
                      style="font-size:12.8000001907349px">Alexandre,</span>
                    <div style="font-size:12.8000001907349px"><br>
                    </div>
                    <div style="font-size:12.8000001907349px">Conseguiu
                      resolver esta questão?</div>
                    <div style="font-size:12.8000001907349px"><br>
                    </div>
                    <div style="font-size:12.8000001907349px">Olhei o
                      site sugerido pelo Walmes, mas ñ consegui inserir
                      na função.</div>
                    <div style="font-size:12.8000001907349px"><br>
                    </div>
                    <div style="font-size:12.8000001907349px">Se der
                      resultado, posta na lista, pois a é bem
                      iteressante.</div>
                    <div style="font-size:12.8000001907349px"><br>
                    </div>
                    <div style="font-size:12.8000001907349px">Abraço</div>
                  </div>
                </span>
                <div>
                  <div>
                    <div class="gmail_extra"><br>
                      <div class="gmail_quote">Em 19 de agosto de 2015
                        21:38, Walmes Zeviani 2 [via R-br] <span
                          dir="ltr"><<a moz-do-not-send="true"
                            href="http:///user/SendEmail.jtp?type=node&node=4664976&i=2"
                            rel="nofollow" link="external"
                            target="_blank">[hidden email]</a>></span>
                        escreveu:<br>
                        <blockquote
                          style="border-left-width:2px;border-left-style:solid;border-left-color:rgb(204,204,204);padding:0px
                          1em" class="gmail_quote">
                          <div dir="ltr">
                            <div class="gmail_default"
                              style="font-family:'trebuchet
                              ms',sans-serif">Isso pode servir de
                              inspiração.<br>
                              <br>
                              <a moz-do-not-send="true"
href="http://stackoverflow.com/questions/9439619/using-r-replace-all-values-in-a-matrix-0-1-with-0"
                                rel="nofollow" link="external"
                                target="_blank">http://stackoverflow.com/questions/9439619/using-r-replace-all-values-in-a-matrix-0-1-with-0</a><br>
                              <br>
                              À disposição.<br>
                            </div>
                            <div class="gmail_default"
                              style="font-family:'trebuchet
                              ms',sans-serif">Walmes.<br>
                            </div>
                            ​</div>
                          <span> <br>
                            _______________________________________________

                            <br>
                            R-br mailing list <br>
                            <a moz-do-not-send="true"
                              href="http:///user/SendEmail.jtp?type=node&node=4664945&i=0"
                              rel="nofollow" link="external"
                              target="_blank">[hidden email]</a> <br>
                            <a moz-do-not-send="true"
                              href="https://listas.inf.ufpr.br/cgi-bin/mailman/listinfo/r-br"
                              rel="nofollow" link="external"
                              target="_blank">https://listas.inf.ufpr.br/cgi-bin/mailman/listinfo/r-br</a><br>
                            Leia o guia de postagem (<a
                              moz-do-not-send="true"
                              href="http://www.leg.ufpr.br/r-br-guia"
                              rel="nofollow" link="external"
                              target="_blank"><a class="moz-txt-link-freetext" href="http://www.leg.ufpr.br/r-br-guia">http://www.leg.ufpr.br/r-br-guia</a></a>)
                            e forneça código mínimo reproduzível. <br>
                            <br>
                            <hr noshade="noshade" size="1"
                              color="#cccccc"> </span>
                          <div
style="color:rgb(68,68,68);font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:12px;line-height:normal;font-family:tahoma,geneva,helvetica,arial,sans-serif"><span>
                              <div style="font-weight:bold">If you reply
                                to this email, your message will be
                                added to the discussion below:</div>
                            </span><a moz-do-not-send="true"
href="http://r-br.2285057.n4.nabble.com/R-br-Exibicao-de-matriz-de-correlacao-dada-uma-condicao-tp4664911p4664945.html"
                              rel="nofollow" link="external"
                              target="_blank">http://r-br.2285057.n4.nabble.com/R-br-Exibicao-de-matriz-de-correlacao-dada-uma-condicao-tp4664911p4664945.html</a>
                          </div>
                          <div>
                            <div>
                              <div
style="color:rgb(102,102,102);font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:11px;font-family:tahoma,geneva,helvetica,arial,sans-serif;margin-top:0.4em;line-height:1.5em">
                                To unsubscribe from R-br, <a
                                  moz-do-not-send="true" rel="nofollow"
                                  link="external">click here</a>.<br>
                                <a moz-do-not-send="true"
href="http://r-br.2285057.n4.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml"
                                  rel="nofollow"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:9px;line-height:normal;font-family:serif"
                                  link="external" target="_blank">NAML</a>
                              </div>
                            </div>
                          </div>
                        </blockquote>
                      </div>
                      <br>
                      <br clear="all">
                      <div><br>
                      </div>
                      -- <br>
                      <div>Hélio Gallo Rocha<br>
                        IFSULDEMINAS - Câmpus Muzambinho<br>
                      </div>
                    </div>
                    <br>
                    <fieldset></fieldset>
                    <br>
                    <pre>_______________________________________________
R-br mailing list
<a moz-do-not-send="true" href="http:///user/SendEmail.jtp?type=node&node=4664976&i=3" rel="nofollow" link="external" target="_blank">[hidden email]</a>
<a moz-do-not-send="true" href="https://listas.inf.ufpr.br/cgi-bin/mailman/listinfo/r-br" rel="nofollow" link="external" target="_blank">https://listas.inf.ufpr.br/cgi-bin/mailman/listinfo/r-br</a>
Leia o guia de postagem (<a moz-do-not-send="true" href="http://www.leg.ufpr.br/r-br-guia" rel="nofollow" link="external" target="_blank">http://www.leg.ufpr.br/r-br-guia</a>) e forneça código mínimo reproduzível.</pre>
                  </div>
                </div>
              </blockquote>
              <div>
                <div> <br>
                  <br>
                  _______________________________________________
                  <br>
                  R-br mailing list
                  <br>
                  <a moz-do-not-send="true"
                    href="http:///user/SendEmail.jtp?type=node&node=4664976&i=4"
                    rel="nofollow" link="external" target="_blank">[hidden
                    email]</a>
                  <br>
                  <a moz-do-not-send="true"
                    href="https://listas.inf.ufpr.br/cgi-bin/mailman/listinfo/r-br"
                    rel="nofollow" link="external" target="_blank">https://listas.inf.ufpr.br/cgi-bin/mailman/listinfo/r-br</a><br>
                  Leia o guia de postagem (<a moz-do-not-send="true"
                    href="http://www.leg.ufpr.br/r-br-guia"
                    rel="nofollow" link="external" target="_blank">http://www.leg.ufpr.br/r-br-guia</a>)
                  e forneça código mínimo reproduzível. <br>
                  <br>
                  <hr noshade="noshade" size="1" color="#cccccc"> </div>
              </div>
              <div
style="color:rgb(68,68,68);font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:12px;line-height:normal;font-family:tahoma,geneva,helvetica,arial,sans-serif">
                <div>
                  <div>
                    <div style="font-weight:bold">If you reply to this
                      email, your message will be added to the
                      discussion below:</div>
                  </div>
                </div>
                <a moz-do-not-send="true"
href="http://r-br.2285057.n4.nabble.com/R-br-Exibicao-de-matriz-de-correlacao-dada-uma-condicao-tp4664911p4664976.html"
                  target="_blank">http://r-br.2285057.n4.nabble.com/R-br-Exibicao-de-matriz-de-correlacao-dada-uma-condicao-tp4664911p4664976.html</a>
              </div>
              <div>
                <div>
                  <div
style="color:rgb(102,102,102);font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:11px;font-family:tahoma,geneva,helvetica,arial,sans-serif;margin-top:0.4em;line-height:1.5em">
                    To unsubscribe from R-br, <a moz-do-not-send="true"
href="http://r-br.2285057.n4.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=3357982&code=aGVsaW9nYWxsb3JvY2hhQGdtYWlsLmNvbXwzMzU3OTgyfC0xMzQ3NTkwMDY4"
                      target="_blank">click here</a>.<br>
                    <a moz-do-not-send="true"
href="http://r-br.2285057.n4.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml"
                      rel="nofollow"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:9px;line-height:normal;font-family:serif"
                      target="_blank">NAML</a> </div>
                </div>
              </div>
            </blockquote>
          </div>
          <br>
          <br clear="all">
          <div><br>
          </div>
          -- <br>
          <div>Hélio Gallo Rocha<br>
            IFSULDEMINAS - Câmpus Muzambinho<br>
          </div>
        </div>
      </div>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
      <pre wrap="">_______________________________________________
R-br mailing list
<a class="moz-txt-link-abbreviated" href="mailto:R-br@listas.c3sl.ufpr.br">R-br@listas.c3sl.ufpr.br</a>
<a class="moz-txt-link-freetext" href="https://listas.inf.ufpr.br/cgi-bin/mailman/listinfo/r-br">https://listas.inf.ufpr.br/cgi-bin/mailman/listinfo/r-br</a>
Leia o guia de postagem (<a class="moz-txt-link-freetext" href="http://www.leg.ufpr.br/r-br-guia">http://www.leg.ufpr.br/r-br-guia</a>) e forneça código mínimo reproduzível.</pre>
    </blockquote>
    <br>
    <pre class="moz-signature" cols="72">
</pre>
  </body>
</html>