Header 1 | Header 2 | Header 3 |
---|---|---|
1 | ||
0.2 | 1 | |
0.5 | 0.9 | 1 |
0.8 | 0 | 0.28 |
So I have something like this but it's a very big one (100K*100K).
Header 1 | Header 2 | Header 3 |
---|---|---|
1 | 0.2 | 0.5 |
0.2 | 1 | 0.9 |
0.5 | 0.9 | 1 |
I hope to get the spces all filled up with a correlation or simmilarity whatever becomes
I know proc iml can do this quickly but my sas just doesn't have proc iml comes with it.
Please let me know anyway I can solve the problem.
I aprpeciate!!
-Sarah
100k variables is a lot! This works for 10,000 variables and doesn't take too long. I tried it with 100,000 but did not want to wait for it to finish.
This method is simple flip the data over, so that you get an upper trianglar. Then update the lower with the upper. Requires an observation index variable (_obs_).
100k variables is a lot! This works for 10,000 variables and doesn't take too long. I tried it with 100,000 but did not want to wait for it to finish.
This method is simple flip the data over, so that you get an upper trianglar. Then update the lower with the upper. Requires an observation index variable (_obs_).
I do not think a 100k X 100k matrix will be possible to do this way, I think it tops out somewhere above 16k X 16k. Not sure if this is some limit on FCMP.
proc fcmp;
array x[10000,10000] /nosymbols;
t=time();
/* fill lower triangle */
do a=1 to 10000;
do b=1 to a;
x[a,b]=1 ++ a +- b ;
end;
end;
d=time()-t;
put 'fill=' d 'seconds';
t=time();
/* fill upper triangle */
do a=1 to 10000 by 1;
do b=10000 to a by +-1;
x[a,b]=x[b,a];
end;
end;
d=time()-t;
put 'transpose=' d 'seconds';
t=time();
rc=write_array('all',x);
d=time()-t;
put 'write=' d 'seconds';
run;
fill= 1.0461549759 seconds
transpose= 2.3460171223 seconds
write= 7.7724590302 seconds
I appreciate!!!!!!!!!!!!!!!!
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.