<?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: Optimal Design, implementing constraints in Statistical Procedures</title>
    <link>https://communities.sas.com/t5/Statistical-Procedures/Optimal-Design-implementing-constraints/m-p/302565#M16087</link>
    <description>&lt;P&gt;Yes, I am aware of the problems with implementing these constraints. But I will try to get the design in two steps. Thank you for the advice.&lt;/P&gt;</description>
    <pubDate>Wed, 05 Oct 2016 10:28:42 GMT</pubDate>
    <dc:creator>Dave90</dc:creator>
    <dc:date>2016-10-05T10:28:42Z</dc:date>
    <item>
      <title>Optimal Design, implementing constraints</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Optimal-Design-implementing-constraints/m-p/302279#M16071</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;this is the first SAS-question I ever posted and I am completely new to SAS (version 9.4). I only need to program one thing with SAS, but I encountered a problem, I cant find the answer for. I need to find an optimal Design for an intelligence test using the optex procedure. Here is the code I have so far:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;proc plan ordered;&lt;BR /&gt;factors x1=2 x2=2 x3=2 x4=2 x5=2 x6=2 / noprint;&amp;nbsp;&lt;BR /&gt;output out=Candidate&lt;BR /&gt;x1 nvals=(0 to 1)&lt;BR /&gt;x2 nvals=(0 to 1)&lt;BR /&gt;x3 nvals=(0 to 1)&lt;BR /&gt;x4 nvals=(0 to 1)&lt;BR /&gt;x5 nvals=(0 to 1)&lt;BR /&gt;x6 nvals=(0 to 1); *give each level a valuename. Since it is nominal I choose the classic 0 and 1;&lt;BR /&gt;data Candidate; set Candidate;&lt;BR /&gt;if (^((x1 = 1) &amp;amp; (x2 = 1) &amp;amp; (x3 = 1) &amp;amp; (x4 = 1) &amp;amp; (x5 = 1)));&lt;BR /&gt;if (^((x6 = 1) &amp;amp; (x2 = 1) &amp;amp; (x3 = 1) &amp;amp; (x4 = 1) &amp;amp; (x5 = 1)));&lt;BR /&gt;if (^((x1 = 1) &amp;amp; (x6 = 1) &amp;amp; (x3 = 1) &amp;amp; (x4 = 1) &amp;amp; (x5 = 1)));&lt;BR /&gt;if (^((x1 = 1) &amp;amp; (x2 = 1) &amp;amp; (x6 = 1) &amp;amp; (x4 = 1) &amp;amp; (x5 = 1)));&lt;BR /&gt;if (^((x1 = 1) &amp;amp; (x2 = 1) &amp;amp; (x3 = 1) &amp;amp; (x6 = 1) &amp;amp; (x5 = 1)));&lt;BR /&gt;if (^((x1 = 1) &amp;amp; (x2 = 1) &amp;amp; (x3 = 1) &amp;amp; (x4 = 1) &amp;amp; (x6 = 1)));&lt;BR /&gt;if (^((x1 = 1) &amp;amp; (x2 = 1) &amp;amp; (x3 = 1) &amp;amp; (x4 = 1) &amp;amp; (x5 = 1) &amp;amp; (x6 = 1)));&lt;BR /&gt;if (^((x1 = 1) &amp;amp; (x2 = 0) &amp;amp; (x3 = 0) &amp;amp; (x4 = 0) &amp;amp; (x5 = 0) &amp;amp; (x6 = 0)));&lt;BR /&gt;if (^((x1 = 0) &amp;amp; (x2 = 1) &amp;amp; (x3 = 0) &amp;amp; (x4 = 0) &amp;amp; (x5 = 0) &amp;amp; (x6 = 0)));&lt;BR /&gt;if (^((x1 = 0) &amp;amp; (x2 = 0) &amp;amp; (x3 = 1) &amp;amp; (x4 = 0) &amp;amp; (x5 = 0) &amp;amp; (x6 = 0)));&lt;BR /&gt;if (^((x1 = 0) &amp;amp; (x2 = 0) &amp;amp; (x3 = 0) &amp;amp; (x4 = 1) &amp;amp; (x5 = 0) &amp;amp; (x6 = 0)));&lt;BR /&gt;if (^((x1 = 0) &amp;amp; (x2 = 0) &amp;amp; (x3 = 0) &amp;amp; (x4 = 0) &amp;amp; (x5 = 1) &amp;amp; (x6 = 0)));&lt;BR /&gt;if (^((x1 = 0) &amp;amp; (x2 = 0) &amp;amp; (x3 = 0) &amp;amp; (x4 = 0) &amp;amp; (x5 = 0) &amp;amp; (x6 = 1)));&lt;BR /&gt;if (^((x1 = 0) &amp;amp; (x2 = 0) &amp;amp; (x3 = 0) &amp;amp; (x4 = 0) &amp;amp; (x5 = 0) &amp;amp; (x6 = 0)));&lt;BR /&gt;run;&lt;BR /&gt;proc print data=Candidate(obs=16);&lt;BR /&gt;run;&lt;BR /&gt;proc optex data=Candidate seed=123456 coding = orth;&lt;BR /&gt;class x1 x2 x3 x4 x5 x6;&lt;BR /&gt;model x1 x2 x3 x4 x5 x6 x1*x2 x1*x3 x1*x4 x1*x5 x1*x6 x2*x3 x2*x4 x2*x5 x2*x6 x3*x4 x3*x5 x3*x6 x4*x5 x4*x6 x5*x6;&lt;BR /&gt;blocks structure = (20)12;&lt;BR /&gt;output out=IQ;&lt;BR /&gt;proc print data= IQ;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;As you can see, there are six different nominal factors defined (x1-x6). Each factor represents a rule of thinking that is either required in a test item (factor value = 1) or not (factor value = 0). Each item can hence be seen as a specific experimental condition, which is defined by a certain combination of factor levels, that is a specific combination of applied rules of thinking. I excluded all conditions&amp;nbsp;from the design in which zero, only one, or more than four rules are active. Here is my problem: For practical reasons, we cannot have the testees work on too many four-rule-items because they are too difficult and time consuming. The idea is, that we have 20 people work on 12 items each (I programed that using the blocks structure statement). I would like to implement the constraint that only 2 out of the 12 items for each person are 4 rule-items. The rest beeing five 2-rule items and five 3 rule-items. Then I would like to recieve the optimal design for that. Is that somehow possible? Thank you in advance.&lt;/P&gt;</description>
      <pubDate>Tue, 04 Oct 2016 08:10:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Optimal-Design-implementing-constraints/m-p/302279#M16071</guid>
      <dc:creator>Dave90</dc:creator>
      <dc:date>2016-10-04T08:10:17Z</dc:date>
    </item>
    <item>
      <title>Re: Optimal Design, implementing constraints</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Optimal-Design-implementing-constraints/m-p/302524#M16085</link>
      <description>&lt;P&gt;I am not sure that I can offer a solution here,&amp;nbsp;only some suggestions on how to check up on what OPTEX is doing.&amp;nbsp;&amp;nbsp; I have modified your code as follows:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc plan ordered;
