<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: How to Export Monte Carlo simulated means? in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-to-Export-Monte-Carlo-simulated-means/m-p/667103#M199710</link>
    <description>&lt;P&gt;&lt;EM&gt;&amp;gt;&amp;nbsp;Here is the message from the Log:&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;This is not the full log. Please post the full log.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 06 Jul 2020 07:02:20 GMT</pubDate>
    <dc:creator>ChrisNZ</dc:creator>
    <dc:date>2020-07-06T07:02:20Z</dc:date>
    <item>
      <title>How to Export Monte Carlo simulated means?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-Export-Monte-Carlo-simulated-means/m-p/666727#M199542</link>
      <description>&lt;P&gt;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.&lt;/P&gt;&lt;P&gt;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:&lt;/P&gt;&lt;DIV class="c proctitle"&gt;The MEANS Procedure &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp; (Lower 95%, Upper 95%, Mean, StdDev, Min, Max, n)&lt;/DIV&gt;&lt;DIV&gt;&lt;DIV align="center"&gt;&lt;TABLE cellspacing="0" cellpadding="5"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;1.9854599&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;1.9982321&lt;/TD&gt;&lt;TD&gt;1.9918460&lt;/TD&gt;&lt;TD&gt;1.3434024&lt;/TD&gt;&lt;TD&gt;0&lt;/TD&gt;&lt;TD&gt;4.2900000&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;170000&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;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?&lt;/P&gt;&lt;P&gt;data ;&lt;BR /&gt;do sampnum = 1 to 10000; /* To create 10000 bootstrap replications */&lt;BR /&gt;do i = 1 to 17; /* Want same no. obs as in ORIGINAL */&lt;BR /&gt;x = round(ranuni(0) * 17); /* x randomly selected from values 1 to NOBS */&lt;BR /&gt;set YearRate&lt;BR /&gt;nobs = nobs&lt;BR /&gt;point = x; /* This selected the xth observation in ORIGINAL */&lt;BR /&gt;output; /* Send the selected observation to the new data set */&lt;BR /&gt;end;&lt;BR /&gt;end;&lt;BR /&gt;stop; /* Required when using the POINT= command */&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;proc means CLM mean stddev min max n;&lt;BR /&gt;var RawRate;&lt;BR /&gt;run;&lt;/P&gt;</description>
      <pubDate>Fri, 03 Jul 2020 03:16:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-Export-Monte-Carlo-simulated-means/m-p/666727#M199542</guid>
      <dc:creator>PeterBuzzacott2</dc:creator>
      <dc:date>2020-07-03T03:16:05Z</dc:date>
    </item>
    <item>
      <title>Re: How to Export Monte Carlo simulated means?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-Export-Monte-Carlo-simulated-means/m-p/666733#M199546</link>
      <description>&lt;P&gt;I see nothing wrong with your code (except that you don't name the data sets).&lt;/P&gt;
&lt;P&gt;Where's the failing export code?&lt;/P&gt;
&lt;P&gt;What's the DM function?&lt;/P&gt;
&lt;P&gt;Note that you could use this easier syntax to pick random observations:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;X = rand('integer', 1, 17);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 06 Jul 2020 04:53:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-Export-Monte-Carlo-simulated-means/m-p/666733#M199546</guid>
      <dc:creator>ChrisNZ</dc:creator>
      <dc:date>2020-07-06T04:53:53Z</dc:date>
    </item>
    <item>
      <title>Re: How to Export Monte Carlo simulated means?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-Export-Monte-Carlo-simulated-means/m-p/667099#M199707</link>
      <description>Thanks Chris&lt;BR /&gt;There is no failing export code, the data are being exported successfully. This issue I am having is that the exported data are not the data I want exported. Here is the message from the Log:&lt;BR /&gt;sampnum=10001 i=18 x=5 nobs=0 _ERROR_=1 _N_=1&lt;BR /&gt;NOTE: The data set WORK.DATA3 has 170000 observations and 2 variables.&lt;BR /&gt;NOTE: DATA statement used (Total process time):&lt;BR /&gt;real time 0.03 seconds&lt;BR /&gt;cpu time 0.01 seconds&lt;BR /&gt;&lt;BR /&gt;The two variables that are output are:&lt;BR /&gt;In the first column, 1-17,000&lt;BR /&gt;In the second column, 1-17, 10,000 times.&lt;BR /&gt;&lt;BR /&gt;What I am looking for is a third column with the 170,000 actual numbers used to generate the 10,000 simulated means.&lt;BR /&gt;Or, 10,000 rows with the 10,000 simulated means.&lt;BR /&gt;&lt;BR /&gt;When I run the PROC Means I get a mean value from n=170,000, so I know the values are in there somewhere. How can I export them into excel?&lt;BR /&gt;&lt;BR /&gt;I did not keep the DM unction because it was not helpful.</description>
      <pubDate>Mon, 06 Jul 2020 04:58:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-Export-Monte-Carlo-simulated-means/m-p/667099#M199707</guid>
      <dc:creator>PeterBuzzacott2</dc:creator>
      <dc:date>2020-07-06T04:58:29Z</dc:date>
    </item>
    <item>
      <title>Re: How to Export Monte Carlo simulated means?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-Export-Monte-Carlo-simulated-means/m-p/667103#M199710</link>
      <description>&lt;P&gt;&lt;EM&gt;&amp;gt;&amp;nbsp;Here is the message from the Log:&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;This is not the full log. Please post the full log.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 06 Jul 2020 07:02:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-Export-Monte-Carlo-simulated-means/m-p/667103#M199710</guid>
      <dc:creator>ChrisNZ</dc:creator>
      <dc:date>2020-07-06T07:02:20Z</dc:date>
    </item>
  </channel>
</rss>

