Type : CREATION_INTERNE
Les données sont générées directement dans le script via une étape DATA avec DATALINES (table IceCream).
| 1 | DATA IceCream; |
| 2 | INPUT Grade Spending Income Kids @@; |
| 3 | DATALINES; |
| 4 | 7 7 39 2 7 7 38 1 8 12 47 1 |
| 5 | 9 10 47 4 7 1 34 4 7 10 43 2 |
| 6 | 7 3 44 4 8 20 60 3 8 19 57 4 |
| 7 | 7 2 35 2 7 2 36 1 9 15 51 1 |
| 8 | 8 16 53 1 7 6 37 4 7 6 41 2 |
| 9 | 7 6 39 2 9 15 50 4 8 17 57 3 |
| 10 | 8 14 46 2 9 8 41 2 9 8 41 1 |
| 11 | 9 7 47 3 7 3 39 3 7 12 50 2 |
| 12 | 7 4 43 4 9 14 46 3 8 18 58 4 |
| 13 | 9 9 44 3 7 2 37 1 7 1 37 2 |
| 14 | 7 4 44 2 7 11 42 2 9 8 41 2 |
| 15 | 8 10 42 2 8 13 46 1 7 2 40 3 |
| 16 | 9 6 45 1 9 11 45 4 7 2 36 1 |
| 17 | 7 9 46 1 |
| 18 | ; |
| 1 | DATA IceCream; |
| 2 | SET IceCream; |
| 3 | IF Grade=7 THEN Prob=20/1824; |
| 4 | IF Grade=8 THEN Prob=9/1025; |
| 5 | IF Grade=9 THEN Prob=11/1151; |
| 6 | Weight=1/Prob; |
| 7 | RUN; |
| 1 | title1 'Ice Cream Spending Analysis'; |
| 2 | title2 'Use the Jackknife Method to Estimate the Variance'; |
| 3 | PROC SURVEYREG DATA=IceCream |
| 4 | varmethod=JACKKNIFE(outweights=JKWeights); |
| 5 | strata Grade; |
| 6 | class Kids; |
| 7 | model Spending = Income Kids / solution; |
| 8 | weight Weight; |
| 9 | RUN; |
| 1 | title 'The Jackknife Weights for the First 6 Obs'; |
| 2 | PROC PRINT |
| 3 | DATA=JKWeights (obs=6); |
| 4 | RUN; |
| 5 |