BookmarkSubscribeRSS Feed
gustavjung
Calcite | Level 5

Hello,

 

I am learning DoE  and want to simulate responses for fractional factorial design.

As an input for simulation I want to use estimated effect sizes of main factors and some interactions.

I know there is a formula for calculating effects from obtained responses:

"For each of the main effects, the estimated effect consists of the mean at the high level of the factor minus the mean at the low level of the factor."


Here is the screenshot of fractional factorial design from a book:

 

03.30.2018-23.31

 

 

And here is formulas for calculation of effects when responses are known:

 

03.30.2018-23.53

 

But I want inverse:

1. Input values of estimated main effects and interactions (A B C AB AC etc.)
2. Derive a simulated responses for all rows (1, a, b, ab..) so that they lead to that predefined effects.


Could you help me please how to approach this problem?

 

SAS, R or JMP code would be extremely helpful.

After all I want to use derived responses in this SAS JMP code for simulation binomial responses. Also I will use it with higher number of factors.

3 REPLIES 3
PaigeMiller
Diamond | Level 26

To simulate data for such a situation, you have to first write out (or have in your mind) an actual model. For example, y = 2 + 5*A – 6*B + 4*A*C + error. Then the simulation ought to be simple (in SAS, you'd need to choose one of the many functions that generate random variables for the error)

--
Paige Miller
gustavjung
Calcite | Level 5

Hi @PaigeMiller,

 

Thank you for your reply.

For full factorial design in case I take Y as a success rate my prediction equation is:

 

0.12125 + Match( :A, -1, -0.04875, 1, 0.04875, . )
+Match( :B, -1, -0.06375, 1, 0.06375, . )
+Match( :C, -1, -0.00375, 1, 0.00375, . )
+Match( :A,
-1, Match( :B, -1, 0.02625, 1, -0.02625, . ),
1, Match( :B, -1, -0.02625, 1, 0.02625, . ),
.
) + Match( :A,
-1, Match( :C, -1, 0.00625, 1, -0.00625, . ),
1, Match( :C, -1, -0.00625, 1, 0.00625, . ),
.
) + Match( :B,
-1, Match( :C, -1, 0.00625, 1, -0.00625, . ),
1, Match( :C, -1, -0.00625, 1, 0.00625, . ),
.
)

 

How do I simulate responses based on this model for fractional factorial res III design?

 

After all I would like to use this responses in this script suggested on JMP forum. Also the actual number of factors I will use is 18 and res iV. The example above is for simplicity.

 

New Table( "Untitled",
  Add Rows( 10 ),
  New Column( "A", Numeric, "Nominal", Format( "Best", 12 ),
              Formula( Random Integer( 0, 1 ) ) ),
  New Column( "B", Numeric, "Nominal", Format( "Best", 12 ),
              Formula( Random Integer( 0, 1 ) ) ),
  New Column( "C", Numeric, "Nominal", Format( "Best", 12 ),
              Formula( Random Integer( 0, 1 ) ) ),
  New Column( "Success?", Numeric, "Nominal", Format( "Best", 12 ),
              Formula(
             If(
             :A == 0 & :B == 0 & :C == 0, Random Binomial( 1, 0.05 ),
             :A == 0 & :B == 0 & :C == 1, Random Binomial( 1, 0.05 ),
             :A == 0 & :B == 1 & :C == 0, Random Binomial( 1, 0.065 ),
             :A == 0 & :B == 1 & :C == 1, Random Binomial( 1, 0.065 ),
             :A == 1 & :B == 0 & :C == 0, Random Binomial( 1, 0.055 ),
             :A == 1 & :B == 0 & :C == 1, Random Binomial( 1, 0.055 ),
             :A == 1 & :B == 1 & :C == 0, Random Binomial( 1, 0.075 ),
             :A == 1 & :B == 1 & :C == 1, Random Binomial( 1, 0.075 ),
             Random Binomial( 1, 0.05 ) ) ) ) )

 

PaigeMiller
Diamond | Level 26

It looks to me like you are using JMP (or some other language) and not SAS, in which case I can't help you. If you are using JMP, they have their own community for asking questions.

 

it also appears to me that you have changed from talking about arbitrary Y variable to one that has to be a value between 0 and 1, is that correct?

--
Paige Miller

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

Multiple Linear Regression in SAS

Learn how to run multiple linear regression models with and without interactions, presented by SAS user Alex Chaplin.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 3 replies
  • 1111 views
  • 2 likes
  • 2 in conversation