[R] DOE in R?

Carlos J. Gil Bellosta cgb at datanalytics.com
Tue Sep 8 23:39:22 CEST 2009


Hello,

Maybe you want something like this:

desD2 <- optFederov(~(Intro+Duration+GOTO+Fee+Color)^2,dat, nTrials =
30)

In any case, both SAS's proc optex and R's optFederov implement a
non-exhaustive search algorithm and nothing guarantees that the final
design will be the same. 

However, you can check SAS's and R's D values to see to which extent the
designs are far away from the "optimal".

Best regards,

Carlos J. Gil Bellosta
http://www.datanalytics.com



On Sun, 2009-09-06 at 20:33 -0400, b miner wrote:
> I attempted to use the package algdesign. I used the following code.
> However, the results were very much not matching the reference I noted
> (which is located at
> http://www2.sas.com/proceedings/sugi31/196-31.pdf). Instead of 30
> design points, I received 25 and those that were returned, only half
> or so matched the reference. I am inexperienced with optimal designs
> so I dont know if I am doing something wrong, the package is not the
> correct one for the task or a combination. Here is the code in case
> anyone has any input:
> 
> #CODE:
> 
> runif(1) #for a bug in program (assumes random seed object exists)
> 
> dat<-gen.factorial(c(3,3,3,3,2),varNames=c("Intro","Duration","GOTO","Fee","Color"))
> dat #show design plan
> 
> desD<-optFederov(~Intro+Duration+GOTO+Fee+Color
> +quad(Intro)+quad(Duration)+quad(GOTO)+quad(Fee)+Intro*Duration
> +Intro*GOTO+Intro*Fee+Intro*Color+Duration*GOTO+Duration*Fee
> +Duration*Color+GOTO*Fee+GOTO*Color
> +Fee*Color,dat,crit="D",maxIteration=1000,eval=TRUE)
> 
> #D
> desD$D
> 
> #design
> desD$design
> design<-desD$design
> 
> 
> 
> 
> > Subject: Re: [R] DOE in R?
> > From: cgb at datanalytics.com
> > To: b_miner at live.com
> > CC: r-help at r-project.org
> > Date: Sun, 6 Sep 2009 14:57:36 +0200
> > 
> > Hello,
> > 
> > This is your starting point:
> > 
> > http://cran.r-project.org/web/views/ExperimentalDesign.html
> > 
> > Best regards,
> > 
> > Carlos J. Gil Bellosta
> > http://www.datanalytics.com
> > 
> > 
> > On Thu, 2009-09-03 at 17:38 -0700, B_miner wrote:
> > > Hello!
> > > 
> > > 
> > > This is not a topic I am well versed in but required to become
> well versed
> > > in...I welcome any assistance!
> > > 
> > > Using R, I want to create an optimal design for an experiment.
> I'll be
> > > analyzing the results with logistic regression or some generalized
> linear
> > > model. I am thinking that the algdesign package can help (but no
> idea where
> > > to start?).
> > > 
> > > I'm presenting an example here that I have seen the answer to (in
> SAS) in
> > > order to make sure I would have gotten it *right*.
> > > 
> > > There are 5 factors: 4 are quantitative with three levels each and
> 1 is
> > > qualitative with two levels.
> > > 
> > > Factor and levels:
> > > 
> > > Intro: 0, 1.99, 2.99
> > > Duration: 6, 9 ,12
> > > GOTO: 3.99, 4.99, 5.99
> > > Fee: 0, 15, 45
> > > Color: Red, White
> > > 
> > > 
> > > In order to screen these factors, I would want to get a design
> where I could
> > > evaluate all main effects, all first order interactions and the
> squared
> > > terms of Intro, Duration, GOTO and FEE (for example Intro*Intro).
> > > 
> > > Looking for the D-optimal design.
> > > 
> > > Is this something that R can provide?
> > > 
> > > 
> > > These are, according to the SAS paper I read the following:
> > > Obs intro duration goto fee color
> > > 1 0.00 6 3.99 0 WHITE
> > > 2 0.00 6 3.99 45 RED
> > > 3 0.00 6 5.99 0 RED
> > > 4 0.00 6 5.99 45 WHITE
> > > 5 0.00 9 3.99 45 RED
> > > 6 0.00 9 4.99 15 WHITE
> > > 7 0.00 9 5.99 0 RED
> > > 8 0.00 12 3.99 0 RED
> > > 9 0.00 12 3.99 45 WHITE
> > > 10 0.00 12 5.99 0 WHITE
> > > 11 0.00 12 5.99 45 RED
> > > 12 0.00 12 5.99 45 WHITE
> > > 13 1.99 6 3.99 15 RED
> > > 14 1.99 6 4.99 45 WHITE
> > > 15 1.99 6 5.99 0 WHITE
> > > 16 1.99 9 5.99 45 RED
> > > 17 1.99 12 3.99 0 WHITE
> > > 18 1.99 12 5.99 15 RED
> > > 19 2.99 6 3.99 0 WHITE
> > > 20 2.99 6 3.99 45 WHITE
> > > 21 2.99 6 4.99 0 RED
> > > 22 2.99 6 5.99 15 WHITE
> > > 23 2.99 6 5.99 45 RED
> > > 24 2.99 9 3.99 0 RED
> > > 25 2.99 12 3.99 15 WHITE
> > > 26 2.99 12 3.99 45 RED
> > > 27 2.99 12 4.99 0 WHITE
> > > 28 2.99 12 4.99 45 RED
> > > 29 2.99 12 5.99 0 RED
> > > 30 2.99 12 5.99 45 WHITE
> > > 
> > > 
> > 
> > 
> > 
> > 
> 
> 
> ______________________________________________________________________
> Windows Live: Make it easier for your friends to see what you’re up to
> on Facebook. Find out more.




More information about the R-help mailing list