<?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 fit my data to Gamma,  Weibull and Lognomal distributions? in Statistical Procedures</title>
    <link>https://communities.sas.com/t5/Statistical-Procedures/How-to-fit-my-data-to-Gamma-Weibull-and-Lognomal-distributions/m-p/779140#M38215</link>
    <description>&lt;P&gt;Hi Steve,&lt;/P&gt;&lt;P&gt;Many thanks. It makes sense to me. But I don't know exactly how to implement it into SAS code.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Could you give the example to enlighten me?&lt;/P&gt;&lt;P&gt;Ethan&lt;/P&gt;</description>
    <pubDate>Mon, 08 Nov 2021 14:59:41 GMT</pubDate>
    <dc:creator>t75wez1</dc:creator>
    <dc:date>2021-11-08T14:59:41Z</dc:date>
    <item>
      <title>How to fit my data to Gamma,  Weibull and Lognomal distributions?</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/How-to-fit-my-data-to-Gamma-Weibull-and-Lognomal-distributions/m-p/778032#M38136</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I want to use my SAS data set named “customers” below to fit Gamma,&amp;nbsp; Weibull and Lognomal distributions.&lt;BR /&gt;The data set includes two variables day and # of customers who made the purchase on that day.&lt;BR /&gt;The attached you’ll find the desired result looks like I'm seeking.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Could you enlighten me?&lt;/P&gt;&lt;P&gt;I have the base/SAS 9.4 1M7 with ETS version so I can run “Proc Model” or “proc FMM” if needed.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please let me know if I need to provide additional information.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks very much for your help and insights in advance.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards,&lt;BR /&gt;Ethan&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;data customers;&lt;BR /&gt;input day count;&lt;BR /&gt;label day = 'Day'&lt;BR /&gt;count = '# of customers'&lt;BR /&gt;;&lt;BR /&gt;datalines;&lt;BR /&gt;1 3&lt;BR /&gt;2 2&lt;BR /&gt;3 1&lt;BR /&gt;4 19&lt;BR /&gt;5 138&lt;BR /&gt;6 116&lt;BR /&gt;7 62&lt;BR /&gt;8 30&lt;BR /&gt;9 49&lt;BR /&gt;10 32&lt;BR /&gt;11 30&lt;BR /&gt;12 30&lt;BR /&gt;13 12&lt;BR /&gt;14 10&lt;BR /&gt;15 7&lt;BR /&gt;16 12&lt;BR /&gt;17 9&lt;BR /&gt;18 15&lt;BR /&gt;19 5&lt;BR /&gt;20 12&lt;BR /&gt;21 4&lt;BR /&gt;22 9&lt;BR /&gt;23 10&lt;BR /&gt;24 2&lt;BR /&gt;25 5&lt;BR /&gt;26 8&lt;BR /&gt;27 4&lt;BR /&gt;28 6&lt;BR /&gt;29 3&lt;BR /&gt;30 7&lt;BR /&gt;31 4&lt;BR /&gt;;&lt;BR /&gt;run;&lt;/P&gt;</description>
      <pubDate>Tue, 02 Nov 2021 21:22:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/How-to-fit-my-data-to-Gamma-Weibull-and-Lognomal-distributions/m-p/778032#M38136</guid>
      <dc:creator>t75wez1</dc:creator>
      <dc:date>2021-11-02T21:22:05Z</dc:date>
    </item>
    <item>
      <title>Re: How to fit my data to Gamma,  Weibull and Lognomal distributions?</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/How-to-fit-my-data-to-Gamma-Weibull-and-Lognomal-distributions/m-p/778051#M38137</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Like this?&lt;/P&gt;
&lt;PRE&gt;proc univariate data=customers;
   var day;
   freq count;
   histogram /  gamma weibull lognormal
   ;
