<?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: Permutation test in Statistical Procedures</title>
    <link>https://communities.sas.com/t5/Statistical-Procedures/Permutation-test/m-p/246735#M13015</link>
    <description>You have a 1000 permutations. Yes there's a chance that one overlaps with another, but it's unlikely and even so, it's a random distribution. If you want to guarantee that you don't have duplicates don't do the sort randomly, shuffle it through and you'll get exactly 1000 different combinations.&lt;BR /&gt;&lt;BR /&gt;Again...this is assuming I understand your question, which I don't seem to be in your case.&lt;BR /&gt;&lt;BR /&gt;</description>
    <pubDate>Thu, 28 Jan 2016 19:56:15 GMT</pubDate>
    <dc:creator>Reeza</dc:creator>
    <dc:date>2016-01-28T19:56:15Z</dc:date>
    <item>
      <title>Permutation test</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Permutation-test/m-p/246679#M13001</link>
      <description>&lt;P&gt;Dear Users,&lt;BR /&gt;&lt;BR /&gt;I have to perform a permutation test without replacement. Let's say, I have 100 patients, 50 with treatment A and 50 with treatment B. There are too many combination to choose 50 in 100. It is a the code I wrote to show you the data I have.&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data original_data (drop=i j);
    do i=1 to 50;
        id=i;
        trt='1';
        output;
    end;
    do j=1 to 50;
        id=j+50;
        trt='2';
        output;
    end;
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So What I would like to do, is to generate 1000 unique samples with the 100 patients and the same distribution for treatment, in another word that means no sample was drawn more than one.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;Do you have any idea to do that ? I am a bit lost, because I can create one data set after another one, and check if the new is different from the other first ones, but I think it is very time consumming ?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you for your help !&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;Mary&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 28 Jan 2016 16:30:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Permutation-test/m-p/246679#M13001</guid>
      <dc:creator>maryslpa</dc:creator>
      <dc:date>2016-01-28T16:30:18Z</dc:date>
    </item>
    <item>
      <title>Re: Permutation test</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Permutation-test/m-p/246685#M13002</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/70654"&gt;@maryslpa&lt;/a&gt; wrote:&lt;BR /&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So What I would like to do, is to generate 1000 unique samples with the 100 patients and the same distribution for treatment, in another word that means no sample was drawn more than one.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;P&gt;What do you mean by no sample was drawn more than once?&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You're select 50 people from the 100 population - no replacement (50 unique people).&lt;/P&gt;
&lt;P&gt;You want 1000 samples&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc surveyselect data=original_data method=srs rep=1000 sampsize=50 out=want;
strata trt/alloc=prop;
run;
 &lt;/CODE&gt;&lt;/PRE&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>Thu, 28 Jan 2016 16:47:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Permutation-test/m-p/246685#M13002</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2016-01-28T16:47:07Z</dc:date>
    </item>
    <item>
      <title>Re: Permutation test</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Permutation-test/m-p/246688#M13003</link>
      <description>&lt;P&gt;PS Look up the Don't be Loopy paper by David Cassell for samples on simulation/bootstrap in SAS.&lt;/P&gt;</description>
      <pubDate>Thu, 28 Jan 2016 16:53:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Permutation-test/m-p/246688#M13003</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2016-01-28T16:53:35Z</dc:date>
    </item>
    <item>
      <title>Re: Permutation test</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Permutation-test/m-p/246691#M13004</link>
      <description>&lt;P&gt;I would like to have 1000 different random samples with &lt;STRONG&gt;100&lt;/STRONG&gt; patients and the same distribution of trt.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 28 Jan 2016 16:58:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Permutation-test/m-p/246691#M13004</guid>
      <dc:creator>maryslpa</dc:creator>
      <dc:date>2016-01-28T16:58:14Z</dc:date>
    </item>
    <item>
      <title>Re: Permutation test</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Permutation-test/m-p/246692#M13005</link>
      <description>&lt;P&gt;I have already read it, but I didn't find any solution there &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 28 Jan 2016 17:00:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Permutation-test/m-p/246692#M13005</guid>
      <dc:creator>maryslpa</dc:creator>
      <dc:date>2016-01-28T17:00:19Z</dc:date>
    </item>
    <item>
      <title>Re: Permutation test</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Permutation-test/m-p/246694#M13006</link>
      <description>&lt;P&gt;Ok...but your first part says you have 100 patients. That's the entire data set, so I don't understand that part.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Anyways, use proc surveyselect - please read the documentation on the procedure.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;1. Method=SRS - specifies the Simple random sample, no replacement&lt;/P&gt;
