<?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 SAS Studio - Specify 'balance' for one variable in factorial design experiment (using 'mkt') in Statistical Procedures</title>
    <link>https://communities.sas.com/t5/Statistical-Procedures/SAS-Studio-Specify-balance-for-one-variable-in-factorial-design/m-p/971571#M48821</link>
    <description>&lt;P&gt;I'm creating a factorial design experiment with 8 predictor variables. I'm using the %mkt function to create a randomised design, however, I need the 8th variable (in &lt;FONT color="#FF00FF"&gt;pink&lt;/FONT&gt;, which equates true or false news) to be balanced. Specifically, for each block (survey) I need to make sure theres 4x level 1 (true news) and 4x level 2 (fake news). I think I might need to use the balance function, but I don't know how to specify it to a specific variable.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;%mktruns (3 2 2 2 3 3 2 &lt;FONT color="#FF00FF"&gt;&lt;STRONG&gt;2&lt;/STRONG&gt;&lt;/FONT&gt;)&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;%mktex (3 2 2 2 3 3 2 &lt;FONT color="#FF00FF"&gt;&lt;STRONG&gt;2&lt;/STRONG&gt;&lt;/FONT&gt;, interact=@2, n=96, seed = 12345)&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;%mktblock (nblocks = 12)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;A href="https://communities.sas.com/t5/Statistical-Procedures/bd-p/statistical_procedures" target="_blank" rel="noopener"&gt;Statistical Procedures &lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Mon, 28 Jul 2025 16:47:03 GMT</pubDate>
    <dc:creator>lp1089</dc:creator>
    <dc:date>2025-07-28T16:47:03Z</dc:date>
    <item>
      <title>SAS Studio - Specify 'balance' for one variable in factorial design experiment (using 'mkt')</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/SAS-Studio-Specify-balance-for-one-variable-in-factorial-design/m-p/971571#M48821</link>
      <description>&lt;P&gt;I'm creating a factorial design experiment with 8 predictor variables. I'm using the %mkt function to create a randomised design, however, I need the 8th variable (in &lt;FONT color="#FF00FF"&gt;pink&lt;/FONT&gt;, which equates true or false news) to be balanced. Specifically, for each block (survey) I need to make sure theres 4x level 1 (true news) and 4x level 2 (fake news). I think I might need to use the balance function, but I don't know how to specify it to a specific variable.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;%mktruns (3 2 2 2 3 3 2 &lt;FONT color="#FF00FF"&gt;&lt;STRONG&gt;2&lt;/STRONG&gt;&lt;/FONT&gt;)&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;%mktex (3 2 2 2 3 3 2 &lt;FONT color="#FF00FF"&gt;&lt;STRONG&gt;2&lt;/STRONG&gt;&lt;/FONT&gt;, interact=@2, n=96, seed = 12345)&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;%mktblock (nblocks = 12)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;A href="https://communities.sas.com/t5/Statistical-Procedures/bd-p/statistical_procedures" target="_blank" rel="noopener"&gt;Statistical Procedures &lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 28 Jul 2025 16:47:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/SAS-Studio-Specify-balance-for-one-variable-in-factorial-design/m-p/971571#M48821</guid>
      <dc:creator>lp1089</dc:creator>
      <dc:date>2025-07-28T16:47:03Z</dc:date>
    </item>
    <item>
      <title>Re: SAS Studio - Specify 'balance' for one variable in factorial design experiment (using 'mkt')</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/SAS-Studio-Specify-balance-for-one-variable-in-factorial-design/m-p/971729#M48832</link>
      <description>&lt;P&gt;See&lt;BR /&gt;&lt;A href="https://support.sas.com/rnd/app/macros/" target="_blank"&gt;SAS Macros for Experimental Design and Choice Modeling&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;And maybe&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/16777"&gt;@WarrenKuhfeld&lt;/a&gt;&amp;nbsp;reads along.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Ciao,&lt;/P&gt;
