<html>
<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
Muito obrigado Éder,<br>
<br>
Foi muito útil sim, já estava largando mão,<br>
<br>
Redobrados agradecimentos,<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>
OrcID: orcid.org/0000-0001-8232-6722
Researchgate: <a class="moz-txt-link-freetext" href="https://www.researchgate.net/profile/Alexandre_Santos10">https://www.researchgate.net/profile/Alexandre_Santos10</a>
LinkedIn: <a class="moz-txt-link-freetext" href="https://br.linkedin.com/in/alexandre-dos-santos-87961635">https://br.linkedin.com/in/alexandre-dos-santos-87961635</a>
======================================================================
</pre>
<div class="moz-cite-prefix">Em 21/03/2016 09:21, Éder Comunello
escreveu:<br>
</div>
<blockquote
cite="mid:CABmC8gn1GLQeNXDQbLC=oXkgpG5gTpYnfB4Lzz7F5xA8bwOApQ@mail.gmail.com"
type="cite">
<div dir="ltr">
<div class="gmail_default"
style="font-family:verdana,sans-serif">Alexandre, bom dia!</div>
<div class="gmail_default"
style="font-family:verdana,sans-serif"><br>
</div>
<div class="gmail_default"
style="font-family:verdana,sans-serif">Se ainda lhe for útil,
segue uma sugestão...</div>
<div class="gmail_default"
style="font-family:verdana,sans-serif"><br>
</div>
<div class="gmail_default" style="">
<div class="gmail_default"><font face="monospace, monospace">###
<code r></font></div>
<div class="gmail_default"><font face="monospace, monospace">var1
<- rnorm(200,5,0.25)</font></div>
<div class="gmail_default"><font face="monospace, monospace">var2
<- 1:500</font></div>
<div class="gmail_default"><font face="monospace, monospace">var3
<- rnorm(100,5,0.25)</font></div>
<div class="gmail_default"><font face="monospace, monospace">var4
<- 500:1</font></div>
<div class="gmail_default"><font face="monospace, monospace"><br>
</font></div>
<div class="gmail_default"><font face="monospace, monospace">cor.prob
<- function(X){ <br>
</font></div>
<div class="gmail_default"><font face="monospace, monospace">
pair.SampSize <- crossprod(!<a
moz-do-not-send="true" href="http://is.na">is.na</a>(X)) </font></div>
<div class="gmail_default"><font face="monospace, monospace">
above1 <- row(pair.SampSize) <
col(pair.SampSize) </font></div>
<div class="gmail_default"><font face="monospace, monospace">
pair.df <- pair.SampSize[above1] - 2 </font></div>
<div class="gmail_default"><font face="monospace, monospace"><br>
</font></div>
<div class="gmail_default"><font face="monospace, monospace">
R <- cor(X, use="pair") </font></div>
<div class="gmail_default"><font face="monospace, monospace">
above2 <- row(R) < col(R) </font></div>
<div class="gmail_default"><font face="monospace, monospace">
r2 <- R[above2]^2 </font></div>
<div class="gmail_default"><font face="monospace, monospace">
Fstat <- (r2 * pair.df)/(1 - r2) </font></div>
<div class="gmail_default"><font face="monospace, monospace">
R[above2] <- 1 - pf(Fstat, 1, pair.df) </font></div>
<div class="gmail_default"><font face="monospace, monospace">
R </font></div>
<div class="gmail_default"><font face="monospace, monospace">
} </font></div>
<div class="gmail_default"><font face="monospace, monospace"><br>
</font></div>
<div class="gmail_default"><font face="monospace, monospace">tam
<- 100 # amostra <br>
</font></div>
<div class="gmail_default"><font face="monospace, monospace">n_sim
<- 99 # simulações </font></div>
<div class="gmail_default"><font face="monospace, monospace"><br>
</font></div>
<div class="gmail_default"><font face="monospace, monospace">RES
<- NULL <br>
</font></div>
<div class="gmail_default"><font face="monospace, monospace">for(i
in 1:n_sim){</font></div>
<div class="gmail_default"><font face="monospace, monospace">
dados <- sapply(c("var1", "var2", "var3", "var4"),
function(x) sample(get(x), 100))</font></div>
<div class="gmail_default"><font face="monospace, monospace">
correla <- round(cor.prob(dados),4) </font></div>
<div class="gmail_default"><font face="monospace, monospace">
res <- cbind(i, correla) </font></div>
<div class="gmail_default"><font face="monospace, monospace">
RES <- rbind(RES, res) </font></div>
<div class="gmail_default"><font face="monospace, monospace">} </font></div>
<div class="gmail_default"><font face="monospace, monospace"># </font></div>
<div class="gmail_default"><font face="monospace, monospace"><br>
</font></div>
<div class="gmail_default"><font face="monospace, monospace">RES[c(1:5,392:396),]</font></div>
<div class="gmail_default"><font face="monospace, monospace">#
i var1 var2 var3 var4</font></div>
<div class="gmail_default"><font face="monospace, monospace">#
var1 1 1.0000 0.8025 0.8451 0.9178</font></div>
<div class="gmail_default"><font face="monospace, monospace">#
var2 1 -0.0253 1.0000 0.6609 0.0106</font></div>
<div class="gmail_default"><font face="monospace, monospace">#
var3 1 -0.0198 0.0444 1.0000 0.4850</font></div>
<div class="gmail_default"><font face="monospace, monospace">#
var4 1 -0.0104 -0.2545 -0.0706 1.0000</font></div>
<div class="gmail_default"><font face="monospace, monospace">#
var1 2 1.0000 0.5200 0.1704 0.8461</font></div>
<div class="gmail_default"><font face="monospace, monospace">#
var4 98 0.1309 0.0332 -0.1361 1.0000</font></div>
<div class="gmail_default"><font face="monospace, monospace">#
var1 99 1.0000 0.1433 0.2047 0.3260</font></div>
<div class="gmail_default"><font face="monospace, monospace">#
var2 99 -0.1474 1.0000 0.5391 0.9524</font></div>
<div class="gmail_default"><font face="monospace, monospace">#
var3 99 -0.1279 -0.0621 1.0000 0.2885</font></div>
<div class="gmail_default"><font face="monospace, monospace">#
var4 99 -0.0992 -0.0060 0.1072 1.0000</font></div>
<div class="gmail_default"><font face="monospace, monospace">###
</code></font></div>
<div class="gmail_default"><font face="verdana, sans-serif"><br>
</font></div>
<div style="font-family:verdana,sans-serif"><br>
</div>
</div>
<div class="gmail_extra"><br clear="all">
<div>
<div class="gmail_signature">
<div dir="ltr">
<div>
<div dir="ltr">
<div>
<div dir="ltr">
<div>
<div dir="ltr"><font style="font-size:small"
face="arial, helvetica, sans-serif">
<div style="font-family:'trebuchet
ms',sans-serif;display:inline"></div>
</font><font style="font-size:12.8px"
face="arial, helvetica, sans-serif"><span
style="font-size:small">================================================</span><br>
Éder Comunello</font>
<div style="font-size:12.8px"><span
style="font-family:arial,helvetica,sans-serif">Agronomist
(UEM), MSc in Environ. Sciences (UEM)</span><font
face="arial, helvetica, sans-serif"><br>
</font></div>
<div style="font-size:12.8px">
<div style="font-size:small"><span
style="font-family:arial,helvetica,sans-serif">DSc
in Agricultural Systems
Engineering (USP/Esalq)</span><br>
</div>
<div><span style="font-size:small">Brazilian
Agricultural Research Corporation (</span><font
style="font-size:small" face="arial,
helvetica, sans-serif">Embrapa)</font></div>
<div>
<div><font style="font-size:small"
face="arial, helvetica, sans-serif">Dourados,
MS, Brazil </font><font size="2"
face="arial, helvetica, sans-serif">|<O>|</font></div>
<div style="font-size:small"><span
style="font-family:arial,helvetica,sans-serif">================================================</span><br>
</div>
</div>
</div>
<div style="font-size:small"><font
face="arial, helvetica, sans-serif">GEO, </font>-22.2752,
-54.8182, 408m<span
style="font-family:arial,helvetica,sans-serif"><br>
</span></div>
<div style="font-size:12.8px"><span
style="font-size:small;font-family:arial,helvetica,sans-serif">UTC-04:00
/ DST: UTC-03:00</span></div>
<div>
<div>
<div><br>
</div>
<div><br>
</div>
</div>
<div style="font-size:small"><br>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</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>
</body>
</html>