BookmarkSubscribeRSS Feed
ahhh
Obsidian | Level 7

Hi, I would really appreciate your help with this...

I have a dataset like this:

data one;
input id wt ;
datalines;
1 2.3
2 3.1
3 5.3
4 2.0
5 4.0
6 2.3
7 1.9
8 2.0
9 2.1
10 2.4
;
run;

 

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!!

3 REPLIES 3
Astounding
PROC Star

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:

 

data want;

do until (done1);

   set have end=done1;

   total_weights + wt;

end;

do until (done2);

   set have end=done2;

   weighted_n = wt / total_weights;

   output;

end;

run;

ahhh
Obsidian | Level 7

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...

ahhh
Obsidian | Level 7
I would really appreciate if someone can help with this..

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

What is ANOVA?

ANOVA, or Analysis Of Variance, is used to compare the averages or means of two or more populations to better understand how they differ. Watch this tutorial for more.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 3 replies
  • 1414 views
  • 0 likes
  • 2 in conversation