<?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: Exploring a bimodal distribution in Statistical Procedures</title>
    <link>https://communities.sas.com/t5/Statistical-Procedures/Exploring-a-bimodal-distribution/m-p/696531#M33613</link>
    <description>&lt;P&gt;Several ways. If you just want the centers of the clusters, you can use k-means clustering (PROC FASTCLUS). If you want to perform more sophisticated modeling, you can use PROC FMM to model the data as a finite mixture. From the graphs, you would guess that there are k=2 components and the means of the components are somewhere close to response=16 and 36. You can provide that extra information to PROC FMM to help it converge to a solution:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc fmm data=have1;
   by partition;
   model response =  / k=2
         parms(16 4, 36 4); /* provide hints for (mu, sigma^2) based on graphs */;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;For more on using PROC FMM to model mixtures, see &lt;A href="https://blogs.sas.com/content/iml/2011/09/23/modeling-finite-mixtures-with-the-fmm-procedure.html" target="_self"&gt;"Modeling finite mixtures with the FMM Procedure".&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;However, be aware that &lt;A href="https://blogs.sas.com/content/iml/2011/10/21/the-power-of-finite-mixture-models.html" target="_self"&gt;the success of this approach depends on the size of your data and how close the centers of the clusters are to each other&lt;/A&gt;. Larger samples and greater separation mean that PROC FMM has a better chance of discriminating between the latent groups.&lt;/P&gt;</description>
    <pubDate>Wed, 04 Nov 2020 14:54:55 GMT</pubDate>
    <dc:creator>Rick_SAS</dc:creator>
    <dc:date>2020-11-04T14:54:55Z</dc:date>
    <item>
      <title>Exploring a bimodal distribution</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Exploring-a-bimodal-distribution/m-p/696361#M33609</link>
      <description>&lt;P&gt;What are some approaches or procs for finding the 'probable causes' behind a bimodal distribution.&lt;/P&gt;
&lt;P&gt;In this example there are different modes for different category values.&lt;/P&gt;
&lt;P&gt;Data gen&lt;/P&gt;
&lt;LI-SPOILER&gt;
&lt;PRE&gt;%macro makedata(out,seed);
  data &amp;amp;out;
    call streaminit(&amp;amp;seed);

    do partition = 1 to 3;

      p = byte(rand('integer',65,69));
      q = byte(rand('integer',65,69));

      array from p q;

      modes_from = cat(p,' &amp;amp; ',q);

      do id = 1 to 1000;

        cat = byte(rand('integer',65,69));

        if rand('uniform') &amp;lt; 0.80 then do;
          cat = from(rand('integer',1,2));
          if cat = p then response = round(rand('norm', 15,2),0.01); else
          if cat = q then response = round(rand('norm', 35,2),0.01); 
        end;
        else response = round(rand('uniform',4, 46),0.01);

        output;
      end;
    end;
    drop _: p q;
  run;
%mend;


%makedata(have1, 1234)&lt;/PRE&gt;
&lt;/LI-SPOILER&gt;
&lt;P&gt;Plots&lt;/P&gt;
&lt;PRE&gt;proc sgpanel data=have1;
  panelby partition modes_from / columns=3;
  histogram response;
run;&lt;BR /&gt;
proc sgpanel data=have1;
  panelby partition modes_from / columns=3;
  histogram response / group=cat;
run;
&lt;/PRE&gt;
&lt;P&gt;Histogram with grouping highlights cat values associated with the peaks&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="RichardADeVenezia_0-1604443920787.png" style="width: 999px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/51344i5F19D26EF4DD5FA4/image-size/large?v=v2&amp;amp;px=999" role="button" title="RichardADeVenezia_0-1604443920787.png" alt="RichardADeVenezia_0-1604443920787.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 03 Nov 2020 22:53:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Exploring-a-bimodal-distribution/m-p/696361#M33609</guid>
      <dc:creator>RichardDeVen</dc:creator>
      <dc:date>2020-11-03T22:53:55Z</dc:date>
    </item>
    <item>
      <title>Re: Exploring a bimodal distribution</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Exploring-a-bimodal-distribution/m-p/696458#M33612</link>
      <description>Scatter plot could find "bimodal distribution" via BY variable.&lt;BR /&gt;&lt;BR /&gt;proc sgplot data=sashelp.class;&lt;BR /&gt;scatter x=weight y=height /group=sex ;&lt;BR /&gt;run;</description>
      <pubDate>Wed, 04 Nov 2020 12:18:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Exploring-a-bimodal-distribution/m-p/696458#M33612</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2020-11-04T12:18:53Z</dc:date>
    </item>
    <item>
      <title>Re: Exploring a bimodal distribution</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Exploring-a-bimodal-distribution/m-p/696531#M33613</link>
      <description>&lt;P&gt;Several ways. If you just want the centers of the clusters, you can use k-means clustering (PROC FASTCLUS). If you want to perform more sophisticated modeling, you can use PROC FMM to model the data as a finite mixture. From the graphs, you would guess that there are k=2 components and the means of the components are somewhere close to response=16 and 36. You can provide that extra information to PROC FMM to help it converge to a solution:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc fmm data=have1;
   by partition;
   model response =  / k=2
         parms(16 4, 36 4); /* provide hints for (mu, sigma^2) based on graphs */;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;For more on using PROC FMM to model mixtures, see &lt;A href="https://blogs.sas.com/content/iml/2011/09/23/modeling-finite-mixtures-with-the-fmm-procedure.html" target="_self"&gt;"Modeling finite mixtures with the FMM Procedure".&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;However, be aware that &lt;A href="https://blogs.sas.com/content/iml/2011/10/21/the-power-of-finite-mixture-models.html" target="_self"&gt;the success of this approach depends on the size of your data and how close the centers of the clusters are to each other&lt;/A&gt;. Larger samples and greater separation mean that PROC FMM has a better chance of discriminating between the latent groups.&lt;/P&gt;</description>
      <pubDate>Wed, 04 Nov 2020 14:54:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Exploring-a-bimodal-distribution/m-p/696531#M33613</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2020-11-04T14:54:55Z</dc:date>
    </item>
  </channel>
</rss>

