<?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: How to Select  a quota sample from a data set in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/How-to-Select-a-quota-sample-from-a-data-set/m-p/821031#M100007</link>
    <description>&lt;P&gt;This is not elegant and I'm not even sure it will work, but it might.&amp;nbsp; You can create 0,1 columns for each of your criteria and then combine them into a single 0,1 column where 1 means that all of the individual criterion columns were =1.&amp;nbsp; That will give the desired subset.&amp;nbsp; And, if you want a random selection from such rows, just use a validation column stratified by that 0,1 column.&amp;nbsp; As I said, not elegant but might work.&lt;/P&gt;</description>
    <pubDate>Fri, 06 Dec 2024 13:07:07 GMT</pubDate>
    <dc:creator>dlehman1</dc:creator>
    <dc:date>2024-12-06T13:07:07Z</dc:date>
    <item>
      <title>How to Select  a quota sample from a data set</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-Select-a-quota-sample-from-a-data-set/m-p/820782#M99965</link>
      <description>&lt;P&gt;Hello everyone&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am working on a research that implies working on a representative sample. I have already collected data, but I need to select a subset that fulfills the representation criteria that are 4: The sample should be&amp;nbsp;with the following quotas to be met:&lt;BR /&gt;-&lt;BR /&gt;on gender: 50% males and 50% females.&lt;BR /&gt;-&lt;BR /&gt;on age: 1/3 from 18 to 30 years old, 1/3 from 31 to 50 years old and 1/3 over 51 years old.&lt;BR /&gt;-&lt;BR /&gt;on household income level: 1/3 from low , 1/3 from medium 7 and 1/3 from high .&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;1/5 of study population by each of the five regions of the city (North, South, Centre, East and West)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;How can I create this sample?&lt;/P&gt;&lt;P&gt;I am using JMP pro 17&lt;/P&gt;</description>
      <pubDate>Thu, 05 Dec 2024 05:28:16 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-Select-a-quota-sample-from-a-data-set/m-p/820782#M99965</guid>
      <dc:creator>Samira</dc:creator>
      <dc:date>2024-12-05T05:28:16Z</dc:date>
    </item>
    <item>
      <title>Re: How to Select  a quota sample from a data set</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-Select-a-quota-sample-from-a-data-set/m-p/820841#M99971</link>
      <description>&lt;P&gt;sounds like a textbook exercise - is there a chapter with the solution?&lt;/P&gt;</description>
      <pubDate>Thu, 05 Dec 2024 13:59:56 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-Select-a-quota-sample-from-a-data-set/m-p/820841#M99971</guid>
      <dc:creator>hogi</dc:creator>
      <dc:date>2024-12-05T13:59:56Z</dc:date>
    </item>
    <item>
      <title>Re: How to Select  a quota sample from a data set</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-Select-a-quota-sample-from-a-data-set/m-p/820974#M99997</link>
      <description>No&lt;BR /&gt;I actually was discussing this issue with a colleague to start the data analysis of a project with this quota sampling technique.</description>
      <pubDate>Fri, 06 Dec 2024 05:22:12 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-Select-a-quota-sample-from-a-data-set/m-p/820974#M99997</guid>
      <dc:creator>Samira</dc:creator>
      <dc:date>2024-12-06T05:22:12Z</dc:date>
    </item>
    <item>
      <title>Re: How to Select  a quota sample from a data set</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-Select-a-quota-sample-from-a-data-set/m-p/820981#M99999</link>
      <description>&lt;P&gt;This is a complex problem.&amp;nbsp; How large is your data table you are pulling data from.&amp;nbsp; What size of a sample are you pulling?&amp;nbsp; You have 90 combinations of your 4 columns.&amp;nbsp; Did you and your colleague come up with and idea on how to approach the problem?&lt;/P&gt;</description>
      <pubDate>Fri, 06 Dec 2024 06:34:06 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-Select-a-quota-sample-from-a-data-set/m-p/820981#M99999</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2024-12-06T06:34:06Z</dc:date>
    </item>
    <item>
      <title>Re: How to Select  a quota sample from a data set</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-Select-a-quota-sample-from-a-data-set/m-p/821010#M100003</link>
      <description>&lt;P&gt;And you don't want to pick the sample data by the actual share of the distribution, but by the artificial fraction?&lt;BR /&gt;&lt;BR /&gt;How about female, &amp;gt; 51yrs, high income, north.&lt;BR /&gt;Should it be 1/2 * 1/3 * 1/3 * 1/5? (*)&lt;BR /&gt;This is very easy to compute - but maybe too strict - and not intended?&lt;BR /&gt;Just think of the case where there is no female, &amp;gt; 51yrs, high income, north in the original distribution.&lt;BR /&gt;&lt;BR /&gt;On the other hand: If just the 1/2, 1/3, 1/3 and 1/5 have to be fulfilled, one could make up extreme cases with 0 sample data for&amp;nbsp;female, &amp;gt; 51yrs, high income, north.&lt;/P&gt;</description>
      <pubDate>Fri, 06 Dec 2024 08:25:25 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-Select-a-quota-sample-from-a-data-set/m-p/821010#M100003</guid>
      <dc:creator>hogi</dc:creator>
      <dc:date>2024-12-06T08:25:25Z</dc:date>
    </item>
    <item>
      <title>Re: How to Select  a quota sample from a data set</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-Select-a-quota-sample-from-a-data-set/m-p/821031#M100007</link>
      <description>&lt;P&gt;This is not elegant and I'm not even sure it will work, but it might.&amp;nbsp; You can create 0,1 columns for each of your criteria and then combine them into a single 0,1 column where 1 means that all of the individual criterion columns were =1.&amp;nbsp; That will give the desired subset.&amp;nbsp; And, if you want a random selection from such rows, just use a validation column stratified by that 0,1 column.&amp;nbsp; As I said, not elegant but might work.&lt;/P&gt;</description>
      <pubDate>Fri, 06 Dec 2024 13:07:07 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-Select-a-quota-sample-from-a-data-set/m-p/821031#M100007</guid>
      <dc:creator>dlehman1</dc:creator>
      <dc:date>2024-12-06T13:07:07Z</dc:date>
    </item>
    <item>
      <title>Re: How to Select  a quota sample from a data set</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-Select-a-quota-sample-from-a-data-set/m-p/821075#M100010</link>
      <description>&lt;P&gt;data table - ideal case:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;New Table( "quota_samples",
	Add Rows( 100000 ),
	Compress File When Saved( 1 ),
	New Column( "gender",
		Character,
		Formula( Match( Floor( Random Uniform() * 2 ), 0, "M", "F" ) ),
		Compact(),
		Set Selected
	),
	New Column( "income",
		Character,
		Formula(
			Match( Floor( Random Uniform() * 3 ), 0, "low", 1, "medium", "high" )
		),
		Compact()
	),
	New Column( "region",
		Character,
		Formula(
			Match( Floor( Random Uniform() * 5 ),
				0, "N",
				1, "S",
				2, "W",
				3, "E",
				"C"
			)
		)
	),
	New Column( "age",
		Character,
		Formula(
			Match( Floor( Random Uniform() * 3 ), 0, "young", 1, "medium", "old" )
		)
	)
)&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 06 Dec 2024 20:59:22 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-Select-a-quota-sample-from-a-data-set/m-p/821075#M100010</guid>
      <dc:creator>hogi</dc:creator>
      <dc:date>2024-12-06T20:59:22Z</dc:date>
    </item>
    <item>
      <title>Re: How to Select  a quota sample from a data set</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-Select-a-quota-sample-from-a-data-set/m-p/821078#M100011</link>
      <description>&lt;P&gt;For such an ideal table, (if the probabilities of your data set fit to the fractions you want), you can pick random samples - random samples per variant or a specific number of samples per variant - or a combination of all 3 ...&lt;BR /&gt;you will always get the subgroups with the requested fraction (1/2, 1/3, 1/3 and 1/5)&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="hogi_1-1733519336078.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/70949i8A1F790964AB55EF/image-size/medium?v=v2&amp;amp;px=400" role="button" title="hogi_1-1733519336078.png" alt="hogi_1-1733519336078.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;// random sampling : full data set