&lt;P&gt;Koen&lt;/P&gt;</description>
      <pubDate>Wed, 30 Jul 2025 19:33:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/SAS-Studio-Specify-balance-for-one-variable-in-factorial-design/m-p/971729#M48832</guid>
      <dc:creator>sbxkoenk</dc:creator>
      <dc:date>2025-07-30T19:33:23Z</dc:date>
    </item>
    <item>
      <title>Re: SAS Studio - Specify 'balance' for one variable in factorial design experiment (using 'mkt')</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/SAS-Studio-Specify-balance-for-one-variable-in-factorial-design/m-p/971731#M48833</link>
      <description>&lt;P&gt;There are multiple ways to approach this. It occurred to me that the easiest way might be to build the Block and x8 relationship as the initial design then fill in the rest of the design around it.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;%mktex(12 2, n=96)

data init;
   set design;
   retain x2-x9 .;
   x9 = x2;
   x2 = .;
run;

proc print; run;

%mktex(12 3 2 2 2 3 3 2 2, n=96, init=init,
       interact=x2|x3|x4|x5|x6|x7|x8|x9@2, seed=12345)

%mktlab(data=design, vars=Block x1-x8)

proc sort; by block x8; run;

proc print; id block; by block; run;

proc freq;
   tables block * x8;
run;
&lt;/PRE&gt;</description>
      <pubDate>Wed, 30 Jul 2025 21:13:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/SAS-Studio-Specify-balance-for-one-variable-in-factorial-design/m-p/971731#M48833</guid>
      <dc:creator>WarrenKuhfeld</dc:creator>
      <dc:date>2025-07-30T21:13:30Z</dc:date>
    </item>
    <item>
      <title>Re: SAS Studio - Specify 'balance' for one variable in factorial design experiment (using 'mkt')</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/SAS-Studio-Specify-balance-for-one-variable-in-factorial-design/m-p/971913#M48840</link>
      <description>&lt;P&gt;Thanks so much for your help&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/16777"&gt;@WarrenKuhfeld&lt;/a&gt;! The code works and creates the design I need, but the d-efficiency comes out lower (84.46) in this code than when I ran my original code (around 94ish). Additionally, when I change the number of blocks in your code to try and increase the d-efficiency, it always comes out high (around 99). This is the case for all other numbers of blocks (I've tried 11, 13, and 14) apart from 12.. I'm not sure if I've done something wrong but I've included the code below for when I did 11 blocks:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#339966"&gt;%mktex(11 2, n=99)&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#339966"&gt;data init;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#339966"&gt;set design;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#339966"&gt;retain x2-x9 .;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#339966"&gt;x9 = x2;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#339966"&gt;x2 = .;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#339966"&gt;run;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#339966"&gt;proc print; run;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#339966"&gt;%mktex(11 3 2 2 2 3 3 2 2, n=99, init=init,&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#339966"&gt;interact=x2|x3|x4|x5|x6|x7|x8|x9@2, seed=12345)&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#339966"&gt;%mktlab(data=design, vars=Block x1-x8)&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#339966"&gt;proc sort; by block x8; run;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#339966"&gt;proc print; id block; by block; run;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#339966"&gt;proc freq;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#339966"&gt;tables block * x8;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#339966"&gt;run;&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 01 Aug 2025 11:14:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/SAS-Studio-Specify-balance-for-one-variable-in-factorial-design/m-p/971913#M48840</guid>
      <dc:creator>lp1089</dc:creator>
      <dc:date>2025-08-01T11:14:43Z</dc:date>
    </item>
    <item>
      <title>Re: SAS Studio - Specify 'balance' for one variable in factorial design experiment (using 'mkt')</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/SAS-Studio-Specify-balance-for-one-variable-in-factorial-design/m-p/971985#M48846</link>
      <description>&lt;P&gt;You are welcome.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You are comparing apples and oranges. If you want to compare the efficiency to the design you originally found (which does not conform to your desired restrictions) then you must evaluate the D-efficiency without the Block variable. This step will do that:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;
%mktex(3 2 2 2 3 3 2 2, n=96, init=final(drop=block), 
       options=check, interact=@2, seed=12345)&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;When you impose restrictions, then you typically will get a lower D-efficiency.&lt;/P&gt;</description>
      <pubDate>Fri, 01 Aug 2025 18:37:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/SAS-Studio-Specify-balance-for-one-variable-in-factorial-design/m-p/971985#M48846</guid>
      <dc:creator>WarrenKuhfeld</dc:creator>
      <dc:date>2025-08-01T18:37:07Z</dc:date>
    </item>
  </channel>
</rss>

