COMPGROUPS.NET | Search | Post Question | Groups | Stream | About | Register

### Sampling Problem

• Email
• Follow

```Hello:
=20
I have the following data that I would like to randomly sample records from=
:
=20
Order Lot Grain Class Weight
00209 0 Canola 21313.550
00214 0 Canola 10488.960
00203 1 Canola 5414.664
00140 0 OatNCC 9359.426
00218 0 Canola 26250.000
00204 0 Wheat CWRS 8157.350
00204 0 Wheat CWRS 7599.205
00204 0 Wheat CWRS 10160.540
00204 0 Wheat CWRS 6020.755
00213 2 Canola 27006.395
00219 0 Canola 8191.057
00219 0 Canola 12964.728
00216 1 Canola 25607.506
00210 0 Wheat CWRS 17821.145
00207 1 Barley 28111.276
00207 2 Barley 1538.731
00217 0 Wheat CWRW 18600.000
00215 0 Peas 5850.000
00025 1 Soybns 544.295
00026 0 Flax 14147.310
00999 0 BlyNCC 213.979
=20
I would like to sample all the different grains and classes at set rate=2C =
and have a minimum and maximum number of samples drawn each time I sample=
=2C and Proc Surveyselect would work great in instances like this.=20
=20

The tricky part is that my client is looking for rare event items=2C and fe=
els he may find more if he samples the larger weight orders=2C so for examp=
le the first 3 canola orders he would prefer order 209 lot # 0 (21=2C313 to=
nnes) to order 203 lot # 1 (5=2C414 tonnes). Also the average weight of man=
y of the shipments will be related to the grain (and class) shipped=2C so f=
or example order 215 lot #0 Peas (5850 tones) relative to all other Pea shi=
pments during made during the year will be huge. Finally=2C at the end of t=
he year the client would like the sampling rate on all the shipments and al=
l the grains/Classes to be close to x%. I will have ~29 different grain (Su=
bclass) groups I would need to sample from and in the largest group there m=
ay be 1000 orders a year in the smaller group there could be none....
=20

I have a couple of other sampling programs I have made and I have done samp=
ling (using survey select) by grain grouping but I have never added the wei=
ghting to sample for larger cargoes.=20
=20
I realized I havn't included all the information or even challenges in this=
email. For example I plan on running this program monthly so  there will h=
ave to be some sort of forecastsing for the number (and maybe even weight) =
of orders of each grain throughout the year but I could have a large histor=
ical data to test out some of my sampling strategies.
=20
I=92m not looking for the exact sas code to do this per se but hoping to ge=
t a general sense of the procedures and calculations that may be involved.
=20
Thanks for the help.
=20
Kevin =20
=20

=20
=20
=20
=20
=20
=20
=20
=20
=20
=20

=20
=20
_________________________________________________________________
Say Happy New Year with Messenger for Mobile.
```
 0

See related articles to this posting

0 Replies
361 Views

Similar Articles

12/2/2013 7:28:41 AM
page loaded in 2131 ms. (0)