I searched on line and found the following link: https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/bring-back-Lower-triangular-matrix/td-p/60714 which discussed calculating the lower triangular matrix. The attached code was provided at the link: /*LOWER TRIANGULAR CODE SAS IML*/
proc import out=a
datafile='/folders/myfolders/dmatrix/lnparam.csv/'
dbms=csv replace;
getnames=yes;
datarow=2;
run;
proc iml;
/*To get the values in a vector, you can use*/
lower = symsqr(a);
upper = symsqr(a`);
/*If you need the lower triangular matrix with zeros above the diagonal, you can use:*/
n = nrow(a);
p = ncol(a);
low = j(n, p, 0);
do i = 1 to n;
cols = 1:i; /* or cols=iSmiley Tongue; */
low[i, cols] = a[i, cols];
end;
quit; When I run the code I get several errors: /*To get the values in a vector, you can use*/ 107 lower = symsqr(a); ERROR: (execution) Matrix has not been set to a value. I get the same error for a' /*If you need the lower triangular matrix with zeros above the diagonal, you can use:*/ 111 n = nrow(a); 112 p = ncol(a); 113 low = j(n, p, 0); ERROR: (execution) Invalid operand to operation. I have attached my data set lnparam.txt Can someone with expertise in SAS IML tell me how to correct the error? A final question related to the lower triangle matrix. If one calls the lower triangular matrix D and D' its transpose (i.e., does the var cov matrix=DxD')?
... View more