<?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 Univariate - Goodness of fit in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/PROC-Univariate-Goodness-of-fit/m-p/195522#M48917</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Is x1 the only variable in the Test data set?&amp;nbsp; If not, you might be looking at the EDF test for&amp;nbsp; a different variable.&amp;nbsp; To make sure, use&lt;/P&gt;&lt;P&gt;histogram x1 / lognormal;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The SAS documentation says that the p-value uses "probability levels similar to those given by D’Agostino and Stephens (&lt;A href="http://support.sas.com/documentation/cdl/en/procstat/68142/HTML/default/procstat_univariate_references.htm#procstat_univariatedago_r86"&gt;1986&lt;/A&gt;)."&amp;nbsp; When you tell us what MATLAB commands you are using, perhaps a comparison will be possible.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 13 Aug 2015 14:54:34 GMT</pubDate>
    <dc:creator>Rick_SAS</dc:creator>
    <dc:date>2015-08-13T14:54:34Z</dc:date>
    <item>
      <title>PROC Univariate - Goodness of fit</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/PROC-Univariate-Goodness-of-fit/m-p/195517#M48912</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The P-Value and statistic value obtained for 3 Goodness of fit tests (Kolmogrov-Smirnov, Cramer-Von-Mises and Ander-Darling test) doesn't match with the value calculated from Matlab software.&lt;/P&gt;&lt;P&gt;Probably the table used for calculation of P-Value (or Critical value) is different because the formula for calculation of Test statistics seems to be same.&lt;/P&gt;&lt;P&gt;Can one guide with the table used for calculation of P-value in each test. Or wat else could be the problem....something that I'm missing on.... Plz help!!!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE border="0" cellpadding="0" cellspacing="0" width="477"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD class="xl75" colspan="5" height="20" style="border-right: .5pt solid black;" width="477"&gt;Results from SAS&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl71" colspan="5" height="20" style="border-right: .5pt solid black;" width="477"&gt;Goodness-of-Fit Tests for Lognormal Distribution&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl65" height="20" width="165"&gt;Test&lt;/TD&gt;&lt;TD class="xl67" colspan="2" width="138"&gt;Statistic&lt;/TD&gt;&lt;TD class="xl67" colspan="2" style="border-right: .5pt solid black;" width="174"&gt;p Value&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl64" height="20" width="165"&gt;Kolmogorov-Smirnov&lt;/TD&gt;&lt;TD class="xl63" width="64"&gt;D&lt;/TD&gt;&lt;TD align="right" class="xl68" width="74"&gt;0.0819588&lt;/TD&gt;&lt;TD class="xl63" width="96"&gt;Pr &amp;gt; D&lt;/TD&gt;&lt;TD align="left" class="xl70" width="78"&gt;&amp;lt;0.010&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl64" height="20" width="165"&gt;Cramer-von Mises&lt;/TD&gt;&lt;TD class="xl63" width="64"&gt;W-Sq&lt;/TD&gt;&lt;TD align="right" class="xl68" width="74"&gt;0.2144147&lt;/TD&gt;&lt;TD class="xl63" width="96"&gt;Pr &amp;gt; W-Sq&lt;/TD&gt;&lt;TD align="left" class="xl70" width="78"&gt;&amp;lt;0.005&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl65" height="20" width="165"&gt;Anderson-Darling&lt;/TD&gt;&lt;TD class="xl67" width="64"&gt;A-Sq&lt;/TD&gt;&lt;TD align="right" class="xl69" width="74"&gt;1.2362929&lt;/TD&gt;&lt;TD class="xl67" width="96"&gt;Pr &amp;gt; A-Sq&lt;/TD&gt;&lt;TD align="left" class="xl66" width="78"&gt;&amp;lt;0.005&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE border="0" cellpadding="0" cellspacing="0" width="439"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD class="xl77" colspan="5" height="20" style="border-right: .5pt solid black;" width="439"&gt;Results from Matlab&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl73" colspan="5" height="20" style="border-right: .5pt solid black;" width="439"&gt;Goodness-of-Fit Tests for Lognormal Distribution&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl67" height="20" width="165"&gt;Test&lt;/TD&gt;&lt;TD class="xl68" colspan="2" width="128"&gt;Statistic&lt;/TD&gt;&lt;TD class="xl68" colspan="2" style="border-right: .5pt solid black;" width="146"&gt;p Value&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl66" height="20" width="165"&gt;Kolmogorov-Smirnov&lt;/TD&gt;&lt;TD class="xl65" width="64"&gt;D&lt;/TD&gt;&lt;TD align="right" class="xl69" width="64"&gt;0.082&lt;/TD&gt;&lt;TD class="xl65" width="82"&gt;Pr &amp;gt; D&lt;/TD&gt;&lt;TD align="right" class="xl71" width="64"&gt;0.1237&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl66" height="20" width="165"&gt;Cramer-von Mises&lt;/TD&gt;&lt;TD class="xl65" width="64"&gt;W-Sq&lt;/TD&gt;&lt;TD align="right" class="xl69" width="64"&gt;0.2935&lt;/TD&gt;&lt;TD class="xl65" width="82"&gt;Pr &amp;gt; W-Sq&lt;/TD&gt;&lt;TD align="right" class="xl71" width="64"&gt;0.141&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl67" height="20" width="165"&gt;Anderson-Darling&lt;/TD&gt;&lt;TD class="xl68" width="64"&gt;A-Sq&lt;/TD&gt;&lt;TD align="right" class="xl70" width="64"&gt;1.2409&lt;/TD&gt;&lt;TD class="xl68" width="82"&gt;Pr &amp;gt; A-Sq&lt;/TD&gt;&lt;TD align="right" class="xl72" width="64"&gt;0.0031&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 10 Aug 2015 13:09:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/PROC-Univariate-Goodness-of-fit/m-p/195517#M48912</guid>
      <dc:creator>Lidz</dc:creator>
      <dc:date>2015-08-10T13:09:46Z</dc:date>
    </item>
    <item>
      <title>Re: PROC Univariate - Goodness of fit</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/PROC-Univariate-Goodness-of-fit/m-p/195518#M48913</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;How did you get SAS to give the p values, which are ordinarily for tests of normality?&amp;nbsp; Did you pre-transform the data, such as adding a constant, and then taking the log?&amp;nbsp; Or am I missing something new in PROC UNIVARIATE?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you are transforming, check what goes in, especially the constant to eliminate zeroes.&amp;nbsp; Different values will definitely affect how this will work.&amp;nbsp; And what kind of results are you seeing for the Wilcoxon test?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Steve Denham&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 11 Aug 2015 18:01:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/PROC-Univariate-Goodness-of-fit/m-p/195518#M48913</guid>
      <dc:creator>SteveDenham</dc:creator>
      <dc:date>2015-08-11T18:01:16Z</dc:date>
    </item>
    <item>
      <title>Re: PROC Univariate - Goodness of fit</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/PROC-Univariate-Goodness-of-fit/m-p/195519#M48914</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Showing your program statement is always helpful to those who are trying to answer your questions.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regarding "Why are they different," it is hard to say since I don't know what commands you submitted in SAS, nor what you did in MATLAB.&amp;nbsp; One possibility is that SAS is very careful to adjust the the test based on the number of known and unknown parameters.&amp;nbsp; Thus you will get a different test statistic for each of the following four tests.&amp;nbsp; Not all software takes known parameters into account.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc univariate data=sim;&lt;/P&gt;&lt;P&gt;var x;&lt;/P&gt;&lt;P&gt;histogram x/ &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; gamma(alpha=EST sigma=EST)&amp;nbsp; /* 0 parameters known&amp;nbsp; */&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; gamma(alpha=4 sigma=EST)&amp;nbsp;&amp;nbsp;&amp;nbsp; /* 1 shape param known */&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; gamma(alpha=EST sigma=1)&amp;nbsp;&amp;nbsp;&amp;nbsp; /* 1 scale param known */&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; gamma(alpha=4 sigma=1);&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /* 2 parameters known&amp;nbsp; */&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;@SteveDenham The UNIVARIATE procedure produces GOF statistics, including p-values for many non-normal distributions based on the ECDF. The details of the GOF tests in SAS are &lt;A href="http://support.sas.com/documentation/cdl/en/procstat/68142/HTML/default/viewer.htm#procstat_univariate_details52.htm"&gt;available in the documentation.&lt;/A&gt; For distributions for which the distribution of the Kolmogorov-D or Anderson-Darling W statistics is not known asymptotically, resampling methods are used to estimate p-values. You can control the number of&amp;nbsp; bootstrap resamples by using the EDFNSAMPLE= option.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 12 Aug 2015 13:00:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/PROC-Univariate-Goodness-of-fit/m-p/195519#M48914</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2015-08-12T13:00:18Z</dc:date>
    </item>
    <item>
      <title>Re: PROC Univariate - Goodness of fit</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/PROC-Univariate-Goodness-of-fit/m-p/195520#M48915</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you &lt;A __default_attr="129106" __jive_macro_name="user" class="jive_macro jive_macro_user" data-objecttype="3" href="https://communities.sas.com/"&gt;&lt;/A&gt;.&amp;nbsp; This is one that I didn't know about and I really appreciate the heads up!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Steve Denham&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 13 Aug 2015 11:26:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/PROC-Univariate-Goodness-of-fit/m-p/195520#M48915</guid>
      <dc:creator>SteveDenham</dc:creator>
      <dc:date>2015-08-13T11:26:23Z</dc:date>
    </item>
    <item>
      <title>Re: PROC Univariate - Goodness of fit</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/PROC-Univariate-Goodness-of-fit/m-p/195521#M48916</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Both the parameters are unknwn.&lt;/P&gt;&lt;P&gt;I used following program in SAS:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ods select ParameterEstimates GoodnessOfFit ;&lt;/P&gt;&lt;P&gt;proc univariate data= Test;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; var x1;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; histogram / lognormal&lt;/P&gt;&lt;P&gt;ods output parameterestimates= Param_est&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 13 Aug 2015 13:11:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/PROC-Univariate-Goodness-of-fit/m-p/195521#M48916</guid>
      <dc:creator>Lidz</dc:creator>
      <dc:date>2015-08-13T13:11:59Z</dc:date>
    </item>
    <item>
      <title>Re: PROC Univariate - Goodness of fit</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/PROC-Univariate-Goodness-of-fit/m-p/195522#M48917</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Is x1 the only variable in the Test data set?&amp;nbsp; If not, you might be looking at the EDF test for&amp;nbsp; a different variable.&amp;nbsp; To make sure, use&lt;/P&gt;&lt;P&gt;histogram x1 / lognormal;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The SAS documentation says that the p-value uses "probability levels similar to those given by D’Agostino and Stephens (&lt;A href="http://support.sas.com/documentation/cdl/en/procstat/68142/HTML/default/procstat_univariate_references.htm#procstat_univariatedago_r86"&gt;1986&lt;/A&gt;)."&amp;nbsp; When you tell us what MATLAB commands you are using, perhaps a comparison will be possible.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 13 Aug 2015 14:54:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/PROC-Univariate-Goodness-of-fit/m-p/195522#M48917</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2015-08-13T14:54:34Z</dc:date>
    </item>
  </channel>
</rss>

