> I want the covariance values.
They are in v.
> I would like the low matrix but with missing values on the diagonal.
low = j(n, p, .);
do i = 2 to n;
cols = 1:i-1;
low[i, cols] = a[i, cols];
end;
> show me how to produce the mean, min, max, ... of the covariance part
> of the matrix for A, B and C in IML ?
For the matrix a, you can compute the mean (or max or min...) of three different quantities: the total mean, the rows means, or the column means.
For the totals:
mean = a[:]; /* ":" is mean operator */
min = min(a);
max = max(a);
print mean min max;
For the column means:
ColMean = a[:,]; /* mean of each column (apply operation on rows)*/
ColMin = a[><,]; /* min of each column */
ColMax = a[<>,]; /* max of each column */
print ColMean, ColMin, ColMax;
These subscript reduction operators take some getting used to, but are great for computing summary statistics without writing any loops. They are documented in the "Working with Matrices" chapter of the SAS/IML User's Guide:
http://support.sas.com/documentation/cdl/en/imlug/59656/HTML/default/workmatrix_sect14.htm
... View more