求教各位高手,我现在用bootstrap找confidence interval,
我的code如下
data spatial;
input a b @@;
cards;
48 42 36 33 20 16 29 39 42 38 42 36 20 15 42 33 22 20 41 43 45 34
14 22 6 7 0 15 33 34 28 29 34 41 4 13 32 38 24 25 47 27 41 41
24 28 26 14 30 28 41 40
;
/*To use the %JACK or %BOOT macros, you must write a macro called %ANALYZE to do the data analysis
that you want to bootstrap. The %ANALYZE macro must have two arguments:
DATA= the name of the input data set to analyze
OUT= the name of the output data set containing the statistics
for which you want to compute bootstrap distributions.
*/
%macro analyze(data=,out=);
proc means noprint data=&data vardef=n;
output out=&out(drop=_freq_ _type_) var=var_a var_b;
var a b;
*%bystmt;
run;
%mend;
/* %analyze(data=spatial,out=temp); proc print data=temp;run;*/
title2 'Normal ("Standard") Confidence Interval with Bias Correction';
%boot(data=spatial,alpha=.10,samples=100,random=123);
title2 'Normal ("Standard") Confidence Interval without Bias Correction';
%bootse(alpha=.10,biascorr=0);
title2 'Efron''s Percentile Confidence Interval';
%bootci(percentile,alpha=.10);
title2 'BC Confidence Interval';
%bootci(bc,alpha=.10);
title2 'BCa Confidence Interval';
%bootci(bca,alpha=.10);
title2 'Resampling with Computation of Studentizing Statistics';
%macro analyze(data=,out=);
proc means noprint data=&data vardef=n;
output out=&out(drop=_freq_ _type_)
var=var_a var_b kurtosis=kurt_a kurt_b;
var a b;
%bystmt;
run;
data &out;
set &out;
stud_a=var_a*sqrt(kurt_a+2);
stud_b=var_b*sqrt(kurt_b+2);
drop kurt_a kurt_b;
run;
%mend;
%boot(data=spatial,stat=var_a var_b,samples=100,random=123);
title2 'T Confidence Interval';
%bootci(t,stat=var_a var_b,student=stud_a stud_b,alpha=.10)
我最后得到的var b 90%的 bootstrap confidence interval是70到150,我dataset里面的var b竟然全不在90% confidence interval,所以求问是什么情况。我即使用t-distribution算90% confidence interval 117 到228。
所以我不是很明白,为什么我dataset里面的data 全不在我的confidence interval