高人:
下列一组数据:
1 | . | . | 1 | . | . | 1 | 1 | . | 1 | . | . | . | . | 1 |
1、怎样编程,来统计1出现的次数(按竖行输出下列形式)
1 | . | . | 2 | . | . | 3 | 4 | . | 5 | . | . | . | . | 6 |
2、怎样编程,数字1的间隔次数(按竖行输出下列形式)
. | . | 2 | . | . | 2 | . | . | 1 | . | . | . | . | 4 | . |
求助高手帮我。 谢谢!!
楼主: l6397
|
1633
6
[求助]高人:读取观察值的程序 |
博士生 42%
-
|
回帖推荐proc
iml;
iml;/*the following program replace the jth 1 in a vector A by j */A={1
1
0
6
1
0
1};len=ncol(A);j=0; /* j denotes the jth 1 in A;*/1
1
0
6
1
0
1};len=ncol(A);j=0; /* j denotes the jth 1 in A;*/0; /* j denotes the jth 1 in A;*/do i=1 to len; /*A dnotes the ith element of A;*/do i=1 to len; /*A dnotes the ith element of A;*/if A=1 then do;j=j+1;A ...
本帖被以下文库推荐
| |||||||||||||||||||||||||||||||||||||||||||||||
| ||
| ||
| ||
京ICP备16021002-2号 京B2-20170662号 京公网安备 11010802022788号 论坛法律顾问:王进律师 知识产权保护声明 免责及隐私声明