<?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: RanMBIN macro in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/RanMBIN-macro/m-p/820913#M324062</link>
    <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/301476"&gt;@Levi_M&lt;/a&gt;&amp;nbsp;You will have better success getting a reply if you could provide more information.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Here's a link to a SAS Note on RANMBIN:&lt;BR /&gt;&lt;A href="https://soul3.na.sas.com:8443/TESSA/main/MyNote.jsp?t=FASTats%3A+Frequently+Asked-For+Statistics&amp;amp;u=https%3A%2F%2Fwits9.na.sas.com%2Fiw%2Fdocs%2Fsasnotes%2Ffusion%2F30%2F333.html&amp;amp;p=SAS%2FSTAT%2C+SAS%2FQC%2C+SAS%2FETS%2C+SAS%2FIML%2C+SAS%2FOR%2C+SAS%2FGenetics&amp;amp;o=support&amp;amp;i=30333" target="_self"&gt;Sample 66969: Generate multivariate binary data with specified means and correlation matrix&lt;/A&gt;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;What happens in the SAS log?&amp;nbsp;&lt;/LI&gt;
&lt;LI&gt;What errors do you get?&lt;/LI&gt;
&lt;LI&gt;Does it work on a small example?&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;The more information you can provide the better we can assist&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
    <pubDate>Wed, 29 Jun 2022 14:06:10 GMT</pubDate>
    <dc:creator>AMSAS</dc:creator>
    <dc:date>2022-06-29T14:06:10Z</dc:date>
    <item>
      <title>RanMBIN macro</title>
      <link>https://communities.sas.com/t5/SAS-Programming/RanMBIN-macro/m-p/820907#M324061</link>
      <description>&lt;P&gt;Good Morning,&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am trying to create a synthetic&amp;nbsp;bivariate database where the the outcome is influenced by calculated correlations. Roughly 10+ variables. I am using RanNBIN, but continue to have violations. Does anyone have experience to assist me with this?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you,&amp;nbsp;&lt;/P&gt;&lt;P&gt;Spaxxs&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 29 Jun 2022 13:40:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/RanMBIN-macro/m-p/820907#M324061</guid>
      <dc:creator>Levi_M</dc:creator>
      <dc:date>2022-06-29T13:40:31Z</dc:date>
    </item>
    <item>
      <title>Re: RanMBIN macro</title>
      <link>https://communities.sas.com/t5/SAS-Programming/RanMBIN-macro/m-p/820913#M324062</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/301476"&gt;@Levi_M&lt;/a&gt;&amp;nbsp;You will have better success getting a reply if you could provide more information.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Here's a link to a SAS Note on RANMBIN:&lt;BR /&gt;&lt;A href="https://soul3.na.sas.com:8443/TESSA/main/MyNote.jsp?t=FASTats%3A+Frequently+Asked-For+Statistics&amp;amp;u=https%3A%2F%2Fwits9.na.sas.com%2Fiw%2Fdocs%2Fsasnotes%2Ffusion%2F30%2F333.html&amp;amp;p=SAS%2FSTAT%2C+SAS%2FQC%2C+SAS%2FETS%2C+SAS%2FIML%2C+SAS%2FOR%2C+SAS%2FGenetics&amp;amp;o=support&amp;amp;i=30333" target="_self"&gt;Sample 66969: Generate multivariate binary data with specified means and correlation matrix&lt;/A&gt;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;What happens in the SAS log?&amp;nbsp;&lt;/LI&gt;
&lt;LI&gt;What errors do you get?&lt;/LI&gt;
&lt;LI&gt;Does it work on a small example?&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;The more information you can provide the better we can assist&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 29 Jun 2022 14:06:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/RanMBIN-macro/m-p/820913#M324062</guid>
      <dc:creator>AMSAS</dc:creator>
      <dc:date>2022-06-29T14:06:10Z</dc:date>
    </item>
    <item>
      <title>Re: RanMBIN macro</title>
      <link>https://communities.sas.com/t5/SAS-Programming/RanMBIN-macro/m-p/820932#M324069</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I had never heard about %RanMBIN.&lt;/P&gt;
