QQ<-diag(7) for (j in 1:7){ for (k in 1:7){ sum=0 for (i in 1:50){ sum=sum+(Y[i,j]-mean(Y[,j]))*(Y[i,k]-mean(Y[,k])) } QQ[j,k]=sum/49 } } round(QQ,2) this is the function I made
-- View this message in context: http://r.789695.n4.nabble.com/how-I-can-explore-the-variable-names-in-my-covariance-matrix-tp4445149p4445180.html Sent from the R help mailing list archive at Nabble.com. ______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.