07-05-2017 10:32 AM - edited 07-05-2017 10:32 AM
Hi, I would really appreciate your help with this...
I have a dataset like this:
input id wt ;
The n of this dataset=10;
I need to get the weighted n value on this. weight variable is wt. There are no subgroups to use in proc surveyfreq.
How can I get the weighted n value?
Thanks in advance!!
07-05-2017 10:42 AM - edited 07-05-2017 10:42 AM
Well, it was over 40 years ago but I think the formula is just the wt value divided by the sum of all the wt values. For example:
do until (done1);
set have end=done1;
total_weights + wt;
do until (done2);
set have end=done2;
weighted_n = wt / total_weights;
07-05-2017 10:52 AM - edited 07-05-2017 11:05 AM
May I phrased it incorrectly.
I need weighted n value- since n=10, I am expecting it to be something like this 13.23 ; around the number 10 but higher; And I have been advised to use proc surveyfreq for this...