How to randomly select a certain data from a large dataset -

How to randomly select a certain data from a large dataset -

Post by jn_ma » Sat, 07 Nov 2009 06:17:43


--- On Thu, 11/5/09, Hoskins, Richard E. (DOH) < XXXX@XXXXX.COM >=


From: Hoskins, Richard E. (DOH) < XXXX@XXXXX.COM >
Subject: RE: How to randomly select a certain data from a large datase=
t
To: "jn mao" < XXXX@XXXXX.COM >, XXXX@XXXXX.COM
Date: Thursday, November 5, 2009, 3:02 PM


Data withRand; set mydata;
* Uniform random number for sampling;
uniRN=A0 =3D UNIFORM(1066); * neg number seed generates different sequence
each execution;
Run;

Proc sort data=3DwithRand;
By uniRN;
Run;

Data sample400; set withRand;
If _N_ <=3D 400 then output;
Run;=A0=20



=20
________________________
Forward or reply from:=20
Dick Hoskins
EMS/Trauma
WA DOH, Olympia


_________________________
=20

-----Original Message-----
From: SAS(r) Discussion [mailto: XXXX@XXXXX.COM ] On Behalf Of jn
mao
Sent: Thursday, November 05, 2009 12:39 PM
To: XXXX@XXXXX.COM
Subject: How to randomly select a certain data from a large dataset

Hello SAS-Ls,

I have a large dataset, about 20,000 data, and I need randomly select
just 400 of it. How do I use ranuni to retrieve only 400 data? Thanks a
lot.

Jane
=0A=0A=0A
 
 
 

1. Referencing data set B in data step A's DO loop

2. Copy all data from a:Class A's fields to the namesake fields of b:Class B.

I have two class with nearly exactly same attributes, the only difference is
class B's property setter does some argument checking.

[Serializable]
class A
{
private string a;

public string AA
{
get { return a; }
set { a = value; }
}
}

[Serializable]
class B
{
private string a;

public string AA
{
get { return a; }
set
{
if (string.IsNullOrEmpty(value))
{
throw new ApplicationException();
}
a = value;
}
}
}

I want to do the following:
A a = new A();
a.AA = "123123";
B b = (B)a; -- Copy a's attribute values to b.
Please tell me how to implement a generic function to support copying
namesake fields from one class instance to another even when they belongs to
different class type.

Thanks.

zlf

3. vlookup prob with all #n/a's

4. Summing N/A's

5. Finding the Value (of text and numbers) between N/A's

6. Clearing #N/A's in one go?

7. delete #N/A's in Excel

8. Sending E-mail A's another user (Sent Items)

9. Printing report b after report a prints using report a's variables

10. Why does Form-A's instance fire Form-B's event??

11. Capture image of App#A's window from App#B

12. using "if" but omitting the #n/a's

13. equation that will filter out #N/A's

14. lookup only finds #n/a's

15. "Matching" column A's values in column B