if(not(current data table() &amp;lt;&amp;lt; has column ("cum_prob")),New Column( "cum_prob",
	Formula(
		Col Rank( random uniform()) / (
		Col Number( 1 ))
	)
));

// random sampling : per variant
if(not(current data table() &amp;lt;&amp;lt; has column ("cum_prob_indiv")),New Column( "cum_prob_indiv",
	Formula(
	tmp = random uniform(); // tmp =1; // **)
		Col Rank( tmp, :gender, :income, :region, :age ) / (
		Col Number( tmp, :gender, :income, :region, :age ))
	)
));

// force ratios: 1/2, 1/3, 1/3, 1/5
if(not(current data table() &amp;lt;&amp;lt; has column ("rank_indiv")),
New Column( "rank_indiv",
	Formula( Col Rank( random uniform(), :gender, :income, :region, :age ) )
));

Graph Builder(
	Size( 518, 448 ),
	Show Control Panel( 0 ),
	Graph Spacing( 4 ),
	Variables( X( :gender ), X( :income ), X( :region ), X( :age ) ),
	Elements( Position( 1, 1 ), Bar( X,  Summary Statistic( "N" ) ) ),
	Elements( Position( 2, 1 ), Bar( X,  Summary Statistic( "N" ) ) ),
	Elements( Position( 3, 1 ), Bar( X,  Summary Statistic( "N" ) ) ),
	Elements( Position( 4, 1 ), Bar( X,  Summary Statistic( "N" ) ) ),
	Local Data Filter(&lt;BR /&gt;        Title( "how many samples do you want ? " ),
		Add Filter(
			columns( :cum_prob, :cum_prob_indiv, :rank_indiv )
		)
	)
);&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;**) instead of using CDFs with&amp;nbsp;&lt;FONT face="courier new,courier"&gt;random uniform()&lt;/FONT&gt;, one can&amp;nbsp;&lt;U&gt;randomizing the row order&lt;/U&gt; and use CDFs of "1".&lt;/P&gt;</description>
      <pubDate>Sun, 08 Dec 2024 12:11:41 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-Select-a-quota-sample-from-a-data-set/m-p/821078#M100011</guid>
      <dc:creator>hogi</dc:creator>
      <dc:date>2024-12-08T12:11:41Z</dc:date>
    </item>
    <item>
      <title>Re: How to Select  a quota sample from a data set</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-Select-a-quota-sample-from-a-data-set/m-p/821080#M100012</link>
      <description>&lt;P&gt;The last option also works for less systematic tables like the one below.&lt;BR /&gt;The only limitation:&amp;nbsp; if there are few samples for one of the variants, there is this clear limit to the number of samples that can be selected.&lt;BR /&gt;&lt;BR /&gt;It follows the simple rule:&lt;BR /&gt;If for one of the variants (A), there are just N samples, take those and pick the same number of random samples from the other variants. Actually, for variant A, this is NOT "sampling".&lt;BR /&gt;So, maybe pick just M &amp;lt;&amp;lt; N random samples from each of the 90 variants.&lt;BR /&gt;You can take the same (JSL) logic - just adjust N to a lower value.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;div class="lia-vid-container video-embed-center"&gt;&lt;div id="lia-vid-6365635988112w726h540r7" class="lia-video-brightcove-player-container"&gt;&lt;video-js data-video-id="6365635988112" data-account="6058004218001" data-player="default" data-embed="default" class="vjs-fluid" controls="" data-application-id="" style="width: 100%; height: 100%;"&gt;&lt;/video-js&gt;&lt;/div&gt;&lt;script src="https://players.brightcove.net/6058004218001/default_default/index.min.js"&gt;&lt;/script&gt;&lt;script&gt;(function() {  var wrapper = document.getElementById('lia-vid-6365635988112w726h540r7');  var videoEl = wrapper ? wrapper.querySelector('video-js') : null;  if (videoEl) {     if (window.videojs) {       window.videojs(videoEl).ready(function() {         this.on('loadedmetadata', function() {           this.el().querySelectorAll('.vjs-load-progress div[data-start]').forEach(function(bar) {             bar.setAttribute('role', 'presentation');             bar.setAttribute('aria-hidden', 'true');           });         });       });     }  }})();&lt;/script&gt;&lt;a class="video-embed-link" href="https://community.jmp.com/t5/video/gallerypage/video-id/6365635988112"&gt;(view in My Videos)&lt;/a&gt;&lt;/div&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;variants = {};