&lt;P&gt;2. Strata statement specifies by TRT and proportional allocation so same distribution as input data set, your sample 50/50&lt;/P&gt;
&lt;P&gt;3. sampsize= in proc surveyselect says the number of samples to retrieve.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 28 Jan 2016 17:03:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Permutation-test/m-p/246694#M13006</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2016-01-28T17:03:44Z</dc:date>
    </item>
    <item>
      <title>Re: Permutation test</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Permutation-test/m-p/246699#M13007</link>
      <description>&lt;P&gt;&lt;SPAN&gt;choose 50 in 100&lt;/SPAN&gt; is equal to 50! / 100!50! , and this number is ver very big. At the&amp;nbsp;end&amp;nbsp;what I want is 1000 unique samples with 100 patients and the same distribtuin of treatment. But I am not sure that it is possible with the surveyselect &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 28 Jan 2016 17:13:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Permutation-test/m-p/246699#M13007</guid>
      <dc:creator>maryslpa</dc:creator>
      <dc:date>2016-01-28T17:13:45Z</dc:date>
    </item>
    <item>
      <title>Re: Permutation test</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Permutation-test/m-p/246701#M13008</link>
      <description>&lt;P&gt;You're really confusing me here. Is your total population 100 and your sample size 50? You keep changing this.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I still think my Proc SurveySelect is correct, look at the dataset, and let me know what's wrong with it.&lt;/P&gt;</description>
      <pubDate>Thu, 28 Jan 2016 17:18:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Permutation-test/m-p/246701#M13008</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2016-01-28T17:18:58Z</dc:date>
    </item>
    <item>
      <title>Re: Permutation test</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Permutation-test/m-p/246702#M13009</link>
      <description>&lt;P&gt;I run this and I obtain 50 times the same sample &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data original_data (drop=i j);
    do i=1 to 5;
        id=i;
        trt='A';
        output;
    end;
    do j=1 to 5;
        id=j+5;
        trt='B';
        output;
    end;
run;


proc surveyselect data=original_data method=srs rep=50 sampsize=10 out=want;
strata trt/alloc=prop;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 28 Jan 2016 17:21:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Permutation-test/m-p/246702#M13009</guid>
      <dc:creator>maryslpa</dc:creator>
      <dc:date>2016-01-28T17:21:44Z</dc:date>
    </item>
    <item>
      <title>Re: Permutation test</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Permutation-test/m-p/246703#M13010</link>
      <description>&lt;P&gt;I just would like to permute the treatment for the 100 patients, and I would like to do the permutation 1000 times that means I the end I will have 100 different unique dataset with 100 patients&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 28 Jan 2016 17:24:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Permutation-test/m-p/246703#M13010</guid>
      <dc:creator>maryslpa</dc:creator>
      <dc:date>2016-01-28T17:24:13Z</dc:date>
    </item>
    <item>
      <title>Re: Permutation test</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Permutation-test/m-p/246704#M13011</link>
      <description>&lt;P&gt;Well yes, your sample there is only 5 and you're asking for 50, so that won't work.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Do you want to randomize the treatment by patients or are you pulling a sample from a dataset.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 28 Jan 2016 17:30:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Permutation-test/m-p/246704#M13011</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2016-01-28T17:30:16Z</dc:date>
    </item>
    <item>
      <title>Re: Permutation test</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Permutation-test/m-p/246708#M13012</link>
      <description>&lt;P&gt;There is no response variable in the data set, but I think the OP wants to do the following. Assume that each observation has a response variable, Y.&lt;BR /&gt;1. Sample 50 observations at random and assign them to group=1.&lt;/P&gt;
