m******1 发帖数: 19713 | 1 I have a data set like this:
id x
1 0.254
2 0.564
3 0.875
4 0.689
.......
The weight for each observation is x/sum of x's. What is the best way to
calculate it?
Thanks. | c*******o 发帖数: 3829 | 2 Here you go:
Proc sql;
create table two as
select id, x, x/sum(x) as weight
from one;
quit; | m******1 发帖数: 19713 | 3 Thank you so much.
This is very helpful.
【在 c*******o 的大作中提到】 : Here you go: : Proc sql; : create table two as : select id, x, x/sum(x) as weight : from one; : quit;
|
|