g******d 发帖数: 231 | 1 假设现有的数据有这几个变量:value, weight, group
我想做 value 的 mean, 但是要考虑到每一个observation的weight, weight取值从50
到100不等。然后这个 mean 要对 每一个 group (male, female) 单独计算。请问:该
用什么code比较简便?
另外,我还想算一下median,同样的步骤。
请指教。多些! | p******s 发帖数: 229 | 2 proc means data= yourdata;
weight yourweight;
class yourgroup;
var your value;
output mean= median= out= youroutput;
run; | g******d 发帖数: 231 | 3
thank you so much! this seems really straightforward. I really appreciate
that.
【在 p******s 的大作中提到】 : proc means data= yourdata; : weight yourweight; : class yourgroup; : var your value; : output mean= median= out= youroutput; : run;
|
|