Re: [R] Scaling Matrix in qda() function in MASS package

2017-08-24 Thread William Dunlap via R-help
If you multiply the data for a certain group by the scaling matrix for that group, the variance matrix will be the identity. E.g., > z <- qda(iris[-5], grouping=iris$Species) > zapsmall(var( as.matrix(subset(iris, Species=="virginica", 1:4)) %*% z$scaling[,,"virginica"] )) 1 2 3 4 1 1 0 0 0 2 0

Re: [R] Scaling Matrix in qda() function in MASS package

2017-08-24 Thread Ranjan Maitra
I guess the question that is being asked here is what is the scaling matrix that is being returned in the qda object. The help file on qda() says: ... scaling: for each group ‘i’, ‘scaling[,,i]’ is an array which transforms observations so that within-groups covariance matrix is spherical. ... T

Re: [R] Scaling Matrix in qda() function in MASS package

2017-08-23 Thread Bert Gunter
You need to learn how to access code for nonexported methods. See ? "::" > methods(qda) [1] qda.data.frame* qda.default*qda.formula*qda.matrix* see '?methods' for accessing help and source code Shows you that the methods are not exported from the namespace. Hence you need to use the trip

[R] Scaling Matrix in qda() function in MASS package

2017-08-23 Thread Souradeep Chattapadhyay
Hello, I am Souradeep Chattopadhyay and I am a graduate student at Iowa State University Department of Statistics. Can anyone please explain the mathematical formulation behind the scaling matrix returned by the qda function in MASS package. I want to understand how this scaling matrix