SAS实现 排列、组合

您所在的位置:网站首页 朱迪琳奥凯弗 SAS实现 排列、组合

SAS实现 排列、组合

#SAS实现 排列、组合| 来源: 网络整理| 查看: 265

(SAS提供了4个函数用来生成组合 ( combinations ) 。)

ALLCOMB Function

功能: 从 n 个变量中取出 k 个变量,列出所有可能的值的组合, 每次以最小的变化顺序(at a time in a minimal change order)。(All Combinations of the value),包含missing,nonmissing。

语法:ALLCOMB(count, k, variable-1, … , variable-n)

参数 count :指定一个整数变量。这个变量在一个循环中(a loop)被分配1到组合数的值(comb(n,r))。 

参数:k : 指定一个整数常数,或一个表达式.值为1~n之间的值。包含,指定每个组合的元素的数量。

参数: variable:  specifies either all numeric variables, or all character variables that have the same length. The values of these variables are permuted.

LEXCOMB :  所有非缺失值的不同组合(all distinct combinations of the nonmissing values of several variables.) (The combinations are generated in lexicographic order.)

ALLCOMBI : N items的所有索引的组合. 索引(indices)是1到N的整数.

LEXCOMBI : N items的索引的所有组合.组合以词典顺序生成(lexicographic order).

COMB : 计算从 n 个元素中取出 r 个元素的组合数(Computes the number of combinations of n elements taken r at a time.)

语法:    COMB ( n, r )

n 表示: the total number of elements from which the sample is chosen.

r 表示: the number of chosen elements.



【本文地址】


今日新闻


推荐新闻


CopyRight 2018-2019 办公设备维修网 版权所有 豫ICP备15022753号-3