[b]原文没有提供数据,所以就在网上随便找了个数据进行测试,地址如下:
http://www.sasenterpriseminer.com/data/htwt.xls
该数据包含4个变量(性别sex,年龄age,身高height,体重weight),共237个观测[/b]
结果:
[table]
|变量 标签 N 均值 标准偏差 最小值 最大值
|
|age age 237 16.4430380 1.8425767 13.9000000 25.0000000
|
|height height 237 61.3645570 3.9454019 50.5000000 72.0000000
|
|weight weight 237 101.3080169 19.4406980 50.5000000 171.5000000|
[/table]
我们还可以增加ran
http://www.sasenterpriseminer.com/data/htwt.xls
该数据包含4个变量(性别sex,年龄age,身高height,体重weight),共237个观测[/b]
语法:
proc means <option(s)> <statistic-keyword(s)>;
by <descending> variable(s);
class variable(s) <option(s)>;
freq variable;
id variable(s);
output <out = dataset> <output-specification(s)>;
types request(s);
var variable(s);
ways list;
weight variable;
直接运行 proc means过程时,会对所有数值型变量进行操作,得到各变量的非缺失观测数N,均值MEAN,标准差STD DEV,最大值Max和最小值Min。
proc means data =Htwt;
run;
结果:
[table]
|变量 标签 N 均值 标准偏差 最小值 最大值
|
|age age 237 16.4430380 1.8425767 13.9000000 25.0000000
|
|height height 237 61.3645570 3.9454019 50.5000000 72.0000000
|
|weight weight 237 101.3080169 19.4406980 50.5000000 171.5000000|
[/table]
我们还可以增加ran