I have a project due tomorrow and I am stuck, please help.
I have to use SAS to use bootstrap re-sampling to create a 95% Confidence Interval.
Here is what I have for my code currently.
data one; input x @@ ;
datalines;
114 109 117 237 97 152 113 117 114 141 135 294 117 135 107 109
106 183 176 421 364 320 102 158 114 120 369 171 231 192 146 99
209 136 112 143 122 101 112 552
;
proc surveyselect data=one method = urs sampsize = 40
rep=1000 out=bootstrapsamps outhits;
run;
proc means data=bootstrapsamps;
output out=mean mean=mvar;
run;
title 'CI95%';
proc univariate data=mean;
var mvar;
output out=final pctlpts=2.5, 97.5 pctlpre=ci;
run;
proc print data=final;
run;
So I use proc surveyselect to get the new samples.
They are output to the variable bootstrapsamps.
Then I use procmeans to get the means of each sample.
Then I want to use proc univariate to get the 2.5 and 97.5 percentiles.
This is where the problem occurs and proc univariate is not receiving the correct data because it only has one observation. I think the problem lies in either proc means or proc univariate.
Can anyone tell me where my code is going wrong?
I have to use SAS to use bootstrap re-sampling to create a 95% Confidence Interval.
Here is what I have for my code currently.
data one; input x @@ ;
datalines;
114 109 117 237 97 152 113 117 114 141 135 294 117 135 107 109
106 183 176 421 364 320 102 158 114 120 369 171 231 192 146 99
209 136 112 143 122 101 112 552
;
proc surveyselect data=one method = urs sampsize = 40
rep=1000 out=bootstrapsamps outhits;
run;
proc means data=bootstrapsamps;
output out=mean mean=mvar;
run;
title 'CI95%';
proc univariate data=mean;
var mvar;
output out=final pctlpts=2.5, 97.5 pctlpre=ci;
run;
proc print data=final;
run;
So I use proc surveyselect to get the new samples.
They are output to the variable bootstrapsamps.
Then I use procmeans to get the means of each sample.
Then I want to use proc univariate to get the 2.5 and 97.5 percentiles.
This is where the problem occurs and proc univariate is not receiving the correct data because it only has one observation. I think the problem lies in either proc means or proc univariate.
Can anyone tell me where my code is going wrong?