For Each( {gender}, {"F", "M"},
	For Each( {age}, {"young", "medium", "old"},
		For Each( {income}, {"low", "medium", "high"},
			For Each( {region}, {"N", "S", "E", "W", "C"},
				Insert Into( variants, Concat Items( {gender, age, income, region} ) )
			)
		)
	)
);

	Eval(
		Eval Expr(
		new table(
	"unfair",
	add rows( 100000 ), 
	

			New Column( "variant",Character,
				formula(
					variants = As constant(Expr( variants ));
					Try(
						variants[Floor( Random Normal( 45, 30 ) )],
						"F young medium C"
					);
				)
			),
			
			New column ("gender",Character, formula(Word(1,:variant))),
			New column ("age",Character, formula(Word(2,:variant))),
			New column ("income",Character, formula(Word(3,:variant))),
			New column ("region",Character, formula(Word(4,:variant))),
		)
	)
);

&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 06 Dec 2024 21:12:29 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-Select-a-quota-sample-from-a-data-set/m-p/821080#M100012</guid>
      <dc:creator>hogi</dc:creator>
      <dc:date>2024-12-06T21:12:29Z</dc:date>
    </item>
    <item>
      <title>Re: How to Select  a quota sample from a data set</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-Select-a-quota-sample-from-a-data-set/m-p/821081#M100013</link>
      <description>&lt;P&gt;I spent a good deal of time pondering this question, and did not come up with a good answer.&amp;nbsp; I did generate a sample data table similar to&amp;nbsp;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/26800"&gt;@hogi&lt;/a&gt;.&amp;nbsp; Below is modification to&amp;nbsp;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/26800"&gt;@hogi&lt;/a&gt;&amp;nbsp;JSL&amp;nbsp; with my code that I used.&amp;nbsp; Basically, I think it is easier to read, and in the case of Age, it better represents the distribution as stated by&amp;nbsp;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/62852"&gt;@Samira&lt;/a&gt;&amp;nbsp;.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;New Table( "Samp",
	Add Rows( 100000 ),
	Compress File When Saved( 1 ),
	New Column( "gender",
		Character,
		Set Each Value( Match( Random Integer( 1, 2 ), 1, "Male", "Female" ) ),
		Compact()
	),
	New Column( "income",
		Character,
		Set Each Value(
			Match( Random Integer( 1, 3 ), 1, "Low", 2, "Medium", "High" )
		),
		Compact()
	),
	New Column( "region",
		Character,
		Set Each Value(
			Match( Random Integer( 1, 5 ),
				1, "North",
				2, "South",
				3, "West",
				4, "East",
				"Ccentre"
			)
		)
	),
	New Column( "age",
		Character,
		Set Each Value(
			temp = Random Integer( 18, 80 );
			If(
				temp &amp;lt;= 30, "Young",
				temp &amp;lt;= 50, "Middle Age",
				"Old"
			);
		)
	)
)&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 06 Dec 2024 15:33:23 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-Select-a-quota-sample-from-a-data-set/m-p/821081#M100013</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2024-12-06T15:33:23Z</dc:date>
    </item>
    <item>
      <title>Re: How to Select  a quota sample from a data set</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-Select-a-quota-sample-from-a-data-set/m-p/821181#M100018</link>
      <description>&lt;P&gt;Thanks for your reply&lt;/P&gt;&lt;P&gt;The idea is to conduct the research on a representative sample to the population living in the whole city&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 07 Dec 2024 05:41:32 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-Select-a-quota-sample-from-a-data-set/m-p/821181#M100018</guid>
      <dc:creator>Samira</dc:creator>
      <dc:date>2024-12-07T05:41:32Z</dc:date>
    </item>
    <item>
      <title>Re: How to Select  a quota sample from a data set</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-Select-a-quota-sample-from-a-data-set/m-p/821183#M100020</link>
      <description>&lt;P&gt;Many thanks for your efforts&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Your suggestion gave me a good idea to explore my dataset effectively by using local data filter in the graph builder first. For my data it seems that with some combinations (such as middle aged males living in the center region with IM income) the sample is 0&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The whole idea of creating a representative sample by this way seems now to be not practical. The sampling technique that should have been used from the beginning is one of the&amp;nbsp;Probability sampling techniques.&amp;nbsp; May be&amp;nbsp;Stratified Random Sampling, using only the 5 regions as strata. Then a random sample is collected from each strata.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 07 Dec 2024 06:18:47 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-Select-a-quota-sample-from-a-data-set/m-p/821183#M100020</guid>
      <dc:creator>Samira</dc:creator>
      <dc:date>2024-12-07T06:18:47Z</dc:date>
    </item>
    <item>
      <title>Re: How to Select  a quota sample from a data set</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-Select-a-quota-sample-from-a-data-set/m-p/821184#M100021</link>
      <description>&lt;P&gt;Many thanks for your time and efforts&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The whole idea of creating a representative sample by this way seems now to be not practical. The sampling technique that should have been used from the beginning is one of the&amp;nbsp;Probability sampling techniques.&amp;nbsp; May be&amp;nbsp;Stratified Random Sampling, using only the 5 regions as strata. Then a random sample is collected from each strata.&lt;/P&gt;</description>
      <pubDate>Sat, 07 Dec 2024 06:20:09 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-Select-a-quota-sample-from-a-data-set/m-p/821184#M100021</guid>
      <dc:creator>Samira</dc:creator>
      <dc:date>2024-12-07T06:20:09Z</dc:date>
    </item>
    <item>
      <title>Re: How to Select  a quota sample from a data set</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-Select-a-quota-sample-from-a-data-set/m-p/821185#M100022</link>
      <description>&lt;P&gt;Thanks for your reply&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I think you are right,&amp;nbsp;&lt;/P&gt;&lt;P&gt;The whole idea of creating a representative sample by this way seems now to be not practical. The sampling technique that should have been used from the beginning is one of the&amp;nbsp;Probability sampling techniques.&amp;nbsp; May be&amp;nbsp;Stratified Random Sampling, using only the 5 regions as strata. Then a random sample is collected from each strata.&lt;/P&gt;</description>
      <pubDate>Sat, 07 Dec 2024 06:23:03 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-Select-a-quota-sample-from-a-data-set/m-p/821185#M100022</guid>
      <dc:creator>Samira</dc:creator>
      <dc:date>2024-12-07T06:23:03Z</dc:date>
    </item>
    <item>
      <title>Re: How to Select  a quota sample from a data set</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-Select-a-quota-sample-from-a-data-set/m-p/821186#M100023</link>
      <description>&lt;P&gt;That sounds like a reasonable approach&lt;/P&gt;</description>
      <pubDate>Sat, 07 Dec 2024 06:28:07 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-Select-a-quota-sample-from-a-data-set/m-p/821186#M100023</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2024-12-07T06:28:07Z</dc:date>
    </item>
    <item>
      <title>Re: How to Select  a quota sample from a data set</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-Select-a-quota-sample-from-a-data-set/m-p/821208#M100025</link>
      <description>&lt;P&gt;So, what you asked for in the original post is :&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;EM&gt;&lt;U&gt;disproportionate&lt;/U&gt; stratified random sampling&lt;/EM&gt;&lt;/STRONG&gt;, right?&lt;BR /&gt;&lt;BR /&gt;And the strata are the 90 subgroups of gender x age x&amp;nbsp; income x region.&lt;/P&gt;</description>
      <pubDate>Sat, 07 Dec 2024 15:55:08 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-Select-a-quota-sample-from-a-data-set/m-p/821208#M100025</guid>
      <dc:creator>hogi</dc:creator>
      <dc:date>2024-12-07T15:55:08Z</dc:date>
    </item>
    <item>
      <title>Re: How to Select  a quota sample from a data set</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-Select-a-quota-sample-from-a-data-set/m-p/821224#M100028</link>
      <description>&lt;P&gt;After carefully revising different sampling techniques in textbooks, I found that my original idea did not fit with any of them. To get a representative sample you should choose one of the probability sampling techniques ( that offer each respondent of the study population an equal probability or chance of being included in the sample). These techniques include 4 types:&amp;nbsp;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;–Simple random sampling&lt;/LI&gt;&lt;LI&gt;–Systematic sampling&lt;/LI&gt;&lt;LI&gt;–Cluster sampling&lt;/LI&gt;&lt;LI&gt;–Stratified sampling&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;That's why I think stratified sampling could have been used to get the study sample from the beginning (&amp;nbsp;&lt;SPAN&gt;using only the 5 regions as strata. Then&lt;/SPAN&gt;&lt;SPAN&gt;, a random sample is collected from each stratum). The stratified, cluster, and quota sampling techniques require classifying the population into&amp;nbsp;&lt;U&gt;&lt;STRONG&gt;mutually&lt;/STRONG&gt;&lt;/U&gt;&lt;/SPAN&gt;&lt;SPAN&gt;&lt;U&gt;&lt;STRONG&gt;&amp;nbsp;exclusive groups&lt;/STRONG&gt;&lt;/U&gt;, which is not the situation in my question. That's why I think my original question is not correct in the first place.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;:&lt;/P&gt;</description>
      <pubDate>Sun, 08 Dec 2024 09:24:10 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-Select-a-quota-sample-from-a-data-set/m-p/821224#M100028</guid>
      <dc:creator>Samira</dc:creator>
      <dc:date>2024-12-08T09:24:10Z</dc:date>
    </item>
    <item>
      <title>Re: How to Select  a quota sample from a data set</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-Select-a-quota-sample-from-a-data-set/m-p/821225#M100029</link>
      <description>&lt;P&gt;Hm, when we compare this case with DOE...&lt;BR /&gt;&lt;BR /&gt;In a nicely designed DOE one doesn't even pick a (single) sample from each of the 90 subsets.&lt;/P&gt;&lt;P&gt;[1 sample from each of the 90 subsets: "full-factorial" -&amp;gt; way to "expensive"]&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So, maybe together with some simplification of the model, here it's also OK to use a data set with missing entries in some intersection points? And a step further, maybe by intentionally removing (some data points from) some intersection points, one can get something useful between stratified input data and a balanced DOE?&lt;BR /&gt;&lt;BR /&gt;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/11568"&gt;@Victor_G&lt;/a&gt;&amp;nbsp;might have a suggestion?&lt;/P&gt;</description>
      <pubDate>Sun, 08 Dec 2024 09:50:37 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-Select-a-quota-sample-from-a-data-set/m-p/821225#M100029</guid>
      <dc:creator>hogi</dc:creator>
      <dc:date>2024-12-08T09:50:37Z</dc:date>
    </item>
    <item>
      <title>Re: How to Select  a quota sample from a data set</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-Select-a-quota-sample-from-a-data-set/m-p/821227#M100030</link>
      <description>&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="hogi_1-1733659526542.png" style="width: 710px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/70962i87F0BA97AF740229/image-dimensions/710x602?v=v2" width="710" height="602" role="button" title="hogi_1-1733659526542.png" alt="hogi_1-1733659526542.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 08 Dec 2024 12:06:19 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-Select-a-quota-sample-from-a-data-set/m-p/821227#M100030</guid>
      <dc:creator>hogi</dc:creator>
      <dc:date>2024-12-08T12:06:19Z</dc:date>
    </item>
    <item>
      <title>Re: How to Select  a quota sample from a data set</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-Select-a-quota-sample-from-a-data-set/m-p/821230#M100032</link>
      <description>&lt;P&gt;For the approach "random sampling - per variant" from&amp;nbsp;&lt;BR /&gt;&lt;A href="https://community.jmp.com/t5/Discussions/How-to-Select-a-quota-sample-from-a-data-set/m-p/821078/highlight/true#M100011" target="_blank"&gt;https://community.jmp.com/t5/Discussions/How-to-Select-a-quota-sample-from-a-data-set/m-p/821078/highlight/true#M100011&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I created a JSL snippet to stratify arbitrary data - just select the columns and click OK.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;librecall can be downloaded here:&amp;nbsp;&lt;LI-MESSAGE title="Recall Function Library" uid="49462" url="https://community.jmp.com/t5/JMP-Scripts/Recall-Function-Library/m-p/49462#U49462" discussion_style_icon_css="lia-mention-container-editor-message lia-img-icon-tkb-thread lia-fa-icon lia-fa-tkb lia-fa-thread lia-fa"&gt;&lt;/LI-MESSAGE&gt;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here( 1 );
