<?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 Survey select - Adding more to sample size in Statistical Procedures</title>
    <link>https://communities.sas.com/t5/Statistical-Procedures/Proc-Survey-select-Adding-more-to-sample-size/m-p/279186#M14735</link>
    <description>&lt;P&gt;Exclude these sample data you have already gotten from the original data . and run proc surveyselect again.&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;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;PROC SURVEYSELECT
DATA=sashelp.class
METHOD=SRS
OUT=R_ALL_IDPROOFSTATUS1
SEED=26
N=2 ;
RUN;
proc print;run;





proc sql;
create table temp as
 select * from sashelp.class
 except
 select * from R_ALL_IDPROOFSTATUS1;
quit;
PROC SURVEYSELECT
DATA=temp
METHOD=SRS
OUT=R_ALL_IDPROOFSTATUS2
SEED=26
N=2 ;
RUN;
data want;
 set R_ALL_IDPROOFSTATUS1 R_ALL_IDPROOFSTATUS2;
run;
proc print;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>Wed, 22 Jun 2016 02:31:32 GMT</pubDate>
    <dc:creator>Ksharp</dc:creator>
    <dc:date>2016-06-22T02:31:32Z</dc:date>
    <item>
      <title>Proc Survey select - Adding more to sample size</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Proc-Survey-select-Adding-more-to-sample-size/m-p/279104#M14731</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I am using Proc Survey Select to create sample data from some big datasets I want to validate some data. I need a code that will allow me to increase my sample size without changing the original output.&amp;nbsp; I always use a fized seed number so I can replicate my sample if needed.&lt;/P&gt;
&lt;P&gt;For example:&lt;/P&gt;
&lt;P&gt;I have a table X with 10 records and I do a sample of 2...&lt;/P&gt;
&lt;P&gt;Dataset X&lt;/P&gt;
&lt;P&gt;Field&lt;/P&gt;
&lt;P&gt;100&lt;/P&gt;
&lt;P&gt;120&lt;/P&gt;
&lt;P&gt;320&lt;/P&gt;
&lt;P&gt;560&lt;/P&gt;
&lt;P&gt;125&lt;/P&gt;
&lt;P&gt;888&lt;/P&gt;
&lt;P&gt;215&lt;/P&gt;
&lt;P&gt;214&lt;/P&gt;
&lt;P&gt;698&lt;/P&gt;
&lt;P&gt;563&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I obtain the sample dataset Y&lt;/P&gt;
&lt;P&gt;215&lt;/P&gt;
&lt;P&gt;320&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Now I want to increase my sample size to 4, but want to make sure the 215 and 320 are still present as part of my new sample dataset.&amp;nbsp; I would like sometyhing like this:&lt;/P&gt;
&lt;P&gt;215&lt;/P&gt;
&lt;P&gt;320&lt;/P&gt;
&lt;P&gt;563&lt;/P&gt;
&lt;P&gt;100&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Can anyone help me?&amp;nbsp; The code that I am curently using is htis one:&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;&lt;STRONG&gt;PROC&lt;/STRONG&gt;&lt;/FONT&gt; &lt;STRONG&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;SURVEYSELECT&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;DATA&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;=R_ALL_IDPROOFSTATUS &lt;FONT face="Courier New"&gt;(&lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;KEEP&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;&lt;FONT face="Courier New" size="3"&gt;=ID COVERAGE)&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;METHOD&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;&lt;FONT face="Courier New" size="3"&gt;=SRS &lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;OUT&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;&lt;FONT face="Courier New" size="3"&gt;=R_ALL_IDPROOFSTATUS &lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;SEED&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;&lt;FONT face="Courier New" size="3"&gt;=&lt;/FONT&gt;&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;26&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;N&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;&lt;FONT face="Courier New" size="3"&gt;=&lt;/FONT&gt;&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;15&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="3"&gt;&lt;FONT face="Courier New" size="3"&gt; ; &lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;&lt;STRONG&gt;RUN&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 21 Jun 2016 18:06:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Proc-Survey-select-Adding-more-to-sample-size/m-p/279104#M14731</guid>
      <dc:creator>ismahero2</dc:creator>
      <dc:date>2016-06-21T18:06:23Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Survey select - Adding more to sample size</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Proc-Survey-select-Adding-more-to-sample-size/m-p/279111#M14732</link>
      <description>&lt;P&gt;Start with the larger size first (N=4). To get the smaller sample, just use the first few elements of the bigger sample:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;PROC SURVEYSELECT DATA=Have METHOD=SRS OUT=WantBig
SEED=26 N=4; 
RUN;

data WantSmall;
set WantBig(obs=2);
run;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 21 Jun 2016 18:56:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Proc-Survey-select-Adding-more-to-sample-size/m-p/279111#M14732</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2016-06-21T18:56:46Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Survey select - Adding more to sample size</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Proc-Survey-select-Adding-more-to-sample-size/m-p/279122#M14733</link>
      <description>&lt;P&gt;You can extend your sample if you have a variable (inSample below) indicating if the obs is already selected. Put those selected obs in a separate strata:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data test;
input Field inSample;
datalines;
100 0
120 0 
320 1
560 0
125 0
888 0
215 1 
214 0 
698 0
563 0
;

proc sort data=test; by inSample; run;

%let newSampleSize=4;

proc sql;
create table sampleStrata as
select 0 as inSample, &amp;amp;newSampleSize - sum(inSample) as _nsize_ from test
union
select 1 as insample, sum(inSample) from test;
quit;

proc surveyselect data=test sampsize=sampleStrata out=newSample outall seed=78986;
strata inSample;
run;

proc print noobs; run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 21 Jun 2016 19:18:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Proc-Survey-select-Adding-more-to-sample-size/m-p/279122#M14733</guid>
      <dc:creator>PGStats</dc:creator>
      <dc:date>2016-06-21T19:18:37Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Survey select - Adding more to sample size</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Proc-Survey-select-Adding-more-to-sample-size/m-p/279186#M14735</link>
      <description>&lt;P&gt;Exclude these sample data you have already gotten from the original data . and run proc surveyselect again.&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;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;PROC SURVEYSELECT
DATA=sashelp.class
METHOD=SRS
OUT=R_ALL_IDPROOFSTATUS1
SEED=26
N=2 ;
RUN;
proc print;run;





proc sql;
create table temp as
 select * from sashelp.class
 except
 select * from R_ALL_IDPROOFSTATUS1;
quit;
PROC SURVEYSELECT
DATA=temp
METHOD=SRS
OUT=R_ALL_IDPROOFSTATUS2
SEED=26
N=2 ;
RUN;
data want;
 set R_ALL_IDPROOFSTATUS1 R_ALL_IDPROOFSTATUS2;
run;
proc print;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>Wed, 22 Jun 2016 02:31:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Proc-Survey-select-Adding-more-to-sample-size/m-p/279186#M14735</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2016-06-22T02:31:32Z</dc:date>
    </item>
  </channel>
</rss>

