<div dir="ltr"><div class="gmail_default" style="font-family:verdana,sans-serif">Alexandre, boa tarde!</div><div class="gmail_default" style="font-family:verdana,sans-serif"><br></div><div class="gmail_default" style="font-family:verdana,sans-serif">Só uma curiosidade... O resultado final que você deseja é realmente uma matriz mista (correlações e probalidades)?</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 face="arial, helvetica, sans-serif" style="font-size:small"><div style="font-family:'trebuchet ms',sans-serif;display:inline"></div></font><font face="arial, helvetica, sans-serif" style="font-size:12.8px"><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 face="arial, helvetica, sans-serif" style="font-size:small">Embrapa)</font></div><div><div><font face="arial, helvetica, sans-serif" style="font-size:small">Dourados, MS, Brazil </font><font face="arial, helvetica, sans-serif" size="2">|<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>
<br><div class="gmail_quote">Em 21 de março de 2016 11:02, ASANTOS <span dir="ltr"><<a href="mailto:alexandresantosbr@yahoo.com.br" target="_blank">alexandresantosbr@yahoo.com.br</a>></span> escreveu:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div bgcolor="#FFFFFF" text="#000000">
Muito obrigado Éder,<br>
<br>
Foi muito útil sim, já estava largando mão,<br>
<br>
Redobrados agradecimentos,<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 href="tel:%28%2B55%29%2065%208132-8112" value="+556581328112" target="_blank">(+55) 65 8132-8112</a> (TIM) <a href="tel:%28%2B55%29%2065%209686-6970" value="+556596866970" target="_blank">(+55) 65 9686-6970</a> (VIVO)
<a href="mailto:e-mails:alexandresantosbr@yahoo.com.br" target="_blank">e-mails:alexandresantosbr@yahoo.com.br</a>
<a href="mailto:alexandre.santos@cas.ifmt.edu.br" target="_blank">alexandre.santos@cas.ifmt.edu.br</a>
Lattes: <a href="http://lattes.cnpq.br/1360403201088680" target="_blank">http://lattes.cnpq.br/1360403201088680</a>
OrcID: <a href="http://orcid.org/0000-0001-8232-6722" target="_blank">orcid.org/0000-0001-8232-6722</a>
Researchgate: <a href="https://www.researchgate.net/profile/Alexandre_Santos10" target="_blank">https://www.researchgate.net/profile/Alexandre_Santos10</a>
LinkedIn: <a href="https://br.linkedin.com/in/alexandre-dos-santos-87961635" target="_blank">https://br.linkedin.com/in/alexandre-dos-santos-87961635</a>
======================================================================
</pre>
<div>Em 21/03/2016 09:21, Éder Comunello
escreveu:<br>
</div>
<blockquote type="cite">
<div dir="ltr">
<div style="font-family:verdana,sans-serif">Alexandre, bom dia!</div>
<div style="font-family:verdana,sans-serif"><br>
</div>
<div style="font-family:verdana,sans-serif">Se ainda lhe for útil,
segue uma sugestão...</div>
<div style="font-family:verdana,sans-serif"><br>
</div>
<div>
<div><font face="monospace, monospace">###
<code r></font></div>
<div><font face="monospace, monospace">var1
<- rnorm(200,5,0.25)</font></div>
<div><font face="monospace, monospace">var2
<- 1:500</font></div>
<div><font face="monospace, monospace">var3
<- rnorm(100,5,0.25)</font></div>
<div><font face="monospace, monospace">var4
<- 500:1</font></div>
<div><font face="monospace, monospace"><br>
</font></div>
<div><font face="monospace, monospace">cor.prob
<- function(X){ <br>
</font></div>
<div><font face="monospace, monospace">
pair.SampSize <- crossprod(!<a href="http://is.na" target="_blank">is.na</a>(X)) </font></div>
<div><font face="monospace, monospace">
above1 <- row(pair.SampSize) <
col(pair.SampSize) </font></div>
<div><font face="monospace, monospace">
pair.df <- pair.SampSize[above1] - 2 </font></div>
<div><font face="monospace, monospace"><br>
</font></div>
<div><font face="monospace, monospace">
R <- cor(X, use="pair") </font></div>
<div><font face="monospace, monospace">
above2 <- row(R) < col(R) </font></div>
<div><font face="monospace, monospace">
r2 <- R[above2]^2 </font></div>
<div><font face="monospace, monospace">
Fstat <- (r2 * pair.df)/(1 - r2) </font></div>
<div><font face="monospace, monospace">
R[above2] <- 1 - pf(Fstat, 1, pair.df) </font></div>
<div><font face="monospace, monospace">
R </font></div>
<div><font face="monospace, monospace">
} </font></div>
<div><font face="monospace, monospace"><br>
</font></div>
<div><font face="monospace, monospace">tam
<- 100 # amostra <br>
</font></div>
<div><font face="monospace, monospace">n_sim
<- 99 # simulações </font></div>
<div><font face="monospace, monospace"><br>
</font></div>
<div><font face="monospace, monospace">RES
<- NULL <br>
</font></div>
<div><font face="monospace, monospace">for(i
in 1:n_sim){</font></div>
<div><font face="monospace, monospace">
dados <- sapply(c("var1", "var2", "var3", "var4"),
function(x) sample(get(x), 100))</font></div>
<div><font face="monospace, monospace">
correla <- round(cor.prob(dados),4) </font></div>
<div><font face="monospace, monospace">
res <- cbind(i, correla) </font></div>
<div><font face="monospace, monospace">
RES <- rbind(RES, res) </font></div>
<div><font face="monospace, monospace">} </font></div>
<div><font face="monospace, monospace"># </font></div>
<div><font face="monospace, monospace"><br>
</font></div>
<div><font face="monospace, monospace">RES[c(1:5,392:396),]</font></div>
<div><font face="monospace, monospace">#
i var1 var2 var3 var4</font></div>
<div><font face="monospace, monospace">#
var1 1 1.0000 0.8025 0.8451 0.9178</font></div>
<div><font face="monospace, monospace">#
var2 1 -0.0253 1.0000 0.6609 0.0106</font></div>
<div><font face="monospace, monospace">#
var3 1 -0.0198 0.0444 1.0000 0.4850</font></div>
<div><font face="monospace, monospace">#
var4 1 -0.0104 -0.2545 -0.0706 1.0000</font></div>
<div><font face="monospace, monospace">#
var1 2 1.0000 0.5200 0.1704 0.8461</font></div>
<div><font face="monospace, monospace">#
var4 98 0.1309 0.0332 -0.1361 1.0000</font></div>
<div><font face="monospace, monospace">#
var1 99 1.0000 0.1433 0.2047 0.3260</font></div>
<div><font face="monospace, monospace">#
var2 99 -0.1474 1.0000 0.5391 0.9524</font></div>
<div><font face="monospace, monospace">#
var3 99 -0.1279 -0.0621 1.0000 0.2885</font></div>
<div><font face="monospace, monospace">#
var4 99 -0.0992 -0.0060 0.1072 1.0000</font></div>
<div><font face="monospace, monospace">###
</code></font></div>
<div><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>
<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></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></fieldset>
<br>
<pre>_______________________________________________
R-br mailing list
<a href="mailto:R-br@listas.c3sl.ufpr.br" target="_blank">R-br@listas.c3sl.ufpr.br</a>
<a href="https://listas.inf.ufpr.br/cgi-bin/mailman/listinfo/r-br" target="_blank">https://listas.inf.ufpr.br/cgi-bin/mailman/listinfo/r-br</a>
Leia o guia de postagem (<a href="http://www.leg.ufpr.br/r-br-guia" target="_blank">http://www.leg.ufpr.br/r-br-guia</a>) e forne�a c�digo m�nimo reproduz�vel.</pre>
</blockquote>
<br>
</div>
</blockquote></div><br></div></div>