SAS中文论坛

标题: 请教高人:一个更难的问题 [打印本页]

作者: shiyiming    时间: 2008-11-16 11:20
标题: 请教高人:一个更难的问题
数据集A中有两组变量 q1-q10;b1-b3;都是数值型的.注意其中有好多变量有缺失值.甚至整个变量都缺失.q1-q10 每个变量取值范围为1---100的整数.B1-B3是对其的编码,现在检查原数据集的编码是否正确,1.把编码正确的和错误的分开放到两个数据集中 并导到EXCEL里.
2.把B1编码正确的和错误的分开放到两个数据集中 并导到EXCEL里.
3 把B2编码正确的和错误的分开放到两个数据集中 并导到EXCEL里.
4 把B3编码正确的和错误的分开放到两个数据集中 并导到EXCEL里.

编码规则为: 若Q1-Q8的值在1---80的 B1 应为1,Q9在 80-99的 B2 应为2,Q10 为100的 B3 应为3;
作者: shiyiming    时间: 2008-11-16 13:22
标题: Re: 请教高人:一个更难的问题
i think this one might be easier.
suppose you have a format (called 'afmt') that maps 1-80 to '1', then b1=1 and put(q[i], afmt.)='1' for all i=1,...,8 --> b1 is alright. And so on.




欢迎光临 SAS中文论坛 (https://mysas.net/forum/) Powered by Discuz! X3.2