run;&lt;/PRE&gt;
&lt;P&gt;There is a very large economy sized hint in that output you attached that says "Proc Univariate". The Histogram statement of Proc Univariate is one of the basic tools for examining distributions.&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;The outcome you show is demonstrating distribution, not "fitting". Fit usually means to transform to match some distribution.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 02 Nov 2021 22:40:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/How-to-fit-my-data-to-Gamma-Weibull-and-Lognomal-distributions/m-p/778051#M38137</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2021-11-02T22:40:58Z</dc:date>
    </item>
    <item>
      <title>Re: How to fit my data to Gamma,  Weibull and Lognomal distributions?</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/How-to-fit-my-data-to-Gamma-Weibull-and-Lognomal-distributions/m-p/778068#M38140</link>
      <description>&lt;P&gt;Thanks for your reply along with the example.&lt;/P&gt;&lt;P&gt;You're correct.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm seeking&lt;/P&gt;&lt;P&gt;1)To identify which&amp;nbsp;&lt;SPAN&gt;Gamma,&amp;nbsp; Weibull and Lognomal distribution to match variable called "count" distribution most given the day as X variable. &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;2) Use "proc sgplot" to overlay "count" bars with results getting from 1).&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Thanks for your helps.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Ethan&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 03 Nov 2021 00:15:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/How-to-fit-my-data-to-Gamma-Weibull-and-Lognomal-distributions/m-p/778068#M38140</guid>
      <dc:creator>t75wez1</dc:creator>
      <dc:date>2021-11-03T00:15:44Z</dc:date>
    </item>
    <item>
      <title>Re: How to fit my data to Gamma,  Weibull and Lognomal distributions?</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/How-to-fit-my-data-to-Gamma-Weibull-and-Lognomal-distributions/m-p/778070#M38141</link>
      <description>&lt;P&gt;Your response data in the COUNT variable is, as named, discrete count data and so is not continuous. So, it would not strictly be correct to use continuous distributions like those you mentioned. Distributions that are appropriate for discrete, count responses are the Poisson (if mean and variance are equal), negative binomial, generalized Poisson, or Conway-Maxwell Poisson. Nevertheless, you can assess the fit of various continuous distributions using PROC SEVERITY. See the example in the Getting Started section in the SEVERITY documentation. Also see &lt;A href="https://support.sas.com/kb/23/135.html" target="_self"&gt;this note&lt;/A&gt; about distribution fitting. These statements fit the continuous distributions you mentioned and others:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc severity crit=aicc;
   loss count;
   dist _predefined_;
run;

