Dear Expert:

When I performed one bootstrap procedures, the final result should be n=200 meanr=0.61076 and std=0.096866. However I copied the SAS codes and the real result is n=1, meanr=0.6 and std is missing. Could you take those SAS codes and give some guidance to revise it? Thanks! I enclose the following SAS codes:

data a;
%let replicate =200; *replicate=200, the number of repeated samples;
%let unit =5; *unit=the number of original sample size (number of households);
Proc plan seed=100;
Factors replicate=&replicate ordered unit=&unit t=1 of &unit/noprint;
Output out=a; run;

Data a;
Set a;
Do j=1 to &unit; *number of different observation;
Output; end; keep replicate t unit j;
Data a1; set a; drop unit; proc sort; by replicate j;
Data a2; set a; keep replicate j unit; proc sort; by replicate j unit;
Data a; merge a1 a2; by replicate j; proc sort; by replicate j;
Data b;
/***input data***/
Input household numpeople college@@; cards;
1 4 2 2 1 1 3 5 3 4 3 1 5 2 2
;
/***end of input data***/
Data b; set b; do i=1 to &replicate ; replicate=1 ; output;
End;
Data b ; set b; keep numpeople college replicate household j;
Do j=1 to &unit; output; end;
proc sort; by replicate j;
Data final; merge a b; by replicate j; proc sort; by replicate j; run;
Data final1; set final; if j =unit; tkeep =t; keep replicate j tkeep; proc sort; by replicate j;run;
Data final2; merge final final1; by replicate j; if tkeep =household; proc sort; by replicate; run;
Proc univariate data=final2 noprint ; var numpeople college; output out =stats sum =sumnumpeople sumcollege n =n; by replicate; run;
Data stats; set stats; r =sumcollege/sumnumpeople; run;
Proc univariate noprint; var r; output out =stats1 n =n mean =meanr std =std; run;
Data stats1; set stats1; proc print; run;