data abc; a = 1; output; a = 99; output; run; proc format; invalue abc 99 = . other = _same_; value abc 99 = . other = _same_; run; proc means data = abc; format a abc.; informat a abc.; var a; run;
我希望上面的代码给出变量a的平均值为1,但它没有,in proc意味着它似乎不想使用我定义的格式。有什么办法可以让它起作用吗?
据我所知,格式可以用来显示值。任何分析都不会考虑格式。
标准差。
格式和信息不是这样的。信息员在传入数据保存到sas数据集中之前更改它。格式改变了输出数据的方式,但底层数据保持不变。此外,格式不适用于计算。
data abc; a = 1; output; a = 99; output; run; data def; set abc; if a = 99 then a = .N; run; proc means data = def; var a; run;