<?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: Proc FMM procedure to output pdf and cdf percent in SAS Enterprise Guide</title>
    <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Proc-FMM-procedure-to-output-pdf-and-cdf-percent/m-p/789627#M40127</link>
    <description>Thank you very much. I read your codes and understand how to get the cdf percentages.</description>
    <pubDate>Wed, 12 Jan 2022 02:16:18 GMT</pubDate>
    <dc:creator>star68</dc:creator>
    <dc:date>2022-01-12T02:16:18Z</dc:date>
    <item>
      <title>Proc FMM procedure to output pdf and cdf percent</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Proc-FMM-procedure-to-output-pdf-and-cdf-percent/m-p/789605#M40125</link>
      <description>&lt;P&gt;Could anyone tell me how to specific an option in the proc fmm procedure to output the pdf and cdf percentages?&amp;nbsp; I was able to run the proc fmm procedure to generate pdf fit statistics and pdf and cdf graphs, but I could not find an option to output the fitted pdf and cdf percentages.&amp;nbsp; Thanks.&lt;/P&gt;</description>
      <pubDate>Tue, 11 Jan 2022 22:31:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Proc-FMM-procedure-to-output-pdf-and-cdf-percent/m-p/789605#M40125</guid>
      <dc:creator>star68</dc:creator>
      <dc:date>2022-01-11T22:31:39Z</dc:date>
    </item>
    <item>
      <title>Re: Proc FMM procedure to output pdf and cdf percent</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Proc-FMM-procedure-to-output-pdf-and-cdf-percent/m-p/789623#M40126</link>
      <description>&lt;P&gt;the example is from rick wicklin's do loop blog.&lt;/P&gt;
&lt;P&gt;&lt;A href="https://blogs.sas.com/content/iml/2011/09/23/modeling-finite-mixtures-with-the-fmm-procedure.html" target="_self"&gt;https://blogs.sas.com/content/iml/2011/09/23/modeling-finite-mixtures-with-the-fmm-procedure.html&lt;/A&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc format;
   value PlayerName 1 = "Mom" 2 = "Rick";
run;
data scrabble;
input Game Player @@;
label Cumul = "Cumulative Score"
      Score = "Score for Turn";
Cumul = 0;
do Turn = 1 to 20;
   input Score @@;
   Cumul + Score;
   if Score^=. then output;
end;
format Player PlayerName.;
datalines;
1 1 20 15 12 24 11  9  9 18 14 16 14 20 23 14 11 10  8 10  8 -10
1 2 12 11  9  5  7 27 12  5 14 26 18 12 17  8 11 13 36  4  3 -1
2 1 14 30  8 13 16 11 12  8 26 12  8 27 27 12  5 15  9  7  2 -5
2 2 22 18  3 11 34 21  5  3 11 18 13 12 25 18 14 15 22 12  5 -2
3 1 18 16 20 26 17 16 20 12 15 12 33 17 26  6  5 -4  .  .  .  .
3 2 20 12 20 15 42 10  6 18 14 15  6 15 10  8 19  6  .  .  .  .
4 1 18  6 14 14 10  7 30 27 14 18 18 12 12  8 18  8  .  .  .  .
4 2 18 10 15 24 37 12  8 16 24 14 14 17 17 10 13 -3  .  .  .  . 
;
run;

proc means data=Scrabble;
class Player;
var Score;
run;

proc sgpanel data=Scrabble noautolegend;
panelby Game;
scatter x=Turn y=Cumul / group=Player transparency=0.75;
series x=Turn y=Cumul / group=Player curvelabel;
rowaxis integer grid;
colaxis grid;
run;

proc sgpanel data=Scrabble noautolegend;
panelby Player;
histogram Score;
density Score /type=kernel;
run;
&lt;BR /&gt;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;From here ongoing I adapt Rick's code to your context by adding the ods output tables statement prior to the proc fmm.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Then I create a data set that gets "scored" by the mixture of the distributions that proc fmm solved for.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;ods output ParameterEstimates=parms MixingProbs=mixi;
proc fmm data=scrabble(where=(Player=2)); /* Rick's scores */
model Score = / k=2;
output out=oks / allstats;
run;

proc sql;
select min(score), max(score) into :miny, :maxy from
scrabble where player=2;
quit;


/* go to output data sets and copy estimates and mixture probabilities, here normal distribution  */
data to_score;
format cdf_mixture percent9.2;
do score=%eval(&amp;amp;miny-3) to %eval(&amp;amp;maxy+3) by 1;
cdf_mixture=0.9460*cdf('normal', Score,  12.7127, sqrt(44.6022)) + (1-0.9460)* cdf('normal', Score,  37.3136, sqrt(8.7956)) ;
output;
end;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 11 Jan 2022 23:44:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Proc-FMM-procedure-to-output-pdf-and-cdf-percent/m-p/789623#M40126</guid>
      <dc:creator>acordes</dc:creator>
      <dc:date>2022-01-11T23:44:13Z</dc:date>
    </item>
    <item>
      <title>Re: Proc FMM procedure to output pdf and cdf percent</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Proc-FMM-procedure-to-output-pdf-and-cdf-percent/m-p/789627#M40127</link>
      <description>Thank you very much. I read your codes and understand how to get the cdf percentages.</description>
      <pubDate>Wed, 12 Jan 2022 02:16:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Proc-FMM-procedure-to-output-pdf-and-cdf-percent/m-p/789627#M40127</guid>
      <dc:creator>star68</dc:creator>
      <dc:date>2022-01-12T02:16:18Z</dc:date>
    </item>
  </channel>
</rss>