&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13684"&gt;@Rick_SAS&lt;/a&gt;&amp;nbsp;: you know that one?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But I know about this (related) blog from&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13684"&gt;@Rick_SAS&lt;/a&gt;&amp;nbsp;:&lt;/P&gt;
&lt;P&gt;Tips to simulate binary and categorical variables&lt;BR /&gt;By Rick Wicklin on The DO Loop November 2, 2020&lt;BR /&gt;&lt;A href="https://blogs.sas.com/content/iml/2020/11/02/simulate-binary-and-categorical-variables.html" target="_blank"&gt;https://blogs.sas.com/content/iml/2020/11/02/simulate-binary-and-categorical-variables.html&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Cheers,&lt;/P&gt;
&lt;P&gt;Koen&lt;/P&gt;</description>
      <pubDate>Wed, 29 Jun 2022 14:34:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/RanMBIN-macro/m-p/820932#M324069</guid>
      <dc:creator>sbxkoenk</dc:creator>
      <dc:date>2022-06-29T14:34:15Z</dc:date>
    </item>
    <item>
      <title>Re: RanMBIN macro</title>
      <link>https://communities.sas.com/t5/SAS-Programming/RanMBIN-macro/m-p/820935#M324071</link>
      <description>&lt;P&gt;Thank you for the feed back. I have attached the 4 items that I am using for the dataset generation.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="spaxxs_0-1656514950095.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/72816i42DDF2DC0C823A43/image-size/medium?v=v2&amp;amp;px=400" role="button" title="spaxxs_0-1656514950095.png" alt="spaxxs_0-1656514950095.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hopefully this helps?&lt;/P&gt;</description>
      <pubDate>Wed, 29 Jun 2022 15:05:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/RanMBIN-macro/m-p/820935#M324071</guid>
      <dc:creator>Levi_M</dc:creator>
      <dc:date>2022-06-29T15:05:23Z</dc:date>
    </item>
    <item>
      <title>Re: RanMBIN macro</title>
      <link>https://communities.sas.com/t5/SAS-Programming/RanMBIN-macro/m-p/821119#M324167</link>
      <description>&lt;P&gt;How about this one ? By using Genetic Algorithm .&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data corr;
infile cards expandtabs;
input x1-x4 ;
cards;
1           0.452159638 0.220107738 0.412390423
0.452159638 1	        0.080503668 0.366678316
0.220107738 0.080503668	1           0.0022723
0.412390423 0.366678316	0.0022723   1
;


proc iml;
use corr;
read all var _num_ into corr[c=vname];
close;

start function(x) global(ncol,corr);
 temp=corr(shape(x,0,ncol));
 sse=ssq(temp-corr) ;
 return (sse);
finish;

nobs=1000;
ncol=ncol(corr);
size=nobs#ncol;

bounds=j(2,size,0);
bounds[2,]=1 ;    

id=gasetup(2,size,123456789);
call gasetobj(id,0,"function");
call gasetsel(id,10,1,.95);
call gainit(id,10000,bounds);


niter =  200 ;
do i = 1 to niter;
 call garegen(id);
 call gagetval(value, id);
end;
call gagetmem(mem, value, id, 1);

want=shape(mem,0,ncol);

create want from want[c=vname];
append from want;
close;

print value[l = "Min Value:(be near zero,be better)"] ;
call gaend(id);
quit;


proc corr data=want pearson;
var _numeric_;
run;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Ksharp_0-1656592056667.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/72851i221131E340674E64/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Ksharp_0-1656592056667.png" alt="Ksharp_0-1656592056667.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 30 Jun 2022 12:27:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/RanMBIN-macro/m-p/821119#M324167</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2022-06-30T12:27:43Z</dc:date>
    </item>
    <item>
      <title>Re: RanMBIN macro</title>
      <link>https://communities.sas.com/t5/SAS-Programming/RanMBIN-macro/m-p/821270#M324234</link>
      <description>&lt;P&gt;Chapter 9 of &lt;A href="https://support.sas.com/en/books/authors/rick-wicklin.html" target="_self"&gt;Wicklin (2013)&amp;nbsp;&lt;/A&gt;&amp;nbsp;explains why some sets of correlations are not feasible. "Feasible" means that the combination of means and correlations that you specified are not possible under the distributions that the macro uses.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The macro you are using supports a limited number of correlation structures: compound symmetric, AR(1), and banded. It is possible that your parameters are not feasible for those structured correlation matrices, but are feasible for more general correlations.&amp;nbsp;The algorithms in Wicklin (2013) use the Emrich-Piedmonte algorithm, which enables you to fit arbitrary correlation structures (but you still have to specify feasible parameters).&amp;nbsp; However, RANMBIN requires only Base SAS whereas the methods in Wicklin (2013) require a SAS/IML license.&lt;/P&gt;</description>
      <pubDate>Fri, 01 Jul 2022 11:17:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/RanMBIN-macro/m-p/821270#M324234</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2022-07-01T11:17:02Z</dc:date>
    </item>
  </channel>
</rss>

