Documentation Example 9 for PROC SURVEYREG
/****************************************************************/
/* S A S S A M P L E L I B R A R Y */
/* */
/* NAME: SVREX9 */
/* TITLE: Documentation Example 9 for PROC SURVEYREG */
/* PRODUCT: STAT */
/* SYSTEM: ALL */
/* KEYS: regression, survey sampling, resampling */
/* KEYS: domain analysis, replication */
/* KEYS: unequal weighting, linear model */
/* PROCS: SURVEYREG */
/* DATA: */
/* */
/* SUPPORT: sasaba */
/* REF: PROC SURVEYREG, Example 9 */
/* */
/* MISC: Variance Estimate Using the Jackknife Method */
/* */
/****************************************************************/
data IceCream;
input Grade Spending Income Kids @@;
datalines;
7 7 39 2 7 7 38 1 8 12 47 1
9 10 47 4 7 1 34 4 7 10 43 2
7 3 44 4 8 20 60 3 8 19 57 4
7 2 35 2 7 2 36 1 9 15 51 1
8 16 53 1 7 6 37 4 7 6 41 2
7 6 39 2 9 15 50 4 8 17 57 3
8 14 46 2 9 8 41 2 9 8 41 1
9 7 47 3 7 3 39 3 7 12 50 2
7 4 43 4 9 14 46 3 8 18 58 4
9 9 44 3 7 2 37 1 7 1 37 2
7 4 44 2 7 11 42 2 9 8 41 2
8 10 42 2 8 13 46 1 7 2 40 3
9 6 45 1 9 11 45 4 7 2 36 1
7 9 46 1
;
data IceCream;
set IceCream;
if Grade=7 then Prob=20/1824;
if Grade=8 then Prob=9/1025;
if Grade=9 then Prob=11/1151;
Weight=1/Prob;
run;
title1 'Ice Cream Spending Analysis';
title2 'Use the Jackknife Method to Estimate the Variance';
proc surveyreg data=IceCream
varmethod=JACKKNIFE(outweights=JKWeights);
strata Grade;
class Kids;
model Spending = Income Kids / solution;
weight Weight;
run;
title 'The Jackknife Weights for the First 6 Obs';
proc print data=JKWeights (obs=6);
run;