&lt;P&gt;2. Assign the other 50 observations to Group=2.&lt;/P&gt;
&lt;P&gt;3. Compute the difference in&amp;nbsp;between the&amp;nbsp;means (?? not clear) of Y in two groups. Save this number.&lt;/P&gt;
&lt;P&gt;4. Repeat 1-3 many times.&lt;/P&gt;
&lt;P&gt;5. The distribution of the statistics that you accumulate is the null distribution under the hypothesis that there is no difference between the groups.&amp;nbsp; See where the observed difference lies in the null distribution. If it is near the extremes, then reject the null hypothesis.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For a complete&amp;nbsp;explanation&amp;nbsp;and SAS/IML program, see the article &lt;A href="http://blogs.sas.com/content/iml/2014/11/21/resampling-in-sas.html" target="_self"&gt;"Resampling and permutation tests in SAS."&lt;/A&gt;&amp;nbsp;That article also has a link to a DATA step implementation.&lt;/P&gt;</description>
      <pubDate>Thu, 28 Jan 2016 18:09:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Permutation-test/m-p/246708#M13012</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2016-01-28T18:09:53Z</dc:date>
    </item>
    <item>
      <title>Re: Permutation test</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Permutation-test/m-p/246723#M13014</link>
      <description>&lt;P&gt;Thank you for your answer Rick.&lt;BR /&gt;In fact, it is true that in my example there is no response variable, because in my case I only wanted to permut treatment.&amp;nbsp;&lt;BR /&gt;I have alredy do that&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data permutations;
    set origininal_data;
    do permuation=1 to 1000;
        ranorder=ranuni(0);
        output;
    end;

proc sort data=permutations;
by permuation ranorder;
run;

data &amp;amp;out;
    set permutations;
    by permuation;
    if first.permuation then counter=1;
    else counter+1;
    if counter &amp;lt;=50 then &amp;amp;groupvar='A';
    else &amp;amp;groupvar='B';
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;if I split my &amp;amp;out dataset by permuation I will have 1000 datasets but perhaps I have some equal datasets (if we only keep id and trt) =&amp;gt;it is with replacement. I would like to generate 1000 different&amp;nbsp;datasets with different combination of trt and id.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;Thanks for your help&lt;/P&gt;</description>
      <pubDate>Thu, 28 Jan 2016 18:49:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Permutation-test/m-p/246723#M13014</guid>
      <dc:creator>maryslpa</dc:creator>
      <dc:date>2016-01-28T18:49:57Z</dc:date>
    </item>
    <item>
      <title>Re: Permutation test</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Permutation-test/m-p/246735#M13015</link>
      <description>You have a 1000 permutations. Yes there's a chance that one overlaps with another, but it's unlikely and even so, it's a random distribution. If you want to guarantee that you don't have duplicates don't do the sort randomly, shuffle it through and you'll get exactly 1000 different combinations.&lt;BR /&gt;&lt;BR /&gt;Again...this is assuming I understand your question, which I don't seem to be in your case.&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Thu, 28 Jan 2016 19:56:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Permutation-test/m-p/246735#M13015</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2016-01-28T19:56:15Z</dc:date>
    </item>
    <item>
      <title>Re: Permutation test</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Permutation-test/m-p/246742#M13016</link>
      <description>&lt;P&gt;I think you got it. &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;BR /&gt;in reality there are&amp;nbsp;&lt;SPAN&gt;1.0089134e29 combinations, so&amp;nbsp;1.0089134e29 possible&amp;nbsp;datasets. And I the idea is to select one data only one time, that's called without replacement.&amp;nbsp;&lt;BR /&gt;I totally agree with you that the chance to have a datasets drawn 2 times is very very small...&amp;nbsp;&lt;BR /&gt;Thank you for your help &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 28 Jan 2016 20:32:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Permutation-test/m-p/246742#M13016</guid>
      <dc:creator>maryslpa</dc:creator>
      <dc:date>2016-01-28T20:32:27Z</dc:date>
    </item>
    <item>
      <title>Re: Permutation test</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Permutation-test/m-p/246744#M13017</link>
      <description>&lt;P&gt;So you don't really have random samples then you have some sort of systematic system.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You want X permutations&amp;nbsp;that are unique. &amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 28 Jan 2016 20:42:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Permutation-test/m-p/246744#M13017</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2016-01-28T20:42:56Z</dc:date>
    </item>
  </channel>
</rss>

