This example demonstrates how to use PROC HPSAMPLE to perform simple random sampling on the Sampsio.Hmeq
data set, which resides on the client.
When the input data set resides on the client and no PERFORMANCE statement is specified, as in the following statements, the client performs all computations:
/*sampsio is a libref for a data source on the client.*/ proc hpsample data=sampsio.hmeq out=out1 sampobs=20 seed=13579; class job reason; var loan value delinq derog; run; proc print data=out1; run;
Output 9.1.1 shows the performance environment information.
Output 9.1.2 shows the number of observations in the data set sampsio.hmeq
and the number of samples.
Output 9.1.3 shows the sample data.
Output 9.1.3: Sample Data
Obs | JOB | REASON | LOAN | VALUE | DELINQ | DEROG |
---|---|---|---|---|---|---|
1 | Other | HomeImp | 4900 | 65774 | 2 | 1 |
2 | Other | HomeImp | 5700 | 82923 | 0 | 0 |
3 | Other | HomeImp | 7000 | 124827 | . | . |
4 | DebtCon | 8300 | 75081 | 0 | 0 | |
5 | Office | DebtCon | 10000 | 125500 | 0 | 0 |
6 | Other | 11100 | 61406 | 0 | 0 | |
7 | Other | HomeImp | 11500 | 64037 | 0 | 0 |
8 | ProfExe | HomeImp | 11900 | 105454 | 0 | 0 |
9 | Mgr | HomeImp | 15000 | 122400 | 2 | 0 |
10 | Other | HomeImp | 15000 | 107207 | 0 | 0 |
11 | ProfExe | HomeImp | 15600 | 106824 | 0 | 0 |
12 | Office | DebtCon | 17000 | 69000 | 0 | 0 |
13 | ProfExe | DebtCon | 17300 | 49100 | 0 | 0 |
14 | Other | DebtCon | 18000 | 60000 | 0 | 2 |
15 | Office | DebtCon | 21100 | 98000 | 2 | 0 |
16 | Other | HomeImp | 21400 | 103427 | 0 | 0 |
17 | Mgr | HomeImp | 22400 | 121601 | 0 | 0 |
18 | Other | HomeImp | 25000 | 202500 | 0 | 0 |
19 | Other | DebtCon | 25500 | 43031 | . | . |
20 | Mgr | DebtCon | 27500 | 149877 | 0 | 0 |
21 | ProfExe | DebtCon | 36500 | 195729 | 0 | 0 |
22 | Self | DebtCon | 70300 | 294169 | 0 | 0 |