var.rdf {bpca} | R Documentation |
Computes the diagnostic of poor graphical correlations projected by biplot
according to an arbitrary limit
.
var.rdf(x, var.rb, limit)
x |
A given object of the classe data.frame or matrix . |
var.rb |
A given object of the class matrix with the projected
correlations by biplot. |
limit |
A vector giving the percentual limit to define poor representation of variables. |
A data.frame
of poor graphical correlations projected by biplot.
This function is mainly for internal use in the bpca package, and may not remain available (unless we see a good reason).
Jose Claudio Faria (joseclaudio.faria@gmail.com)
and
Clarice Garcia Borges Demetrio (clarice@esalq.usp.br)
bpca
.
## ## Example 1 ## Diagnostic of gabriel1971 dataset representation ## library(bpca) bp1 <- bpca(gabriel1971, meth='hj', var.rb=TRUE) res <- var.rdf(gabriel1971, bp1$var.rb, lim=3) res class(res) ## ## Example 2 ## Diagnostic of gabriel1971 dataset representation with var.rd parameter ## bp2 <- bpca(gabriel1971, meth='hj', lambda.end=2, var.rb=TRUE, var.rd=TRUE, limit=3) plot(bp2, var.factor=2) bp2$var.rd bp2$eigenvectors # Graphical visualization of the importance of the variables not contemplated # in the reduction plot(bpca(gabriel1971, meth='hj', lambda.ini=3, lambda.end=4), main='hj') # Interpretation: # RUR followed by CRISTIAN contains information dimensions that # wasn't contemplated by the biplot reduction (PC3). # Between all, RUR followed by CRISTIAN, variables are the most poor represented # by a 2d biplot. ## ## Example 3 ## Diagnostic of iris dataset representation with var.rd parameter ## bp3 <- bpca(iris[-5], var.rb=TRUE, var.rd=TRUE, limit=3) plot(bp3, obj.col=c('red', 'green3', 'blue')[unclass(iris$Species)], var.factor=.3) bp3$var.rd bp3$eigenvectors # Graphical diagnostic plot(bpca(iris[-5], lambda.ini=3, lambda.end=4), obj.col=c('red', 'green3', 'blue')[unclass(iris$Species)], var.factor=.6) # Interpretation: # Sepal.length followed by Petal.Width contains information in dimensions # (PC3 - the PC3 is, essentially, a contrast among both) that wasn't fully # contemplated by the biplot reduction (PC1 and PC2) . # Therefore, between all variables, they have the most poor representation by a # 2d biplot. bp4 <- bpca(iris[-5], lambda.end=3, var.rb=TRUE, var.rd=TRUE, limit=2) plot(bp4, obj.names=FALSE, obj.pch=c('+', '-', '*')[unclass(iris$Species)], obj.col=c('red', 'green3', 'blue')[unclass(iris$Species)], obj.cex=1) bp4$var.rd bp4$eigenvectors round(bp3$var.rb, 2) round(cor(iris[-5]), 2) # Good representation of all variables with a 3d biplot!