LISTSERV at the University of Georgia
Menubar Imagemap
Home Browse Manage Request Manuals Register
Previous (more recent) messageNext (less recent) messagePrevious (more recent) in topicNext (less recent) in topicPrevious (more recent) by same authorNext (less recent) by same authorPrevious page (March 1997, week 3)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Thu, 20 Mar 1997 16:30:20 -0500
Reply-To:     Rodney Sparapani <spara002@MC.DUKE.EDU>
Sender:       "SAS(r) Discussion" <SAS-L@UGA.CC.UGA.EDU>
From:         Rodney Sparapani <spara002@MC.DUKE.EDU>
Organization: Duke Clinical Research Institute
Subject:      Re: Bootstraping in SAS
Content-Type: multipart/mixed;

Joseph Ogutu wrote: > > Walter Johnston wrote: > > > Yes, it is possible - and not particularly difficult. But what are > > you wanting to bootstrap? > > > > Walter Johnston, Ph.D. (Statistics) > > I conducted a field study to develop a technique for estimating lion > population size in the wild and evaluate the variability in the > population size estimates based on this method.I used a simple random > sampling design (sample size = 32) to obtain the field data. I would > like to bootstrap the bias and the 95% confidence limits of the lion > population size estimates based on this procedure. > > *********************************************** > Josef O. Ogutu > Humboldt-University of Berlin > Faculty of Agriculture and Horticulture > Institute of Basic Animal Sciences > Lentzealle 75, 14195 Berlin, Germany > Phone: 0049-30-314-71101 FAX: 0049-30-31471426 > E-Mail: ogutu@hjs1.iae.tu-berlin.de > ***********************************************

-- You can't pick your ex.

Rodney Sparapani Go Blue Devils. Duke Clinical Research Institute Go Packers.


%global _iter_ _strata_;

%macro _boot(data=&syslast, out=REQUIRED, seed=int(time()), iter=1000, attrib=, by=, class=, firstobs=, drop=, keep=, obs=, rename=, where=, help=, log=);

%if "&out"="REQUIRED" | %length(&help) %then %_readme(/cvrct/sasmacro/text/_boot, help=&help); %if %length(&log) %then %_printto(log=&log); %let by=&by &class;

%if %length(&class) %then proc sort out=&out data=&data; %else %do; data &out; set &data %end;

%if %index(&data, %str(%())=0 & %index(&data, %str(%)))=0 %then %do; ( %if %length(&firstobs) %then firstobs=&firstobs; %if %length(&drop) %then drop=&drop; %if %length(&keep) %then keep=&keep; %if %length(&obs) %then obs=&obs; %if %length(&rename) %then rename=(%scan(&rename, 1, ())); %if %length(&where) %then where=(&where); ) %end; %else %do; %put NOTE: You have specified Dataset Options in the DATA Keyword Parameter.; %put NOTE: Therefore, all Keyword Parameter Dataset Options will be ignored.; %end; ;

by &by; attrib &attrib;

run;

%local last; %let _iter_=&iter;

%if %length(&by) %then %do; %let _strata_=%upcase(&by); %let last=%scan(&by, %_count(&by), %str( )); %end;

data &out; set &out end=end; by &by; drop i nobs offset; retain offset boot 0; seed=&seed; obs=_n_; output;

if end then do; link boot; stop; end; %if %length(&by) %then %do; else if last.&last then do; link boot; end; %end;

return;

boot:;

nobs=_n_-offset;

do boot=1 to &iter; do i=1 to nobs; p=ranuni(seed); p=ceil(nobs*p)+offset; set &out point=p; obs=p; output; end; end;

boot=0; offset=_n_; return;

run;

%if %length(&by) %then %do; proc sort data=&out; by boot &by obs; run; %end;

%if %length(&log) %then %_printto; %mend _boot;

%*VALIDATION TEST STREAM; /* un-comment to re-validate %_boot; */


Back to: Top of message | Previous page | Main SAS-L page