sas:将数组转化为矩阵
来源:互联网 发布:网络金融理财咨询 编辑:程序博客网 时间:2024/06/12 01:28
/*数组表*/data a;input name $ other $; cards;a ba ca db ab db fc b c dc ac ed cd ad e d fe b e df af cf ba f; /*排序*/proc sort data=a out=c;by name other;run; /*复制表*/data b;input name2 $ other2 $;cards;a ba ca db ab db fc b c dc ac ed cd ad e d fe b e df af cf ba f; /*排序*/proc sort data=b out=d;by name2 other2;run; /*选择双向相关的数组*/proc SQL;create table cccc as select distinct a.name,a.otherfrom a,bwhere a.other=b.name2 and a.name=b.other2;run;data m;set cccc;d=1;run; /*利用转置过程*/proc transpose data=m out=n(rename=(_name_=other));var d;by name;id other;label other=;run;proc contents data=n out=p;run;proc sql;select name into:var separated by ',' from p where name not like 'name' ;create table x as select name,&var from n;quit;data u;set x;drop other;run;
还有一个在知乎上问过的相关问题:
https://www.zhihu.com/question/46338489?from=profile_question_card
两个问题相互补充,很适合做社会网络分析
2 0
- sas:将数组转化为矩阵
- 将字符串转化为数组
- 将01矩阵转化为bitmap文件
- 半矩阵转化为一维数组
- 判断并将矩阵转化为严格对角占优矩阵
- 将Byte数组转化为String
- 将Byte数组转化为String
- [转贴]将Byte数组转化为String
- 将Byte数组转化为String
- 将Byte数组转化为String
- 将Byte数组转化为String
- 将Byte数组转化为String
- 将Byte数组转化为String
- 将字符串数组转化为字符串
- 将ArrayList转化为数组array
- 如何将list转化为数组
- 将数组转化为XML数据
- 如何将list转化为数组
- 第十五周阅读程序(3)
- mysql 创建函数 error Code: 1227. Access denied;
- hive优化记录----合并小文件压缩输出
- Android 沉浸式状态栏的实现
- php字符串处理函数大全
- sas:将数组转化为矩阵
- 排序--SelectSort优化
- C++拷贝构造函数详解
- servlet/action动态获取请求URL地址
- 同一Tomcat 多个端口部署不同的项目
- Lua入门教程 0.环境配置
- Sum Root to Leaf Numbers
- 分区管理的内存分配算法
- SVN 中trunk、tags、branches使用