LISTSERV at the University of Georgia
Menubar Imagemap
Home Browse Manage Request Manuals Register
Previous messageNext messagePrevious in topicNext in topicPrevious by same authorNext by same authorPrevious page (February 2006, week 2)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Fri, 10 Feb 2006 11:05:44 -0800
Reply-To:     Dale Remus <hellangel_987@YAHOO.COM>
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:         Dale Remus <hellangel_987@YAHOO.COM>
Subject:      sampling based on weighted probability
In-Reply-To:  <BAY101-F23FB03FF59708E17888664DE030@phx.gbl>
Content-Type: text/plain; charset=iso-8859-1

Hi,

I'd like to present my question in a much simplified way:

I have a data set with variable x and weight:

x weight 1 0.3 2 0.2 3 0.4 4 0.07 5 0.03

(note that sum of the weight is 1)

I need to take a sample of size, say 2, from x, but not random sampling: x is to be selected with probability of the corresponding weight, for example, with probability 0.3, x=1 is selected.

I am very frustrated that while this job can be done in R as easily as one line statement sample(x,2,prob=w), SAS technicians couldn't even understand my question after more than one follow-up. Every time they directed me to PROC SURVEYSELECT using options METHOD=PPS. I have read through the SAS manual carefully, I am positive this is not the same issue. It seems to me they've never heard of any sampling scheme other than simple random sample.

As a graduate student at Statistics department, I had been enjoying writing codes in R for 3 years mainly because that almost all academic professionals prefer R to SAS, believing the former a research-oriented programming language while the latter merely a tool to manipulate data. But I myself have turned back to SAS as I found that R is easily broken down with moderate to large size data while SAS has the amazing capacity and efficiency of huge data prosessing which insurmountable by R. I have ever since implemented all of our algorithms in SAS. But the lack of flexibility, the lack of easy-used functions of SAS have made my life increasing difficult as our research project getting more and more complicated.

Thank you for lisening to my blah blah.

Dale

__________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com


Back to: Top of message | Previous page | Main SAS-L page