From: David L Cassell on 5 Oct 2006 16:46 aknas_a(a)YAHOO.COM wrote: > >Here is excel formula to produce this result : >=SUMPRODUCT(A2:B2,C2:D2)/SUM(C2:D2) > >A B C D weighted average >14% 0% 72 368 2% >54% 0% 72 368 9% >4% 2% 72 368 2% >1% 0% 72 368 0% >26% 0% 72 368 4% >0% 1% 72 368 1% >3% 1% 72 368 1% > >Would like to get SAS code to produce the weighted average. > >Thanks > Use one of the SAS procs instead of hard-coding it. Something like the following will generate weighted averages for variables A, B, and C using a weight variable D: proc means data=yourdata mean; var A B C; weight D; run; But you may not want weighted averages, or you may want more sophistication in your analysis. What is your overall goal with these data? HTH, David -- David L. Cassell mathematical statistician Design Pathways 3115 NW Norwood Pl. Corvallis OR 97330 >Dii. _________________________________________________________________ All-in-one security and maintenance for your PC. Get a free 90-day trial! http://clk.atdmt.com/MSN/go/msnnkwlo0050000001msn/direct/01/?href=http://www.windowsonecare.com/?sc_cid=msn_hotmail
From: Aknas Dii on 7 Oct 2006 16:19 David, Jim and Jack - Thanks..Works great. DII.
|
Pages: 1 Prev: RE : Re: copulas and SAS Next: Importing data from MS SQL server to SAS 9.1 |