factors x1=2 x2=2 x3=2 x4=2 x5=2 x6=2 / noprint; 
output out=Candidate
x1 nvals=(0 to 1)
x2 nvals=(0 to 1)
x3 nvals=(0 to 1)
x4 nvals=(0 to 1)
x5 nvals=(0 to 1)
x6 nvals=(0 to 1); *give each level a valuename. Since it is nominal I choose the classic 0 and 1;
run;

data Candidate;
  set Candidate;
  nitems = sum (of x1-x6);
  if nitems in (2,3,4);     /* this is equivalent to the 15 if statements above */
  rnum + 1;                 /* number each candidate run */
  rstr = cats( of x1-x6 );  /* make a string that represents each run */
run;

proc freq data=candidate;
  tables nitems;
run;

proc optex data=Candidate seed=123456 coding = orth;
class x1 x2 x3 x4 x5 x6;
model x1 x2 x3 x4 x5 x6 x1*x2 x1*x3 x1*x4 x1*x5 x1*x6 x2*x3 x2*x4 x2*x5 x2*x6 x3*x4 x3*x5 x3*x6 x4*x5 x4*x6 x5*x6;
id rnum rstr nitems;
blocks structure = (20)12;
output out=IQ;
run;

proc tabulate data=IQ noseps;
  class rnum rstr nitems;
  tables rnum*rstr*nitems, n*f=3.0;
run;

proc tabulate data=IQ noseps;
  class block x1-x6 nitems;
  tables block, (x1-x6)*n=' '*f=3.0;
  tables block, nitems*n=' '*f=3.0;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;From the output of the 1st TABULATE it is clear that, in order to support the model&amp;nbsp;you have specified, OPTEX gives preference to&amp;nbsp;candidates with 2 and 4 items as&amp;nbsp;they are selected 6 times each, while&amp;nbsp;candidates with 3 items are only selected 3 times each.&amp;nbsp; So the&amp;nbsp;further restrictions that you want to place on the 4 item candidates&amp;nbsp;must&amp;nbsp;reduce the quality of the&amp;nbsp;design that you get.&amp;nbsp; The last table shows that each subject currently gets 4 or 5 runs with 4 items, and you want to reduce this to 2.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I would consider making the design in two steps.&amp;nbsp; So first select 240 runs using the model you want, and then divide them into blocks in a 2nd step.&amp;nbsp; You could do this with two OPTEX statements or by adding a GENERATE n=240 statement to your existing code.&amp;nbsp; You could then use the AUGMENT option&amp;nbsp;to&amp;nbsp;force a preselected set of&amp;nbsp;40 4 item candidates into the design.&amp;nbsp; Then&amp;nbsp;augment these&amp;nbsp;from a candidate set&amp;nbsp;that has all the&amp;nbsp;2&amp;nbsp;and 3 items runs.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You are putting a lot of constraints on the problem and I would recommend proceeding with caution.&amp;nbsp; Perhaps pilot your experiment with 6 or 7 subjects and check that you&amp;nbsp;are able to analyze the data how you intended.&lt;/P&gt;</description>
      <pubDate>Wed, 05 Oct 2016 08:20:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Optimal-Design-implementing-constraints/m-p/302524#M16085</guid>
      <dc:creator>IanWakeling</dc:creator>
      <dc:date>2016-10-05T08:20:28Z</dc:date>
    </item>
    <item>
      <title>Re: Optimal Design, implementing constraints</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Optimal-Design-implementing-constraints/m-p/302565#M16087</link>
      <description>&lt;P&gt;Yes, I am aware of the problems with implementing these constraints. But I will try to get the design in two steps. Thank you for the advice.&lt;/P&gt;</description>
      <pubDate>Wed, 05 Oct 2016 10:28:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Optimal-Design-implementing-constraints/m-p/302565#M16087</guid>
      <dc:creator>Dave90</dc:creator>
      <dc:date>2016-10-05T10:28:42Z</dc:date>
    </item>
  </channel>
</rss>

