<?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: Check for uniform distribution on SAS in Statistical Procedures</title>
    <link>https://communities.sas.com/t5/Statistical-Procedures/Check-for-uniform-distribution-on-SAS/m-p/285084#M15055</link>
    <description>&lt;PRE&gt;

I would like to use Chi-Square Test for Equal Proportions


data have;
input type $ freq;
cards;
A 0
A 2
A 0
A 4
A 5
A 5
B 10
B 0
B 4
B 5
B 3
B 1
;
run;
ods select OneWayChiSq;
proc freq data=have;
by type;
table freq/chisq;
exact chisq;
quit;
&lt;/PRE&gt;</description>
    <pubDate>Sun, 17 Jul 2016 02:43:11 GMT</pubDate>
    <dc:creator>Ksharp</dc:creator>
    <dc:date>2016-07-17T02:43:11Z</dc:date>
    <item>
      <title>Check for uniform distribution on SAS</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Check-for-uniform-distribution-on-SAS/m-p/285048#M15051</link>
      <description>&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&lt;DIV class="vote"&gt;&lt;SPAN class="vote-count-post "&gt;0&lt;/SPAN&gt;&lt;A title="This question does not show any research effort; it is unclear or not useful" target="_blank"&gt;down vote&lt;/A&gt;&lt;A title="Click to mark as favorite question (click again to undo)" href="http://stats.stackexchange.com/questions/224073/check-for-uniform-distribution-on-sas" target="_blank"&gt;favorite&lt;/A&gt;&lt;DIV class="favoritecount"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/TD&gt;&lt;TD&gt;&lt;DIV class="post-text"&gt;&lt;P&gt;I've got a dataset with variables TYPE and FREQ. I'm trying to test on SAS if my variable FREQ follows a uniform distribution by variable = TYPE&lt;/P&gt;&lt;P&gt;TYPE FREQ&lt;/P&gt;&lt;P&gt;A 0&lt;/P&gt;&lt;P&gt;A 2&lt;/P&gt;&lt;P&gt;A 0&lt;/P&gt;&lt;P&gt;A 4&lt;/P&gt;&lt;P&gt;A 5&lt;/P&gt;&lt;P&gt;A 5&lt;/P&gt;&lt;P&gt;B 10&lt;/P&gt;&lt;P&gt;B 0&lt;/P&gt;&lt;P&gt;B 4&lt;/P&gt;&lt;P&gt;B 5&lt;/P&gt;&lt;P&gt;B 3&lt;/P&gt;&lt;P&gt;B 1&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;How should the SAS code work? I know I need to use proc univariate on beta distribution (1,1), but I cant get it to work if I want to test for uniform distribution by the 'TYPE' variable. Also, I want to use the range(freq)+2 as my sigma and min(freq)-1 as my theta parameters. How do I get it defined in my sas code?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;PROC SQL NOPRINT; SELECT RANGE(freq)+2 INTO :SIGMA FROM dataset group by TYPE; QUIT;&lt;/P&gt;&lt;P&gt;PROC SQL NOPRINT; SELECT MIN(freq)-1 INTO :THETA FROM dataset group by TYPE; QUIT;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;PROC UNIVARIATE DATA = dataset&lt;/P&gt;&lt;P&gt;BY type;&lt;/P&gt;&lt;P&gt;VAR freq;&lt;/P&gt;&lt;P&gt;HISTOGRAM freq / NOPLOT BETA ( W=1 L=1 COLOR=CX4B0082 SIGMA=&amp;amp;SIGMA THETA=&amp;amp;THETA ALPHA=1 BETA=1)&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;;
;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;RUN; QUIT;&lt;/P&gt;&lt;P&gt;Appreciate any help please thanks!&lt;/P&gt;&lt;/DIV&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;</description>
      <pubDate>Sat, 16 Jul 2016 16:36:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Check-for-uniform-distribution-on-SAS/m-p/285048#M15051</guid>
      <dc:creator>catisgar</dc:creator>
      <dc:date>2016-07-16T16:36:33Z</dc:date>
    </item>
    <item>
      <title>Re: Check for uniform distribution on SAS</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Check-for-uniform-distribution-on-SAS/m-p/285054#M15052</link>
      <description>&lt;P&gt;Didn't you get the message&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;&lt;FONT color="#993300"&gt;&lt;STRONG&gt;ERROR: The largest value of FREQ is greater than or equal to the upper threshold&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#993300"&gt;&lt;STRONG&gt; (THETA + SIGMA) for the beta fit.&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;when you tried to fit the Beta distribution?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;What is the hypothesis that you want to test here?&lt;/P&gt;</description>
      <pubDate>Sat, 16 Jul 2016 19:31:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Check-for-uniform-distribution-on-SAS/m-p/285054#M15052</guid>
      <dc:creator>PGStats</dc:creator>
      <dc:date>2016-07-16T19:31:27Z</dc:date>
    </item>
    <item>
      <title>Re: Check for uniform distribution on SAS</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Check-for-uniform-distribution-on-SAS/m-p/285084#M15055</link>
      <description>&lt;PRE&gt;

I would like to use Chi-Square Test for Equal Proportions


data have;
input type $ freq;
cards;
A 0
A 2
A 0
A 4
A 5
A 5
B 10
B 0
B 4
B 5
B 3
B 1
;
run;
ods select OneWayChiSq;
proc freq data=have;
by type;
table freq/chisq;
exact chisq;
quit;
&lt;/PRE&gt;</description>
      <pubDate>Sun, 17 Jul 2016 02:43:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Check-for-uniform-distribution-on-SAS/m-p/285084#M15055</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2016-07-17T02:43:11Z</dc:date>
    </item>
    <item>
      <title>Re: Check for uniform distribution on SAS</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Check-for-uniform-distribution-on-SAS/m-p/285094#M15057</link>
      <description>&lt;P&gt;To extend what PGStats said, the test you perform depends on what you know (and want to know) about the data.&lt;/P&gt;
&lt;P&gt;1. Where dd the data come from? If there reason to think that the data generating mechanism is uniform?&lt;/P&gt;
&lt;P&gt;2. Do you know the upper and lower bounds of the data? For example, is the data always in the interval [0,10]?&lt;/P&gt;
&lt;P&gt;3. Your example uses integer values. The Beta distribution is a continuous distribution. You can use the Beta distribution to test whether continuous data fits a uniform distribution. Unless your real data has values like 2.72 and 6.135, you won't get a good fit with the Beta distrib.&lt;/P&gt;
&lt;P&gt;4. Based on your sample data, I think KSharp has the right idea. If you have lots of data that has integer values, you can&amp;nbsp;test for a discrete uniform distribution on the set {0,1,...,10} by using a chi-square test. &amp;nbsp;If you have only a small amount of data (like your example), you probably want to bin groups together. For example, run a chi-square test for frequencies in the set {0-1, 2-3, 4-5,...}&lt;/P&gt;</description>
      <pubDate>Sun, 17 Jul 2016 10:21:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Check-for-uniform-distribution-on-SAS/m-p/285094#M15057</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2016-07-17T10:21:59Z</dc:date>
    </item>
  </channel>
</rss>

