Prepared by Meena R S
Bootstrap method is a way of simulating results for a larger number of samples based on the given sample. The bootstrap method is used to quantify the uncertainty in any parameter estimate (e.g., mean, variance, percentile value, etc.). All bootstrap methods involve generating hypothetical samples from the original sample. Each hypothetical sample is called a Bootstrap Sample.
Bootstrap method has the following assumptions
1. The sample taken should be a valid representative of the population
2. Bootstrap method takes sampling with replacement from the sample. Each sub sampling is independent and identical distribution (i.i.d.). In other words, it assumes that the sub samples come from the same distribution of the population, but each sample is drawn independently from the other samples.
The bootstrap works by computing the desired statistic for a sub sample of the data set. The sub sampling is done with replacement and the size of the sample is equal to the size of the original sample. The desired statistic is calculated for each sub sample. The collection of these statistics is used as an estimate of the sampling distribution.
Example 1: The following example represents the length of 3 different petals 10 trees of the same type. This program estimates the uncertainty parameters mean and standard deviation
data petals;
input petal1 petal2 petal3;
cards;
1.21 1.31 1.53
2.13 2.21 3.17
1.59 1.70 1.56
1.45 1.23 1.21
1.41 1.96 1.24
1.04 1.8 1.58
1.03 1.05 2.1
1.4 1.25 1.26
1.56 1.26 1.34
1.82 1.24 1.56
;
run;
* This macro is used to generate 10 bootstrap samples of the above data;
%macro bootsamp(data,boot, b);
data &boot;
do isample=1 to &b;
do i = 1 to nobs;
pt = round(ranuni(0) * nobs) ;
set &data nobs = nobs point=pt; *point options is used to create samples in any order;
output;
end;
end;
stop;
run;
%mend;
%bootsamp(petals, boot, 10); *Generating 10 bootstrap samples;
*Calculating the parameters mean and standard deviation for each subsample and appending them to obtain the final sample dataset;
%macro sample(j=, n=);
%do i=&j %to &n;
data petals1;
set boot;
where isample=&i;
run;
proc means data=petals1 ;
var petal1 petal2 petal3 ;
output out = petals_&i mean = mean std = std n =n;
run;
proc append base=final data=petals_&i force;
run;
%end;
%mend;
%sample (j=1, n=10);
proc means data=final mean std ;
var mean std;
output out = means_ mean = mean std = std n =n;
run;
Output is shown below
2 comments:
Good dispatch and this fill someone in on helped me alot in my college assignement. Thanks you on your information.
Well I agree but I dream the list inform should secure more info then it has.
Post a Comment