<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 12pt;
font-family:Calibri
}
--></style></head>
<body class='hmmessage'><div dir='ltr'><a class="t_atc ICName" style="line-height: 19.9935989379883px; cursor: pointer; padding-right: 2px; font-family: 'Segoe UI', 'Segoe UI Web Regular', 'Segoe UI Symbol', 'Helvetica Neue', 'BBAlpha Sans', 'S60 Sans', Arial, sans-serif; font-size: 14.0799999237061px; white-space: nowrap; background-color: rgb(255, 255, 255);">Boa tarde Andre,</a><div><font face="Segoe UI, Segoe UI Web Regular, Segoe UI Symbol, Helvetica Neue, BBAlpha Sans, S60 Sans, Arial, sans-serif"><span style="font-size: 14.0799999237061px; line-height: 19.9935989379883px; white-space: nowrap;"><br></span></font></div><div><font face="Segoe UI, Segoe UI Web Regular, Segoe UI Symbol, Helvetica Neue, BBAlpha Sans, S60 Sans, Arial, sans-serif"><span style="font-size: 14.0799999237061px; line-height: 19.9935989379883px; white-space: nowrap;">como o Walmes afirmou seu exemplo ainda não é reproduzível. Entretanto, segue um exemplo para servir de inspiração para o seu problema.</span></font></div><div><font face="Segoe UI, Segoe UI Web Regular, Segoe UI Symbol, Helvetica Neue, BBAlpha Sans, S60 Sans, Arial, sans-serif"><span style="font-size: 14.0799999237061px; line-height: 19.9935989379883px; white-space: nowrap;"><br></span></font></div><div><span style="font-family: 'Segoe UI', 'Segoe UI Web Regular', 'Segoe UI Symbol', 'Helvetica Neue', 'BBAlpha Sans', 'S60 Sans', Arial, sans-serif; font-size: 14.0799999237061px; line-height: 19.9935989379883px; white-space: nowrap;">Uma dica é você buscar entendimento da lógica de obtenção da matriz de variância e covariância </span><span style="font-family: 'bookman old style', 'new york', times, serif; background-color: rgb(255, 255, 255);">Σ</span><span style="font-family: 'Segoe UI', 'Segoe UI Web Regular', 'Segoe UI Symbol', 'Helvetica Neue', 'BBAlpha Sans', 'S60 Sans', Arial, sans-serif; font-size: 14.0799999237061px; line-height: 19.9935989379883px; white-space: nowrap;"> nas documentações da função mahalanobis.dist()</span></div><div><span style="font-family: 'Segoe UI', 'Segoe UI Web Regular', 'Segoe UI Symbol', 'Helvetica Neue', 'BBAlpha Sans', 'S60 Sans', Arial, sans-serif; font-size: 14.0799999237061px; line-height: 19.9935989379883px; white-space: nowrap;"><br></span></div><div><span style="font-family: 'Segoe UI', 'Segoe UI Web Regular', 'Segoe UI Symbol', 'Helvetica Neue', 'BBAlpha Sans', 'S60 Sans', Arial, sans-serif; font-size: 14.0799999237061px; line-height: 19.9935989379883px; white-space: nowrap;">do pacote StatMatch.</span></div><div><span style="font-family: 'Segoe UI', 'Segoe UI Web Regular', 'Segoe UI Symbol', 'Helvetica Neue', 'BBAlpha Sans', 'S60 Sans', Arial, sans-serif; font-size: 14.0799999237061px; line-height: 19.9935989379883px; white-space: nowrap;"><br></span></div><div><span style="font-family: 'Segoe UI', 'Segoe UI Web Regular', 'Segoe UI Symbol', 'Helvetica Neue', 'BBAlpha Sans', 'S60 Sans', Arial, sans-serif; font-size: 14.0799999237061px; line-height: 19.9935989379883px; white-space: nowrap;">O exemplo que trago a seguir é para uma condição experimental então utilizei a matriz </span><font face="Segoe UI, Segoe UI Web Regular, Segoe UI Symbol, Helvetica Neue, BBAlpha Sans, S60 Sans, Arial, sans-serif"><span style="font-size: 14.0799999237061px; line-height: 19.9935989379883px; white-space: nowrap;">de variância e covariância S </span></font></div><div><font face="Segoe UI, Segoe UI Web Regular, Segoe UI Symbol, Helvetica Neue, BBAlpha Sans, S60 Sans, Arial, sans-serif"><span style="font-size: 14.0799999237061px; line-height: 19.9935989379883px; white-space: nowrap;"><br></span></font></div><div><font face="Segoe UI, Segoe UI Web Regular, Segoe UI Symbol, Helvetica Neue, BBAlpha Sans, S60 Sans, Arial, sans-serif"><span style="font-size: 14.0799999237061px; line-height: 19.9935989379883px; white-space: nowrap;">(matriz de soma de quadrados e produtos residuais/graus de liberdade dos resíduos). Entretanto, você pode tentar adaptar para sua condição</span></font></div><div><font face="Segoe UI, Segoe UI Web Regular, Segoe UI Symbol, Helvetica Neue, BBAlpha Sans, S60 Sans, Arial, sans-serif"><span style="font-size: 14.0799999237061px; line-height: 19.9935989379883px; white-space: nowrap;"><br></span></font></div><div><font face="Segoe UI, Segoe UI Web Regular, Segoe UI Symbol, Helvetica Neue, BBAlpha Sans, S60 Sans, Arial, sans-serif"><span style="font-size: 14.0799999237061px; line-height: 19.9935989379883px; white-space: nowrap;">definindo a matriz </span></font><span style="font-family: 'Segoe UI', 'Segoe UI Web Regular', 'Segoe UI Symbol', 'Helvetica Neue', 'BBAlpha Sans', 'S60 Sans', Arial, sans-serif; font-size: 14.0799999237061px; line-height: 19.9935989379883px; white-space: nowrap;">de variância e covariância de interesse.</span></div><div><font face="Segoe UI, Segoe UI Web Regular, Segoe UI Symbol, Helvetica Neue, BBAlpha Sans, S60 Sans, Arial, sans-serif" style="font-size: 12pt;"><span style="font-size: 14.0799999237061px; line-height: 19.9935989379883px; white-space: nowrap;"><br></span></font></div><div><font face="Segoe UI, Segoe UI Web Regular, Segoe UI Symbol, Helvetica Neue, BBAlpha Sans, S60 Sans, Arial, sans-serif"><span style="font-size: 14.0799999237061px; line-height: 19.9935989379883px; white-space: nowrap;"># Dados para o exemplo.</span></font></div><div><font face="Segoe UI, Segoe UI Web Regular, Segoe UI Symbol, Helvetica Neue, BBAlpha Sans, S60 Sans, Arial, sans-serif"><span style="font-size: 14.0799999237061px; line-height: 19.9935989379883px; white-space: nowrap;"><br></span></font></div><div><font face="Segoe UI, Segoe UI Web Regular, Segoe UI Symbol, Helvetica Neue, BBAlpha Sans, S60 Sans, Arial, sans-serif"><span style="font-size: 14.0799999237061px; line-height: 19.9935989379883px; white-space: nowrap;">dat <- structure(list(trat = structure(c(1L, 1L, 1L, 2L, 2L, 2L, 3L, </span></font></div><div><font face="Segoe UI, Segoe UI Web Regular, Segoe UI Symbol, Helvetica Neue, BBAlpha Sans, S60 Sans, Arial, sans-serif"><span style="font-size: 14.0799999237061px; line-height: 19.9935989379883px; white-space: nowrap;">3L, 3L, 4L, 4L, 4L), .Label = c("1", "2", "3", "4"), class = "factor"), </span></font></div><div><font face="Segoe UI, Segoe UI Web Regular, Segoe UI Symbol, Helvetica Neue, BBAlpha Sans, S60 Sans, Arial, sans-serif"><span style="font-size: 14.0799999237061px; line-height: 19.9935989379883px; white-space: nowrap;"> x1 = c(50.039225756996, 51.7825110686358, 48.1384396336807, </span></font></div><div><font face="Segoe UI, Segoe UI Web Regular, Segoe UI Symbol, Helvetica Neue, BBAlpha Sans, S60 Sans, Arial, sans-serif"><span style="font-size: 14.0799999237061px; line-height: 19.9935989379883px; white-space: nowrap;"> 50.4489824448722, 48.4220046908771, 44.5221770682025, 52.2588301216718, </span></font></div><div><font face="Segoe UI, Segoe UI Web Regular, Segoe UI Symbol, Helvetica Neue, BBAlpha Sans, S60 Sans, Arial, sans-serif"><span style="font-size: 14.0799999237061px; line-height: 19.9935989379883px; white-space: nowrap;"> 54.1412387912868, 48.8071610383588, 53.8184419408507, 53.5005661405145, </span></font></div><div><font face="Segoe UI, Segoe UI Web Regular, Segoe UI Symbol, Helvetica Neue, BBAlpha Sans, S60 Sans, Arial, sans-serif"><span style="font-size: 14.0799999237061px; line-height: 19.9935989379883px; white-space: nowrap;"> 48.8892313217333), x2 = c(40.0577191986925, 36.6154386398641, </span></font></div><div><font face="Segoe UI, Segoe UI Web Regular, Segoe UI Symbol, Helvetica Neue, BBAlpha Sans, S60 Sans, Arial, sans-serif"><span style="font-size: 14.0799999237061px; line-height: 19.9935989379883px; white-space: nowrap;"> 45.1013819536244, 37.9422687414707, 41.1111204733925, 33.3243892012254, </span></font></div><div><font face="Segoe UI, Segoe UI Web Regular, Segoe UI Symbol, Helvetica Neue, BBAlpha Sans, S60 Sans, Arial, sans-serif"><span style="font-size: 14.0799999237061px; line-height: 19.9935989379883px; white-space: nowrap;"> 33.0139305834796, 35.7751641361826, 47.7243822772713, 39.8005702375829, </span></font></div><div><font face="Segoe UI, Segoe UI Web Regular, Segoe UI Symbol, Helvetica Neue, BBAlpha Sans, S60 Sans, Arial, sans-serif"><span style="font-size: 14.0799999237061px; line-height: 19.9935989379883px; white-space: nowrap;"> 38.3100567194852, 44.0757780378149), x3 = c(10.4591588838242, </span></font></div><div><font face="Segoe UI, Segoe UI Web Regular, Segoe UI Symbol, Helvetica Neue, BBAlpha Sans, S60 Sans, Arial, sans-serif"><span style="font-size: 14.0799999237061px; line-height: 19.9935989379883px; white-space: nowrap;"> 10.6373435622737, 10.3189328544074, 10.0386650378322, 9.96842284038367, </span></font></div><div><font face="Segoe UI, Segoe UI Web Regular, Segoe UI Symbol, Helvetica Neue, BBAlpha Sans, S60 Sans, Arial, sans-serif"><span style="font-size: 14.0799999237061px; line-height: 19.9935989379883px; white-space: nowrap;"> 10.6003051066032, 10.8695539960311, 10.143593400873, 9.45082912208145, </span></font></div><div><font face="Segoe UI, Segoe UI Web Regular, Segoe UI Symbol, Helvetica Neue, BBAlpha Sans, S60 Sans, Arial, sans-serif"><span style="font-size: 14.0799999237061px; line-height: 19.9935989379883px; white-space: nowrap;"> 9.28742328152705, 9.60271226420169, 10.1566398296013)), .Names = c("trat", </span></font></div><div><font face="Segoe UI, Segoe UI Web Regular, Segoe UI Symbol, Helvetica Neue, BBAlpha Sans, S60 Sans, Arial, sans-serif"><span style="font-size: 14.0799999237061px; line-height: 19.9935989379883px; white-space: nowrap;">"x1", "x2", "x3"), row.names = c(NA, -12L), class = "data.frame")</span></font></div><div><font face="Segoe UI, Segoe UI Web Regular, Segoe UI Symbol, Helvetica Neue, BBAlpha Sans, S60 Sans, Arial, sans-serif"><span style="font-size: 14.0799999237061px; line-height: 19.9935989379883px; white-space: nowrap;"><br></span></font></div><div><font face="Segoe UI, Segoe UI Web Regular, Segoe UI Symbol, Helvetica Neue, BBAlpha Sans, S60 Sans, Arial, sans-serif"><span style="font-size: 14.0799999237061px; line-height: 19.9935989379883px; white-space: nowrap;">attach(dat)</span></font></div><div><font face="Segoe UI, Segoe UI Web Regular, Segoe UI Symbol, Helvetica Neue, BBAlpha Sans, S60 Sans, Arial, sans-serif"><span style="font-size: 14.0799999237061px; line-height: 19.9935989379883px; white-space: nowrap;"><br></span></font></div><div><font face="Segoe UI, Segoe UI Web Regular, Segoe UI Symbol, Helvetica Neue, BBAlpha Sans, S60 Sans, Arial, sans-serif"><span style="font-size: 14.0799999237061px; line-height: 19.9935989379883px; white-space: nowrap;"># Matriz contendo as variáveis que serão analizadas.</span></font></div><div><font face="Segoe UI, Segoe UI Web Regular, Segoe UI Symbol, Helvetica Neue, BBAlpha Sans, S60 Sans, Arial, sans-serif"><span style="font-size: 14.0799999237061px; line-height: 19.9935989379883px; white-space: nowrap;"><br></span></font></div><div><font face="Segoe UI, Segoe UI Web Regular, Segoe UI Symbol, Helvetica Neue, BBAlpha Sans, S60 Sans, Arial, sans-serif"><span style="font-size: 14.0799999237061px; line-height: 19.9935989379883px; white-space: nowrap;">resp = as.matrix( dat[,2:ncol(dat)] )</span></font></div><div><font face="Segoe UI, Segoe UI Web Regular, Segoe UI Symbol, Helvetica Neue, BBAlpha Sans, S60 Sans, Arial, sans-serif"><span style="font-size: 14.0799999237061px; line-height: 19.9935989379883px; white-space: nowrap;"><br></span></font></div><div><font face="Segoe UI, Segoe UI Web Regular, Segoe UI Symbol, Helvetica Neue, BBAlpha Sans, S60 Sans, Arial, sans-serif"><span style="font-size: 14.0799999237061px; line-height: 19.9935989379883px; white-space: nowrap;"><br></span></font></div><div><font face="Segoe UI, Segoe UI Web Regular, Segoe UI Symbol, Helvetica Neue, BBAlpha Sans, S60 Sans, Arial, sans-serif"><span style="font-size: 14.0799999237061px; line-height: 19.9935989379883px; white-space: nowrap;"># Realização da Manova para obtenção da matriz de covariância residual (S). </span></font></div><div><font face="Segoe UI, Segoe UI Web Regular, Segoe UI Symbol, Helvetica Neue, BBAlpha Sans, S60 Sans, Arial, sans-serif"><span style="font-size: 14.0799999237061px; line-height: 19.9935989379883px; white-space: nowrap;"><br></span></font></div><div><font face="Segoe UI, Segoe UI Web Regular, Segoe UI Symbol, Helvetica Neue, BBAlpha Sans, S60 Sans, Arial, sans-serif"><span style="font-size: 14.0799999237061px; line-height: 19.9935989379883px; white-space: nowrap;">mav <- manova(resp ~ trat)</span></font></div><div><font face="Segoe UI, Segoe UI Web Regular, Segoe UI Symbol, Helvetica Neue, BBAlpha Sans, S60 Sans, Arial, sans-serif"><span style="font-size: 14.0799999237061px; line-height: 19.9935989379883px; white-space: nowrap;"><br></span></font></div><div><font face="Segoe UI, Segoe UI Web Regular, Segoe UI Symbol, Helvetica Neue, BBAlpha Sans, S60 Sans, Arial, sans-serif"><span style="font-size: 14.0799999237061px; line-height: 19.9935989379883px; white-space: nowrap;">quadro = summary(mav,test="Wilks")</span></font></div><div><font face="Segoe UI, Segoe UI Web Regular, Segoe UI Symbol, Helvetica Neue, BBAlpha Sans, S60 Sans, Arial, sans-serif"><span style="font-size: 14.0799999237061px; line-height: 19.9935989379883px; white-space: nowrap;"><br></span></font></div><div><font face="Segoe UI, Segoe UI Web Regular, Segoe UI Symbol, Helvetica Neue, BBAlpha Sans, S60 Sans, Arial, sans-serif"><span style="font-size: 14.0799999237061px; line-height: 19.9935989379883px; white-space: nowrap;">glr <- df.residual(mav)</span></font></div><div><font face="Segoe UI, Segoe UI Web Regular, Segoe UI Symbol, Helvetica Neue, BBAlpha Sans, S60 Sans, Arial, sans-serif"><span style="font-size: 14.0799999237061px; line-height: 19.9935989379883px; white-space: nowrap;"><br></span></font></div><div><font face="Segoe UI, Segoe UI Web Regular, Segoe UI Symbol, Helvetica Neue, BBAlpha Sans, S60 Sans, Arial, sans-serif"><span style="font-size: 14.0799999237061px; line-height: 19.9935989379883px; white-space: nowrap;">S <- quadro$SS$Residuals/glr</span></font></div><div><font face="Segoe UI, Segoe UI Web Regular, Segoe UI Symbol, Helvetica Neue, BBAlpha Sans, S60 Sans, Arial, sans-serif"><span style="font-size: 14.0799999237061px; line-height: 19.9935989379883px; white-space: nowrap;"><br></span></font></div><div><font face="Segoe UI, Segoe UI Web Regular, Segoe UI Symbol, Helvetica Neue, BBAlpha Sans, S60 Sans, Arial, sans-serif"><span style="font-size: 14.0799999237061px; line-height: 19.9935989379883px; white-space: nowrap;"><br></span></font></div><div><font face="Segoe UI, Segoe UI Web Regular, Segoe UI Symbol, Helvetica Neue, BBAlpha Sans, S60 Sans, Arial, sans-serif"><span style="font-size: 14.0799999237061px; line-height: 19.9935989379883px; white-space: nowrap;"># Obtenção das médias dos tratamentos</span></font></div><div><font face="Segoe UI, Segoe UI Web Regular, Segoe UI Symbol, Helvetica Neue, BBAlpha Sans, S60 Sans, Arial, sans-serif"><span style="font-size: 14.0799999237061px; line-height: 19.9935989379883px; white-space: nowrap;"><br></span></font></div><div><font face="Segoe UI, Segoe UI Web Regular, Segoe UI Symbol, Helvetica Neue, BBAlpha Sans, S60 Sans, Arial, sans-serif"><span style="font-size: 14.0799999237061px; line-height: 19.9935989379883px; white-space: nowrap;">medtrat <- aggregate(resp, by = list(trat), FUN = mean)[,2:ncol(dat)]</span></font></div><div><font face="Segoe UI, Segoe UI Web Regular, Segoe UI Symbol, Helvetica Neue, BBAlpha Sans, S60 Sans, Arial, sans-serif"><span style="font-size: 14.0799999237061px; line-height: 19.9935989379883px; white-space: nowrap;"><br></span></font></div><div><font face="Segoe UI, Segoe UI Web Regular, Segoe UI Symbol, Helvetica Neue, BBAlpha Sans, S60 Sans, Arial, sans-serif"><span style="font-size: 14.0799999237061px; line-height: 19.9935989379883px; white-space: nowrap;">medtrat <- as.matrix(medtrat)</span></font></div><div><font face="Segoe UI, Segoe UI Web Regular, Segoe UI Symbol, Helvetica Neue, BBAlpha Sans, S60 Sans, Arial, sans-serif"><span style="font-size: 14.0799999237061px; line-height: 19.9935989379883px; white-space: nowrap;"><br></span></font></div><div><font face="Segoe UI, Segoe UI Web Regular, Segoe UI Symbol, Helvetica Neue, BBAlpha Sans, S60 Sans, Arial, sans-serif"><span style="font-size: 14.0799999237061px; line-height: 19.9935989379883px; white-space: nowrap;"><br></span></font></div><div><font face="Segoe UI, Segoe UI Web Regular, Segoe UI Symbol, Helvetica Neue, BBAlpha Sans, S60 Sans, Arial, sans-serif"><span style="font-size: 14.0799999237061px; line-height: 19.9935989379883px; white-space: nowrap;"># Obtenção da matriz D2 de Mahalanobis</span></font></div><div><font face="Segoe UI, Segoe UI Web Regular, Segoe UI Symbol, Helvetica Neue, BBAlpha Sans, S60 Sans, Arial, sans-serif"><span style="font-size: 14.0799999237061px; line-height: 19.9935989379883px; white-space: nowrap;"><br></span></font></div><div><font face="Segoe UI, Segoe UI Web Regular, Segoe UI Symbol, Helvetica Neue, BBAlpha Sans, S60 Sans, Arial, sans-serif"><span style="font-size: 14.0799999237061px; line-height: 19.9935989379883px; white-space: nowrap;">nla = numeric(0)</span></font></div><div><font face="Segoe UI, Segoe UI Web Regular, Segoe UI Symbol, Helvetica Neue, BBAlpha Sans, S60 Sans, Arial, sans-serif"><span style="font-size: 14.0799999237061px; line-height: 19.9935989379883px; white-space: nowrap;"><br></span></font></div><div><font face="Segoe UI, Segoe UI Web Regular, Segoe UI Symbol, Helvetica Neue, BBAlpha Sans, S60 Sans, Arial, sans-serif"><span style="font-size: 14.0799999237061px; line-height: 19.9935989379883px; white-space: nowrap;">nlb = numeric(0)</span></font></div><div><font face="Segoe UI, Segoe UI Web Regular, Segoe UI Symbol, Helvetica Neue, BBAlpha Sans, S60 Sans, Arial, sans-serif"><span style="font-size: 14.0799999237061px; line-height: 19.9935989379883px; white-space: nowrap;"><br></span></font></div><div><font face="Segoe UI, Segoe UI Web Regular, Segoe UI Symbol, Helvetica Neue, BBAlpha Sans, S60 Sans, Arial, sans-serif"><span style="font-size: 14.0799999237061px; line-height: 19.9935989379883px; white-space: nowrap;">acd = (nrow(medtrat)-1):1</span></font></div><div><font face="Segoe UI, Segoe UI Web Regular, Segoe UI Symbol, Helvetica Neue, BBAlpha Sans, S60 Sans, Arial, sans-serif"><span style="font-size: 14.0799999237061px; line-height: 19.9935989379883px; white-space: nowrap;"><br></span></font></div><div><font face="Segoe UI, Segoe UI Web Regular, Segoe UI Symbol, Helvetica Neue, BBAlpha Sans, S60 Sans, Arial, sans-serif"><span style="font-size: 14.0799999237061px; line-height: 19.9935989379883px; white-space: nowrap;">acc=1:(nrow(medtrat)-1)</span></font></div><div><font face="Segoe UI, Segoe UI Web Regular, Segoe UI Symbol, Helvetica Neue, BBAlpha Sans, S60 Sans, Arial, sans-serif"><span style="font-size: 14.0799999237061px; line-height: 19.9935989379883px; white-space: nowrap;"><br></span></font></div><div><font face="Segoe UI, Segoe UI Web Regular, Segoe UI Symbol, Helvetica Neue, BBAlpha Sans, S60 Sans, Arial, sans-serif"><span style="font-size: 14.0799999237061px; line-height: 19.9935989379883px; white-space: nowrap;">acc1=2:nrow(medtrat)</span></font></div><div><font face="Segoe UI, Segoe UI Web Regular, Segoe UI Symbol, Helvetica Neue, BBAlpha Sans, S60 Sans, Arial, sans-serif"><span style="font-size: 14.0799999237061px; line-height: 19.9935989379883px; white-space: nowrap;"><br></span></font></div><div><font face="Segoe UI, Segoe UI Web Regular, Segoe UI Symbol, Helvetica Neue, BBAlpha Sans, S60 Sans, Arial, sans-serif"><span style="font-size: 14.0799999237061px; line-height: 19.9935989379883px; white-space: nowrap;">D2 <- mat.or.vec(nrow(medtrat),nrow(medtrat))</span></font></div><div><font face="Segoe UI, Segoe UI Web Regular, Segoe UI Symbol, Helvetica Neue, BBAlpha Sans, S60 Sans, Arial, sans-serif"><span style="font-size: 14.0799999237061px; line-height: 19.9935989379883px; white-space: nowrap;"><br></span></font></div><div><font face="Segoe UI, Segoe UI Web Regular, Segoe UI Symbol, Helvetica Neue, BBAlpha Sans, S60 Sans, Arial, sans-serif"><span style="font-size: 14.0799999237061px; line-height: 19.9935989379883px; white-space: nowrap;"> for(i in 1:length(acd)){</span></font></div><div><font face="Segoe UI, Segoe UI Web Regular, Segoe UI Symbol, Helvetica Neue, BBAlpha Sans, S60 Sans, Arial, sans-serif"><span style="font-size: 14.0799999237061px; line-height: 19.9935989379883px; white-space: nowrap;"> nla <- c(nla, rep( acc[i],each=acd[i] ))</span></font></div><div><font face="Segoe UI, Segoe UI Web Regular, Segoe UI Symbol, Helvetica Neue, BBAlpha Sans, S60 Sans, Arial, sans-serif"><span style="font-size: 14.0799999237061px; line-height: 19.9935989379883px; white-space: nowrap;"> nlb <- c(nlb, acc1[i]:nrow(medtrat) )</span></font></div><div><font face="Segoe UI, Segoe UI Web Regular, Segoe UI Symbol, Helvetica Neue, BBAlpha Sans, S60 Sans, Arial, sans-serif"><span style="font-size: 14.0799999237061px; line-height: 19.9935989379883px; white-space: nowrap;"> } </span></font></div><div><font face="Segoe UI, Segoe UI Web Regular, Segoe UI Symbol, Helvetica Neue, BBAlpha Sans, S60 Sans, Arial, sans-serif"><span style="font-size: 14.0799999237061px; line-height: 19.9935989379883px; white-space: nowrap;"><br></span></font></div><div><font face="Segoe UI, Segoe UI Web Regular, Segoe UI Symbol, Helvetica Neue, BBAlpha Sans, S60 Sans, Arial, sans-serif"><span style="font-size: 14.0799999237061px; line-height: 19.9935989379883px; white-space: nowrap;"> for(i in 1:length(nla)){</span></font></div><div><font face="Segoe UI, Segoe UI Web Regular, Segoe UI Symbol, Helvetica Neue, BBAlpha Sans, S60 Sans, Arial, sans-serif"><span style="font-size: 14.0799999237061px; line-height: 19.9935989379883px; white-space: nowrap;"> D2[nla[i], nlb[i]] <- t(medtrat[nla[i],] - medtrat[nlb[i],])%*%solve(S)%*%(medtrat[nla[i],] - medtrat[nlb[i],])</span></font></div><div><font face="Segoe UI, Segoe UI Web Regular, Segoe UI Symbol, Helvetica Neue, BBAlpha Sans, S60 Sans, Arial, sans-serif"><span style="font-size: 14.0799999237061px; line-height: 19.9935989379883px; white-space: nowrap;"> D2[nlb[i], nla[i]] <- D2[nla[i], nlb[i]] </span></font></div><div><font face="Segoe UI, Segoe UI Web Regular, Segoe UI Symbol, Helvetica Neue, BBAlpha Sans, S60 Sans, Arial, sans-serif"><span style="font-size: 14.0799999237061px; line-height: 19.9935989379883px; white-space: nowrap;"> }</span></font></div><div><font face="Segoe UI, Segoe UI Web Regular, Segoe UI Symbol, Helvetica Neue, BBAlpha Sans, S60 Sans, Arial, sans-serif"><span style="font-size: 14.0799999237061px; line-height: 19.9935989379883px; white-space: nowrap;"><br></span></font></div><div><font face="Segoe UI, Segoe UI Web Regular, Segoe UI Symbol, Helvetica Neue, BBAlpha Sans, S60 Sans, Arial, sans-serif"><span style="font-size: 14.0799999237061px; line-height: 19.9935989379883px; white-space: nowrap;"># Matriz D2 de Mahalanobis</span></font></div><div><font face="Segoe UI, Segoe UI Web Regular, Segoe UI Symbol, Helvetica Neue, BBAlpha Sans, S60 Sans, Arial, sans-serif"><span style="font-size: 14.0799999237061px; line-height: 19.9935989379883px; white-space: nowrap;"><br></span></font></div><div><font face="Segoe UI, Segoe UI Web Regular, Segoe UI Symbol, Helvetica Neue, BBAlpha Sans, S60 Sans, Arial, sans-serif"><span style="font-size: 14.0799999237061px; line-height: 19.9935989379883px; white-space: nowrap;">D2</span></font><font face="Segoe UI, Segoe UI Web Regular, Segoe UI Symbol, Helvetica Neue, BBAlpha Sans, S60 Sans, Arial, sans-serif" style="font-size: 12pt;"><span style="font-size: 14.0799999237061px; line-height: 19.9935989379883px; white-space: nowrap;"> </span></font><span style="font-family: 'Segoe UI', 'Segoe UI Web Regular', 'Segoe UI Symbol', 'Helvetica Neue', 'BBAlpha Sans', 'S60 Sans', Arial, sans-serif; font-size: 14.0799999237061px; line-height: 19.9935989379883px; white-space: nowrap;"> </span></div><div><br><div>#################################################################</div><div> </div><div>Tiago de Souza Marçal - Graduando em Agronomia pelo CCA-UFES</div><div> </div><div>Bolsista de Iniciação Científica da área de Genética e Melhoramento de Plantas</div><div> </div><div>################################################################# </div><br><br><div><hr id="stopSpelling">Date: Fri, 26 Jun 2015 00:34:46 +0000<br>From: andreolsouza@yahoo.com.br<br>To: walmeszeviani@gmail.com; r-br@listas.c3sl.ufpr.br<br>Subject: Re: [R-br] Sistema é computacionalmente singular - Matriz/Mahalanobis<br><br><div style="color:#000;background-color:#fff;font-family:bookman old style, new york, times, serif;font-size:16px;"><div id="ecxyiv2916607847"><div id="ecxyui_3_16_0_1_1435271953799_12222"><div style="background-color:rgb(255, 255, 255);" id="ecxyui_3_16_0_1_1435271953799_12221"><div dir="ltr" id="ecxyiv2916607847yui_3_16_0_1_1435270952475_29558"><div dir="ltr" id="ecxyiv2916607847yui_3_16_0_1_1435270952475_29558"><br></div><div dir="ltr" id="ecxyiv2916607847yui_3_16_0_1_1435270952475_29558">Desculpas pela falta de clareza Walmes, é que não citei que a função faz é D_{ij}^2 = (x_i - x_j)' (Σ^-1) (x_i - x_j) e a matriz Σ, neste caso não tem inversa comum. Já tentei várias funções e de fato todas funções para tal método usam a função solve(Σ) como padrão. Desisti de usar a matriz de Mahalanobis, pensei em distancia Euclidiana, mas seria importante eu conseguir usar um método que envolvesse a matriz de covariâncias para obter D2. Minha pergunta é se teria uma forma de usar, neste caso, um outro tipo de inversa (outro algorítimo) e sem comprometer a matriz D2 ou se vou mesmo ter ficar com distancia Euclidiana e variantes. </div><div dir="ltr" id="ecxyiv2916607847yui_3_16_0_1_1435270952475_29558"> </div></div><div dir="ltr" id="ecxyiv2916607847yui_3_16_0_1_1435270952475_29558" style="color:rgb(0, 0, 0);font-family:'bookman old style', 'new york', times, serif;font-size:16px;"><br></div><div dir="ltr" id="ecxyiv2916607847yui_3_16_0_1_1435270952475_29558" style="color:rgb(0, 0, 0);font-family:'bookman old style', 'new york', times, serif;font-size:16px;">setwd("/home/andre")<br></div><div dir="ltr" id="ecxyiv2916607847yui_3_16_0_1_1435270952475_29558" style="color:rgb(0, 0, 0);font-family:'bookman old style', 'new york', times, serif;font-size:16px;">dados <- read.csv("dados.txt", sep="")<br></div><div dir="ltr" id="ecxyiv2916607847yui_3_16_0_1_1435270952475_29558"><div dir="ltr" id="ecxyiv2916607847yui_3_16_0_1_1435270952475_29558">str(dados)<br></div><div dir="ltr" id="ecxyiv2916607847yui_3_16_0_1_1435270952475_29558">'data.frame':<span style="white-space:pre-wrap;"> </span>6 obs. of 10 variables:</div><div dir="ltr" id="ecxyiv2916607847yui_3_16_0_1_1435270952475_29558"> $ ch : int 146 26 44 56 73 101</div><div dir="ltr" id="ecxyiv2916607847yui_3_16_0_1_1435270952475_29558"> $ lam : int 126 14 20 104 54 156</div><div dir="ltr" id="ecxyiv2916607847yui_3_16_0_1_1435270952475_29558"> $ esfr : int 208 1 1 36 73 22</div><div dir="ltr" id="ecxyiv2916607847yui_3_16_0_1_1435270952475_29558"> $ cut : int 43 10 9 20 22 40</div><div dir="ltr" id="ecxyiv2916607847yui_3_16_0_1_1435270952475_29558"> $ fleh : int 16 1 1 2 9 5</div><div dir="ltr" id="ecxyiv2916607847yui_3_16_0_1_1435270952475_29558"> $ tmont : int 45 5 12 15 11 27</div><div dir="ltr" id="ecxyiv2916607847yui_3_16_0_1_1435270952475_29558"> $ mont : int 18 8 16 25 21 32</div><div dir="ltr" id="ecxyiv2916607847yui_3_16_0_1_1435270952475_29558"> $ montco : int 6 0 3 2 2 3</div><div dir="ltr" id="ecxyiv2916607847yui_3_16_0_1_1435270952475_29558"> $ vocal : int 106 14 21 105 97 151</div><div dir="ltr" id="ecxyiv2916607847yui_3_16_0_1_1435270952475_29558"> $ respaud: int 123 44 64 113 56 79</div><div dir="ltr" id="ecxyiv2916607847yui_3_16_0_1_1435270952475_29558"><br></div></div><div dir="ltr" id="ecxyiv2916607847yui_3_16_0_1_1435270952475_29558" style="color:rgb(0, 0, 0);font-family:'bookman old style', 'new york', times, serif;font-size:16px;"><div dir="ltr" id="ecxyiv2916607847yui_3_16_0_1_1435270952475_29558">dados</div><div dir="ltr" id="ecxyiv2916607847yui_3_16_0_1_1435270952475_29558"> ch lam esfr cut fleh tmont mont montco vocal respaud</div><div dir="ltr" id="ecxyiv2916607847yui_3_16_0_1_1435270952475_29558">A 146 126 208 43 16 45 18 6 106 123</div><div dir="ltr" id="ecxyiv2916607847yui_3_16_0_1_1435270952475_29558">B 26 14 1 10 1 5 8 0 14 44</div><div dir="ltr" id="ecxyiv2916607847yui_3_16_0_1_1435270952475_29558">C 44 20 1 9 1 12 16 3 21 64</div><div dir="ltr" id="ecxyiv2916607847yui_3_16_0_1_1435270952475_29558">D 56 104 36 20 2 15 25 2 105 113</div><div dir="ltr" id="ecxyiv2916607847yui_3_16_0_1_1435270952475_29558">E 73 54 73 22 9 11 21 2 97 56</div><div dir="ltr" id="ecxyiv2916607847yui_3_16_0_1_1435270952475_29558">F 101 156 22 40 5 27 32 3 151 79</div><div dir="ltr" id="ecxyiv2916607847yui_3_16_0_1_1435270952475_29558"><br></div></div><div dir="ltr" id="ecxyiv2916607847yui_3_16_0_1_1435270952475_29558" style="color:rgb(0, 0, 0);font-family:'bookman old style', 'new york', times, serif;font-size:16px;">require(StatMatch)</div><div dir="ltr" id="ecxyiv2916607847yui_3_16_0_1_1435270952475_29558" style="color:rgb(0, 0, 0);font-family:'bookman old style', 'new york', times, serif;font-size:16px;">D2=mahalanobis.dist(dados)</div><div dir="ltr" id="ecxyiv2916607847yui_3_16_0_1_1435270952475_29558" style="color:rgb(0, 0, 0);font-family:'bookman old style', 'new york', times, serif;font-size:16px;"><div dir="ltr" id="ecxyiv2916607847yui_3_16_0_1_1435270952475_29558">mahalanobis.dist(dados)</div><div dir="ltr" id="ecxyiv2916607847yui_3_16_0_1_1435270952475_29558">Error in solve.default(cov, ...) : </div><div dir="ltr" id="ecxyiv2916607847yui_3_16_0_1_1435270952475_29558">sistema é computacionalmente singular: condição recíproca número = 1.53112e-19</div><div dir="ltr" id="ecxyiv2916607847yui_3_16_0_1_1435270952475_29558"><br></div><div dir="ltr" id="ecxyiv2916607847yui_3_16_0_1_1435270952475_29558"><br></div></div><div dir="ltr" id="ecxyui_3_16_0_1_1435271953799_13829" style="color:rgb(0, 0, 0);font-family:'bookman old style', 'new york', times, serif;font-size:16px;"><div id="ecxyiv1896427967yui_3_16_0_1_1435270952475_2783">require(biotools)</div><div id="ecxyiv1896427967yui_3_16_0_1_1435270952475_2783">Cov=cov(dados)<br></div><div id="ecxyiv1896427967yui_3_16_0_1_1435270952475_2783" dir="ltr">D2=D2.dist(dados, Cov) </div></div><div style="color:rgb(0, 0, 0);font-family:'bookman old style', 'new york', times, serif;font-size:16px;"></div><div id="ecxyiv2916607847yui_3_16_0_1_1435270952475_29559" style="color:rgb(0, 0, 0);font-family:'bookman old style', 'new york', times, serif;font-size:16px;">D2=D2.dist(dados, Cov) </div><div id="ecxyiv2916607847yui_3_16_0_1_1435270952475_29559">Error in solve.default(cov, (x[i, ] - x[j, ])) : </div><div id="ecxyiv2916607847yui_3_16_0_1_1435270952475_29559" dir="ltr">sistema é computacionalmente singular: condição recíproca número = 1.53112e-19</div><div id="ecxyiv2916607847yui_3_16_0_1_1435270952475_29559" dir="ltr"><br></div><div id="ecxyiv2916607847yui_3_16_0_1_1435270952475_29559" dir="ltr"><br></div><div id="ecxyiv2916607847yui_3_16_0_1_1435270952475_29562" style="color:rgb(0, 0, 0);font-family:'bookman old style', 'new york', times, serif;font-size:16px;"><div id="ecxyiv2916607847yui_3_16_0_1_1435270952475_29561">
<br clear="none">
<br clear="none">André Oliveira Souza. <br clear="none">Graduação em Matemática, mestrado em estatística aplicada.Instituto Federal de Educação, Ciência e Tecnologia do Espirito Santo. IFES<br clear="none">
</div><br clear="none"><br clear="none"><div id="ecxyiv2916607847yui_3_16_0_1_1435270952475_29563">
<br clear="none"></div></div> <br clear="none"><div class="ecxyiv2916607847qtdSeparateBR" id="ecxyui_3_16_0_1_1435271953799_13283" style="color:rgb(0, 0, 0);font-family:'bookman old style', 'new york', times, serif;font-size:16px;"><br clear="none"><br clear="none"></div><div class="ecxyiv2916607847yqt4192982404" id="ecxyiv2916607847yqt68362" style="color:rgb(0, 0, 0);font-family:'bookman old style', 'new york', times, serif;font-size:16px;"></div></div></div></div><div class=".ecxyiv2916607847yahoo_quoted"> <div style="font-family:bookman old style, new york, times, serif;font-size:16px;"> <div style="font-family:HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif;font-size:16px;"> <div dir="ltr"> <font size="2" face="Arial"> Em Quinta-feira, 25 de Junho de 2015 19:41, walmes . <walmeszeviani@gmail.com> escreveu:<br clear="none"> </font> </div> <br clear="none"><br clear="none"> <div class="ecxyiv2916607847y_msg_container"><div id="ecxyiv2916607847"><div><div dir="ltr"><div class="ecxyiv2916607847gmail_default" style="font-family:trebuchet ms, sans-serif;">Seu exemplo é 100% não reproduzível.<br clear="none"></div><br clear="none"><div class="ecxyiv2916607847gmail_default" style="font-family:trebuchet ms, sans-serif;">À disposição.<br clear="none"></div><div class="ecxyiv2916607847gmail_default" style="font-family:trebuchet ms, sans-serif;">Walmes.</div><div class="ecxyiv2916607847yqt2966671773" id="ecxyiv2916607847yqtfd85242"><br clear="none"></div></div></div></div><br clear="none"><br clear="none"></div> </div> </div> </div></div><br>_______________________________________________
R-br mailing list
R-br@listas.c3sl.ufpr.br
https://listas.inf.ufpr.br/cgi-bin/mailman/listinfo/r-br
Leia o guia de postagem (http://www.leg.ufpr.br/r-br-guia) e forne�a c�digo m�nimo reproduz�vel.</div></div> </div></body>
</html>