verbose=0;
//Include( ".\libRecall_v2.jsl" );

objects = {"si^myCols", "s^Ncolumns", "s^Nfolds"};
values = {{}, {1}, {5}};
Try( // issue with projects
	librecall:genArrays( objects, values, "Stratify", verbose )
);

dt = Current Data Table();

nw = New Window( "K Fold Creator",
	&amp;lt;&amp;lt;Type( "Modal Dialog" ),
	&amp;lt;&amp;lt;Return Result,
	&amp;lt;&amp;lt;On Validate(
		If( N Items( myCols &amp;lt;&amp;lt; get items() ),
			1,
			Caption( "please select a column" );
			0;
		)
	),
	V List Box(
		Lineup Box( N Col( 2 ),
			Panel Box( "", fcs = Filter Col Selector() ),
			Panel Box( "",
				Lineup Box( N Col( 2 ),spacing( 3 ),
					Button Box( "stratify by", myCols &amp;lt;&amp;lt; append( fcs &amp;lt;&amp;lt; get selected ) ),
					myCols = Col List Box( width( 200 ), min items( 1 ), nlines( 11 ) )
				), 
				
				Lineup Box( N Col( 2 ), spacing( 3 ),
					Text Box( "create more than 1 column?" ),
					Ncolumns = Number Edit Box(
						1,
						4,
						&amp;lt;&amp;lt;setintegeronly( 1 ),
						&amp;lt;&amp;lt;setminimum( 1 ), 

					),
					Text Box( "Number of Folds (K)" ),
					Nfolds = Number Edit Box( 5, 4, &amp;lt;&amp;lt;setintegeronly( 1 ), &amp;lt;&amp;lt;setminimum( 2 ) )
				), 

			)
		), 
		
		H List Box(
			Button Box( "OK",
				librecall:storeRoles( "Stratify", verbose );
				// the modal dialog stores the selected columns.
				For Each( {item}, 1 :: N Items( myCols &amp;lt;&amp;lt; Get Items() ), myCols &amp;lt;&amp;lt; Set Selected( item, 1 ) );
			),
			Button Box( "recall", librecall:recallRoles( "Stratify", verbose ) ),
			Button Box( "clear", librecall:resetRoles( "Stratify", verbose ) ),
			Button Box( "cancel" )
		)
	)
);

