Thanks! Thanks!! Thanks!!!. It's perfect!!!!!!
Please, I have a few questions on some parts of the code to enable me generalise the code to handle any number of variables: This is because a data set can have any number of variable--not just x and y; So that I will use something like &varlist.
want=j(ncol(level),4,.); What is the 4 doing; I assume is the number of observation in each replicate, right? Or is it the 4th column?
do i=1 to ncol(level); want[i,1]=level[i]; idx=loc(reps=level[i]); want[i,2:3]=data[idx,][:,]; What is the 2:3 doing? is it indexing column 2 to 3? If yes, in which data set? end; xx=want[,2:3]; what is the 2:3 doing? cov=cov(xx);
Thanks for you incredible help,
J want[,4]= mahalanobis(xx,center,cov); What is the 4 doing?
Thanks very much for your help.
... View more