Hello, I have an Excel spreadsheet with 17 rows of data. The first column is YEAR, the second column is a continuous value from 0 to 4.29, called RawRate. That's the data.
I have run a bootstrapping simulation with 10,000 replications, then a Proc Means to characterise the distribution of the simulated means. This all works, here is the output:
1.9854599 | 1.9982321 | 1.9918460 | 1.3434024 | 0 | 4.2900000 | 170000 |
What I have been struggling with is that I would like to export the 10,000 simulated means to an Excel file. I have tried a DM function but it's not working, it just exports two columns; the first is the number of each iteration and the second is from 1 to 17, 10,000 times. Here is the code - how can I export the simulated means please?
data ;
do sampnum = 1 to 10000; /* To create 10000 bootstrap replications */
do i = 1 to 17; /* Want same no. obs as in ORIGINAL */
x = round(ranuni(0) * 17); /* x randomly selected from values 1 to NOBS */
set YearRate
nobs = nobs
point = x; /* This selected the xth observation in ORIGINAL */
output; /* Send the selected observation to the new data set */
end;
end;
stop; /* Required when using the POINT= command */
run;
proc means CLM mean stddev min max n;
var RawRate;
run;
> Here is the message from the Log:
This is not the full log. Please post the full log.
I see nothing wrong with your code (except that you don't name the data sets).
Where's the failing export code?
What's the DM function?
Note that you could use this easier syntax to pick random observations:
X = rand('integer', 1, 17);
> Here is the message from the Log:
This is not the full log. Please post the full log.
Available on demand!
Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.