If( Not( nw["button"] == 1 ),
	Stop()	
);


myCols = Transform Each( {col}, nw["myCols"], Name Expr( As Column( col ) ) );
// remove continuous and exotic values.
myCols = Filter each({col}, myCols, col &amp;lt;&amp;lt; Get Modeling Type == "Nominal" | col &amp;lt;&amp;lt; Get Modeling Type == "Ordinal" );

For( i = 1, i &amp;lt;= nw["Ncolumns"], i++, 

	rankExpr = Expr(
		Col Rank( tmp, Excluded() )
	);
	For Each( {col}, myCols, Insert Into( rankExpr, Name Expr( col ) ) );
	numberExpr = Substitute( Name Expr( rankExpr ), Expr( Col Rank() ), Expr( Col Number() ) );

	Eval(
		Substitute(
				Expr(
					New Column( "Fold",
						Formula(
							If( Excluded(),
								.,
								tmp = Random Uniform();
								Floor( (_rank_ - 1) / (_number_) * _folds_ ) + 1;
							)
						)
					)
				),
			Expr( _rank_ ), Name Expr( rankExpr ),
			Expr( _number_ ), Name Expr( numberExpr ),
			Expr( _folds_ ), nw["Nfolds"]
		)
	);
);

&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sun, 08 Dec 2024 14:07:07 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-Select-a-quota-sample-from-a-data-set/m-p/821230#M100032</guid>
      <dc:creator>hogi</dc:creator>
      <dc:date>2024-12-08T14:07:07Z</dc:date>
    </item>
  </channel>
</rss>