&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;These statements fit the discrete Poisson, negative binomial, generalized Poisson, and Conway-Maxwell Poisson distributions appropriate for count data:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc genmod;
model count= / dist=p;
run;
proc genmod;
model count= / dist=negbin;
run;
proc fmm;
model count= / dist=genpoisson;
run;&lt;/CODE&gt;&lt;BR /&gt;&lt;CODE class=" language-sas"&gt;proc countreg;
model count= / dist=compoisson;
run;&lt;/CODE&gt;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 03 Nov 2021 01:11:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/How-to-fit-my-data-to-Gamma-Weibull-and-Lognomal-distributions/m-p/778070#M38141</guid>
      <dc:creator>StatDave</dc:creator>
      <dc:date>2021-11-03T01:11:00Z</dc:date>
    </item>
    <item>
      <title>Re: How to fit my data to Gamma,  Weibull and Lognomal distributions?</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/How-to-fit-my-data-to-Gamma-Weibull-and-Lognomal-distributions/m-p/778339#M38148</link>
      <description>&lt;P&gt;Thank you! Very helpful.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In stead of fitting&amp;nbsp;&lt;SPAN&gt;COUNT variable for discrete distribution, I can transform it to "percent_count" as continuous variable to fit continuous distribution.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;below is the code I define&amp;nbsp;&lt;SPAN&gt;"percent_count" variable.&amp;nbsp;&amp;nbsp;Then I can use it in PROC SEVERITY.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Ethan&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;proc sql noprint;&lt;BR /&gt;select sum(count) into :total from customers ;&lt;BR /&gt;quit;&lt;BR /&gt;%put &amp;amp;total.;&lt;BR /&gt;data customers; set customers;&lt;BR /&gt;percent_count=round(100*count/&amp;amp;total.,0.01);&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;</description>
      <pubDate>Wed, 03 Nov 2021 21:22:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/How-to-fit-my-data-to-Gamma-Weibull-and-Lognomal-distributions/m-p/778339#M38148</guid>
      <dc:creator>t75wez1</dc:creator>
      <dc:date>2021-11-03T21:22:04Z</dc:date>
    </item>
    <item>
      <title>Re: How to fit my data to Gamma,  Weibull and Lognomal distributions?</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/How-to-fit-my-data-to-Gamma-Weibull-and-Lognomal-distributions/m-p/778735#M38165</link>
      <description>&lt;P&gt;Just be sure to use dist=binary and do not multiply by 100, as you need the variable to be in the closed interval [0,1].&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;SteveDenham&lt;/P&gt;</description>
      <pubDate>Fri, 05 Nov 2021 12:53:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/How-to-fit-my-data-to-Gamma-Weibull-and-Lognomal-distributions/m-p/778735#M38165</guid>
      <dc:creator>SteveDenham</dc:creator>
      <dc:date>2021-11-05T12:53:59Z</dc:date>
    </item>
    <item>
      <title>Re: How to fit my data to Gamma,  Weibull and Lognomal distributions?</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/How-to-fit-my-data-to-Gamma-Weibull-and-Lognomal-distributions/m-p/779140#M38215</link>
      <description>&lt;P&gt;Hi Steve,&lt;/P&gt;&lt;P&gt;Many thanks. It makes sense to me. But I don't know exactly how to implement it into SAS code.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Could you give the example to enlighten me?&lt;/P&gt;&lt;P&gt;Ethan&lt;/P&gt;</description>
      <pubDate>Mon, 08 Nov 2021 14:59:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/How-to-fit-my-data-to-Gamma-Weibull-and-Lognomal-distributions/m-p/779140#M38215</guid>
      <dc:creator>t75wez1</dc:creator>
      <dc:date>2021-11-08T14:59:41Z</dc:date>
    </item>
    <item>
      <title>Re: How to fit my data to Gamma,  Weibull and Lognomal distributions?</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/How-to-fit-my-data-to-Gamma-Weibull-and-Lognomal-distributions/m-p/779172#M38219</link>
      <description>&lt;P&gt;I don't think dividing by the total count (which is also a random variable) changes the fact that the observed values are counts. A plot analogous to your plot of the histogram of the counts with overlaid theoretical&amp;nbsp;&lt;SPAN style="font-family: inherit;"&gt;continuous distributions is a plot of the count histogram overlaid with a histogram of a theoretical discrete distribution. Leveraging the methods shown in &lt;A href="http://support.sas.com/kb/24166" target="_self"&gt;this note&lt;/A&gt; to estimate the parameters of a distribution and generate random values, this code fits a negative binomial distribution to the data, estimates its parameters, and plots a histogram of that theoretical distribution.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;   proc genmod data=customers;
      model count = / dist=negbin;
      ods output parameterestimates=pe;
      run;
   proc transpose data=pe out=tpe;
      var estimate;
      id parameter;
      run;
   data tpe;
      set;
      NB_k = 1/dispersion;
      NB_p = 1/(1+exp(intercept)*dispersion);
      do i=1 to 1000; 
        RandomY = rand("negbinomial",nb_p,nb_k);
        output;
      end;
      run;
   data a; merge customers tpe; run;
   proc sgplot;
      histogram count / binstart=12.5 binwidth=25; 
      histogram randomy / binstart=12.5 binwidth=25 transparency=.5;
      xaxis max=200;
      run; 
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;SPAN style="font-family: inherit;"&gt;Similarly for the generalized Poisson:&lt;/SPAN&gt;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;   proc fmm data=customers;
      model count= / dist=genpoisson;
      ods output parameterestimates=pe;
      run;
   proc transpose data=pe out=tpe;
      id parameter; var estimate;
      run;
   data genpoi;
      set tpe;
      theta = exp(intercept)*exp(-scale); 
      eta = 1-exp(-scale);
      do i=1 to 1000;
        RanGP = rand("genpoisson",theta,eta);
        output;
      end;
      run;
   data a; merge customers genpoi; run;
   proc sgplot;
    histogram count / binstart=12.5 binwidth=25; 
    histogram rangp / binstart=12.5 binwidth=25 transparency=.5;
    xaxis max=200;
    run; 
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;SPAN style="font-family: inherit;"&gt;31 observations is a small number for evaluating the fits in these plots, but they both look reasonably good.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 08 Nov 2021 17:56:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/How-to-fit-my-data-to-Gamma-Weibull-and-Lognomal-distributions/m-p/779172#M38219</guid>
      <dc:creator>StatDave</dc:creator>
      <dc:date>2021-11-08T17:56:36Z</dc:date>
    </item>
    <item>
      <title>Re: How to fit my data to Gamma,  Weibull and Lognomal distributions?</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/How-to-fit-my-data-to-Gamma-Weibull-and-Lognomal-distributions/m-p/779174#M38220</link>
      <description>&lt;P&gt;See&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13633"&gt;@StatDave&lt;/a&gt;&amp;nbsp;'s reply.&amp;nbsp; You can make it binomial like I offered, but with only 31 obs, neither of the count/discrete distributions mentioned will converge in distribution to a binomial distribution, so I wouldn't go that way.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;SteveDenham&lt;/P&gt;</description>
      <pubDate>Mon, 08 Nov 2021 18:01:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/How-to-fit-my-data-to-Gamma-Weibull-and-Lognomal-distributions/m-p/779174#M38220</guid>
      <dc:creator>SteveDenham</dc:creator>
      <dc:date>2021-11-08T18:01:21Z</dc:date>
    </item>
    <item>
      <title>Re: How to fit my data to Gamma,  Weibull and Lognomal distributions?</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/How-to-fit-my-data-to-Gamma-Weibull-and-Lognomal-distributions/m-p/781173#M38350</link>
      <description>&lt;P&gt;Hi StatDave_SAS,&lt;/P&gt;&lt;P&gt;Thanks so much for your great help.&lt;/P&gt;&lt;P&gt;But my goal is to identify a probability model for the distribution of counts of random events that dictates the type of distributions I should expect to see something similar like below. If a regression model for count data fits well, I should be able to say that the # of customers at day 1,2,.. and 31 equals to the predicated values from G&lt;SPAN&gt;eneralized Poisson&lt;/SPAN&gt; respectively. I don't see I can accomplish my goal with the result created by your code.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Could you enlighten me here?&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="t75wez1_0-1637285724965.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/65895iE79006C146A073F5/image-size/medium?v=v2&amp;amp;px=400" role="button" title="t75wez1_0-1637285724965.png" alt="t75wez1_0-1637285724965.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 19 Nov 2021 01:59:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/How-to-fit-my-data-to-Gamma-Weibull-and-Lognomal-distributions/m-p/781173#M38350</guid>
      <dc:creator>t75wez1</dc:creator>
      <dc:date>2021-11-19T01:59:23Z</dc:date>
    </item>
    <item>
      <title>Re: How to fit my data to Gamma,  Weibull and Lognomal distributions?</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/How-to-fit-my-data-to-Gamma-Weibull-and-Lognomal-distributions/m-p/781188#M38357</link>
      <description>&lt;P&gt;You can certainly fit a model, using a discrete distribution, to count data and get predicted values. But your questions so far have suggested that all of the data, taken across all of the days, come from one single distribution. My previous code assumes that and estimates that single distribution. If you are now saying that each day represents a separate distribution (of the same theoretical type but with possibly different parameters), and if you want to use DAY as a categorical predictor in the model, then you would want more than one single data value in each day in order to avoid saturating the model resulting in perfect prediction. However, if you are willing to restrict the association of DAY on the mean (as linear, quadratic, ...) so that the model is not saturated then you could fit any of various types of models using various distributions. For example, this fits a negative binomial model to the data using a lower-order spline of DAY on the counts.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc gampl data=customers; 
