<?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: Fitting a gamma curve and mle? in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Fitting-a-gamma-curve-and-mle/m-p/507093#M72846</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/242232"&gt;@Choit&lt;/a&gt;&amp;nbsp;and welcome to the SAS Support Communities!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://documentation.sas.com/?docsetId=statug&amp;amp;docsetTarget=statug_nlin_syntax.htm&amp;amp;docsetVersion=14.3&amp;amp;locale=en" target="_blank"&gt;PROC NLIN&lt;/A&gt; can estimate the parameters:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
input x y;
cards;
1 0.000516
2 0.000847
3 0.001459
4 0.001939
5 0.002075
6 0.001749
;

ods output ParameterEstimates=est;
proc nlin data=have;
parms a=3 b=2 c=.01; 
model y=c*pdf('gamma',x,a,b);
run;

proc print data=est noobs;
var parameter estimate;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Result:&lt;/P&gt;
&lt;PRE&gt;Parameter    Estimate

    a          3.2866
    b          2.1503
    c          0.0165&lt;/PRE&gt;
&lt;P&gt;The estimates for a and b differ slightly from your&amp;nbsp;Excel values, which might be due to rounding error in variable Y. If the Y values are taken as exact values, the sum of squares is smaller for the above estimates. This is actually not maximum likelihood estimation. The Gauss-Newton method with initial values a=3, b=2, c=.01 was used to minimize the sum of squares.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 24 Oct 2018 10:30:58 GMT</pubDate>
    <dc:creator>FreelanceReinh</dc:creator>
    <dc:date>2018-10-24T10:30:58Z</dc:date>
    <item>
      <title>Fitting a gamma curve and mle?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Fitting-a-gamma-curve-and-mle/m-p/507046#M72841</link>
      <description>Hi,&lt;BR /&gt;Trying to find a way in SAS to solve relationshio between x and y which have a gamma curve relationship,&lt;BR /&gt;Data as below&lt;BR /&gt;&lt;BR /&gt;X Y&lt;BR /&gt;1 0.000516&lt;BR /&gt;2 0.000847&lt;BR /&gt;3 0.001459&lt;BR /&gt;4 0.001939&lt;BR /&gt;5 0.002075&lt;BR /&gt;6 0.001749&lt;BR /&gt;&lt;BR /&gt;Relationship solved using excel using minimum error square&lt;BR /&gt;Y=gamma.dist(x,3.2840,2.1535,0) * 0.0165&lt;BR /&gt;&lt;BR /&gt;How do i get sas to solve to the parameter as how excel does to get the 3 parameters in the function above&lt;BR /&gt;3.2840 , 2.1535 , 0.0165&lt;BR /&gt;&lt;BR /&gt;Thanks&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Wed, 24 Oct 2018 01:22:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Fitting-a-gamma-curve-and-mle/m-p/507046#M72841</guid>
      <dc:creator>Choit</dc:creator>
      <dc:date>2018-10-24T01:22:19Z</dc:date>
    </item>
    <item>
      <title>Re: Fitting a gamma curve and mle?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Fitting-a-gamma-curve-and-mle/m-p/507093#M72846</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/242232"&gt;@Choit&lt;/a&gt;&amp;nbsp;and welcome to the SAS Support Communities!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://documentation.sas.com/?docsetId=statug&amp;amp;docsetTarget=statug_nlin_syntax.htm&amp;amp;docsetVersion=14.3&amp;amp;locale=en" target="_blank"&gt;PROC NLIN&lt;/A&gt; can estimate the parameters:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
input x y;
cards;
1 0.000516
2 0.000847
3 0.001459
4 0.001939
5 0.002075
6 0.001749
;

ods output ParameterEstimates=est;
proc nlin data=have;
parms a=3 b=2 c=.01; 
model y=c*pdf('gamma',x,a,b);
run;

proc print data=est noobs;
var parameter estimate;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Result:&lt;/P&gt;
&lt;PRE&gt;Parameter    Estimate

    a          3.2866
    b          2.1503
    c          0.0165&lt;/PRE&gt;
&lt;P&gt;The estimates for a and b differ slightly from your&amp;nbsp;Excel values, which might be due to rounding error in variable Y. If the Y values are taken as exact values, the sum of squares is smaller for the above estimates. This is actually not maximum likelihood estimation. The Gauss-Newton method with initial values a=3, b=2, c=.01 was used to minimize the sum of squares.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 24 Oct 2018 10:30:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Fitting-a-gamma-curve-and-mle/m-p/507093#M72846</guid>
      <dc:creator>FreelanceReinh</dc:creator>
      <dc:date>2018-10-24T10:30:58Z</dc:date>
    </item>
    <item>
      <title>Re: Fitting a gamma curve and mle?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Fitting-a-gamma-curve-and-mle/m-p/507317#M72847</link>
      <description>&lt;P&gt;For more on using PROC NLIN to fit nonlinear curves, see the article&lt;/P&gt;
&lt;P&gt;"&lt;A href="https://blogs.sas.com/content/iml/2018/10/10/fit-growth-curve-sas.html" target="_self"&gt;Fit a growth curve in SAS&lt;/A&gt;"&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 24 Oct 2018 20:19:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Fitting-a-gamma-curve-and-mle/m-p/507317#M72847</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2018-10-24T20:19:39Z</dc:date>
    </item>
  </channel>
</rss>

