<html><body><div style="color:#000; background-color:#fff; font-family:times new roman, new york, times, serif;font-size:12pt"><div style="font-family: 'times new roman', 'new york', times, serif; font-size: 12pt;"><span>Ana, tente esse script aqui tmb.</span></div><div style="font-family: 'times new roman', 'new york', times, serif; font-size: 16px; color: rgb(0, 0, 0); background-color: transparent; font-style: normal;"><span>---------------------------------------------------------------------------------------</span></div><div style="font-family: 'times new roman', 'new york', times, serif; font-size: 16px; color: rgb(0, 0, 0); background-color: transparent; font-style: normal;"><span><br></span></div><div style="font-family: 'times new roman', 'new york', times, serif; font-size: 16px; color: rgb(0, 0, 0); background-color: transparent; font-style: normal;"><span><br></span></div><div style="background-color: transparent; color: rgb(0, 0, 0);
 font-size: 16px; font-family: 'times new roman', 'new york', times, serif; font-style: normal;"><div style="background-color: transparent;"><font face="times new roman, new york, times, serif">wine <- read.table("http://archive.ics.uci.edu/ml/machine-learning-databases/wine/wine.data", sep=",")</font></div><div style="background-color: transparent;"><font face="times new roman, new york, times, serif"><br></font></div><div style="background-color: transparent;"><font face="times new roman, new york, times, serif"># function for test correlatin with p.valuer</font></div><div style="background-color: transparent;"><font face="times new roman, new york, times, serif"><br></font></div><div style="background-color: transparent;"><font face="times new roman, new york, times, serif">correlation.test <- function(data){</font></div><div style="background-color: transparent;"><font face="times new roman, new york, times, serif">  ncol <-
 length(data)</font></div><div style="background-color: transparent;"><font face="times new roman, new york, times, serif">  var.x <- matrix(rep(c(1:ncol),each=ncol), ncol=ncol)</font></div><div style="background-color: transparent;"><font face="times new roman, new york, times, serif">  var.y <- matrix(rep(c(1:ncol),ncol), ncol=ncol)</font></div><div style="background-color: transparent;"><font face="times new roman, new york, times, serif">  estimate <- data.frame(NA)</font></div><div style="background-color: transparent;"><font face="times new roman, new york, times, serif">  p.value <- data.frame(NA)</font></div><div style="background-color: transparent;"><font face="times new roman, new york, times, serif">  for(i in 1:ncol){</font></div><div style="background-color: transparent;"><font face="times new roman, new york, times, serif">    for(j in 1:ncol){</font></div><div style="background-color:
 transparent;"><font face="times new roman, new york, times, serif">      estimate[i,j] <- cor.test(data[,var.x[i,j]], data[,var.y[i,j]])$estimate</font></div><div style="background-color: transparent;"><font face="times new roman, new york, times, serif">      p.value[i,j] <- cor.test(data[,var.x[i,j]], data[,var.y[i,j]])$p.value</font></div><div style="background-color: transparent;"><font face="times new roman, new york, times, serif">    }</font></div><div style="background-color: transparent;"><font face="times new roman, new york, times, serif">  }</font></div><div style="background-color: transparent;"><font face="times new roman, new york, times, serif">  names(estimate) <- names(data)</font></div><div style="background-color: transparent;"><font face="times new roman, new york, times, serif">  rownames(estimate) <- names(data)</font></div><div style="background-color:
 transparent;"><font face="times new roman, new york, times, serif">  names(p.value) <- names(data)</font></div><div style="background-color: transparent;"><font face="times new roman, new york, times, serif">  rownames(p.value) <- names(data)</font></div><div style="background-color: transparent;"><font face="times new roman, new york, times, serif">  return(cor=list(estimate=estimate, p.value=p.value))</font></div><div style="background-color: transparent;"><font face="times new roman, new york, times, serif">}</font></div><div style="color: rgb(0, 0, 0); font-family: 'times new roman', 'new york', times, serif; font-size: 16px; font-style: normal;"><span style="font-size: 12pt;"><br></span></div><div style="color: rgb(0, 0, 0); font-family: 'times new roman', 'new york', times, serif; font-size: 16px; font-style: normal;"><span style="font-size: 12pt;"><br></span></div><div style="color: rgb(0, 0, 0); font-family: 'times new
 roman', 'new york', times, serif; font-size: 16px; font-style: normal;"><span style="font-size: 12pt;">--------------------------------------------------------------------</span></div><div style="color: rgb(0, 0, 0); font-family: 'times new roman', 'new york', times, serif; font-size: 16px; font-style: normal;"><span style="font-size: 12pt;">Att </span><br></div></div><div style="font-family: 'times new roman', 'new york', times, serif; font-size: 12pt;"><font face="times new roman, new york, times, serif">Alisson Lucrécio da Costa</font><br></div>  <div style="font-family: 'times new roman', 'new york', times, serif; font-size: 12pt;"> <div style="font-family: 'times new roman', 'new york', times, serif; font-size: 12pt;"> <div dir="ltr"> <font size="2" face="Arial"> <hr size="1">  <b><span style="font-weight:bold;">From:</span></b> "alanarocha@sapo.pt" <alanarocha@sapo.pt><br> <b><span style="font-weight: bold;">To:</span></b>
 R-br@listas.c3sl.ufpr.br <br> <b><span style="font-weight: bold;">Sent:</span></b> Wednesday, November 21, 2012 12:14 PM<br> <b><span style="font-weight: bold;">Subject:</span></b> [R-br] problemas da correlação resolvidos<br> </font> </div> <br>
muito obrigado Daniel<br>Ana<br>_______________________________________________<br>R-br mailing list<br><a ymailto="mailto:R-br@listas.c3sl.ufpr.br" href="mailto:R-br@listas.c3sl.ufpr.br">R-br@listas.c3sl.ufpr.br</a><br><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><br>Leia o guia de postagem (http://www.leg.ufpr.br/r-br-guia) e forneça código mínimo reproduzível.<br><br><br> </div> </div>  </div></body></html>