model count=spline(day) / dist=negbin;
id _all_;
output out=preds pred=p;
run;
proc sgplot;
scatter y=count x=day;
pbspline y=p x=day / nomarkers;
run;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 19 Nov 2021 04:22:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/How-to-fit-my-data-to-Gamma-Weibull-and-Lognomal-distributions/m-p/781188#M38357</guid>
      <dc:creator>StatDave</dc:creator>
      <dc:date>2021-11-19T04:22:17Z</dc:date>
    </item>
    <item>
      <title>Re: How to fit my data to Gamma,  Weibull and Lognomal distributions?</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/How-to-fit-my-data-to-Gamma-Weibull-and-Lognomal-distributions/m-p/781371#M38376</link>
      <description>&lt;P&gt;Truly appreciative of your guidance.&lt;/P&gt;&lt;P&gt;The count data fits better than my previous result by adopting your code below with minor change by replacing&amp;nbsp;POISSON distribution.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The data set named "customers" is just for one particular month. I do have 5 different data sets for 5 different months with DAY&amp;nbsp;as a categorical predictor(e.g .=1,2,3..., 30).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But I don't know how to "avoid saturating the model resulting in perfect prediction" by leveraging those&amp;nbsp;5 different data sets.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Could you shed some lights here?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;proc gampl data=customers;&lt;BR /&gt;model count=spline(day) / dist=POISSON;&lt;BR /&gt;id _all_;&lt;BR /&gt;output out=preds pred=predicted;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;proc sgplot data=preds;&lt;BR /&gt;vbarparm category=day response=count /&lt;BR /&gt;barwidth=0.7&lt;BR /&gt;baselineattrs=(thickness=0);&lt;BR /&gt;series y=predicted x=day /markers&lt;BR /&gt;markerattrs=(size=8pt color=red);&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="t75wez1_0-1637347172867.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/65930i3B263F13ECB239E2/image-size/medium?v=v2&amp;amp;px=400" role="button" title="t75wez1_0-1637347172867.png" alt="t75wez1_0-1637347172867.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 19 Nov 2021 19:22:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/How-to-fit-my-data-to-Gamma-Weibull-and-Lognomal-distributions/m-p/781371#M38376</guid>
      <dc:creator>t75wez1</dc:creator>
      <dc:date>2021-11-19T19:22:58Z</dc:date>
    </item>
    <item>
      <title>Re: How to fit my data to Gamma,  Weibull and Lognomal distributions?</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/How-to-fit-my-data-to-Gamma-Weibull-and-Lognomal-distributions/m-p/781505#M38383</link>
      <description>&lt;P&gt;Saturation and perfect prediction result from the model having as many parameters as there are data points. With the original data, that would happen if you used DAY in the CLASS and MODEL statements in, say, PROC GENMOD. It's avoided in any way that results in a model that has fewer parameters. Now, how to deal with that additional data again depends on what you want to assume. If you assume that the counts on a given day, regardless of the month, all come from the same distribution and different days can have different distributions of the same type but with differing parameters, then you can just concatenate the data from the other months to the original data and run the same code to fit and plot the model. Be sure to use the same day numbers (1, 2, ... , 31) for the data from each month. But I think the scatter plot for the observed values is then better than a bar plot so that you can see the variability.&lt;/P&gt;</description>
      <pubDate>Sat, 20 Nov 2021 20:55:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/How-to-fit-my-data-to-Gamma-Weibull-and-Lognomal-distributions/m-p/781505#M38383</guid>
      <dc:creator>StatDave</dc:creator>
      <dc:date>2021-11-20T20:55:19Z</dc:date>
    </item>
    <item>
      <title>Re: How to fit my data to Gamma,  Weibull and Lognomal distributions?</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/How-to-fit-my-data-to-Gamma-Weibull-and-Lognomal-distributions/m-p/781569#M38390</link>
      <description>&lt;P&gt;&lt;SPAN&gt;After concatenating the data from the other four months to the original data and run the same code to fit and plot the model, I'll get five different models.&amp;nbsp;If I assume that the counts on a given day, regardless of the month, all come from the same distribution, should I 'average' the predicted results of five models as final outcome?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 21 Nov 2021 19:24:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/How-to-fit-my-data-to-Gamma-Weibull-and-Lognomal-distributions/m-p/781569#M38390</guid>
      <dc:creator>t75wez1</dc:creator>
      <dc:date>2021-11-21T19:24:30Z</dc:date>
    </item>
    <item>
      <title>Re: How to fit my data to Gamma,  Weibull and Lognomal distributions?</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/How-to-fit-my-data-to-Gamma-Weibull-and-Lognomal-distributions/m-p/781577#M38391</link>
      <description>&lt;P&gt;No, you won't as long as you don't include a BY statement with a variable indicating the month. Otherwise, you will get one model that uses all of the data from all of the months. You just now have more than one observation for each day number. There is no need to do any averaging of the data across the months. Note that I said "concatenate", not "merge". That means that the data set will have many more observations and the COUNT variable will now have many more values for all of the monthly data. You should not have multiple count variables for the several months.&lt;/P&gt;</description>
      <pubDate>Sun, 21 Nov 2021 21:37:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/How-to-fit-my-data-to-Gamma-Weibull-and-Lognomal-distributions/m-p/781577#M38391</guid>
      <dc:creator>StatDave</dc:creator>
      <dc:date>2021-11-21T21:37:32Z</dc:date>
    </item>
    <item>
      <title>Re: How to fit my data to Gamma,  Weibull and Lognomal distributions?</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/How-to-fit-my-data-to-Gamma-Weibull-and-Lognomal-distributions/m-p/781582#M38393</link>
      <description>&lt;P&gt;For the sake of simplicity, I just made another data set and append them together with 62 observations.&lt;/P&gt;&lt;P&gt;By using the code below, I get 62 predicted values with duplication by day.&lt;/P&gt;&lt;P&gt;Is that right?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data customer2;set customers;&lt;BR /&gt;count=round(count+rand("weibull", 7,3.5),1.);&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;data customers;set customers customer2;&lt;BR /&gt;run;&lt;BR /&gt;&lt;BR /&gt;proc sort;by day;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;proc gampl data=customers;&lt;BR /&gt;model count=spline(day) / dist=POISSON; ******Final Pick***************;&lt;BR /&gt;id _all_;&lt;BR /&gt;output out=preds pred=predicted;&lt;BR /&gt;run;&lt;/P&gt;</description>
      <pubDate>Sun, 21 Nov 2021 22:02:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/How-to-fit-my-data-to-Gamma-Weibull-and-Lognomal-distributions/m-p/781582#M38393</guid>
      <dc:creator>t75wez1</dc:creator>
      <dc:date>2021-11-21T22:02:00Z</dc:date>
    </item>
    <item>
      <title>Re: How to fit my data to Gamma,  Weibull and Lognomal distributions?</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/How-to-fit-my-data-to-Gamma-Weibull-and-Lognomal-distributions/m-p/781586#M38395</link>
      <description>Yeah, I guess that'll work for adding one other set of data.</description>
      <pubDate>Sun, 21 Nov 2021 22:17:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/How-to-fit-my-data-to-Gamma-Weibull-and-Lognomal-distributions/m-p/781586#M38395</guid>
      <dc:creator>StatDave</dc:creator>
      <dc:date>2021-11-21T22:17:00Z</dc:date>
    </item>
    <item>
      <title>Re: How to fit my data to Gamma,  Weibull and Lognomal distributions?</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/How-to-fit-my-data-to-Gamma-Weibull-and-Lognomal-distributions/m-p/781588#M38396</link>
      <description>&lt;P&gt;Many thanks for your helps. You made my day!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 21 Nov 2021 22:21:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/How-to-fit-my-data-to-Gamma-Weibull-and-Lognomal-distributions/m-p/781588#M38396</guid>
      <dc:creator>t75wez1</dc:creator>
      <dc:date>2021-11-21T22:21:59Z</dc:date>
    </item>
  </channel>
</rss>

