[R] how to generate and evaluate a design using Algdesign

S Ellison S.Ellison at lgc.co.uk
Fri Oct 12 12:59:46 CEST 2007

If you do something like length(coef(lm(y~.+v3:v4 + v5:v6, data=dat)))
to get a quick empirical estimate of required number of coefficients,
you will find that you have 35 coefficients, so 32 observations cannot
provide a solution at all. And indeed, nTrials=35 is the first size at
which optFederov even tries to find a design.

After that,many possible trial designs will be singular because (I
think) most subsets of the data will miss out support points for the
design. You need a lot of repeats to find a design at all with so few
points, or optfederov won't find a viable design at all. 

If you're prepared to wait a while, run with at least nTrials=45 with
plenty of repeats and you have a chance of something useful, though the
efficiency (judged by Ge) looked pretty poor. 

Steve E
>>> "sun" <flyhyena at yahoo.com.cn> 10/10/2007 14:59:59 >>>

  I have some problems when using AlgDesign->optFederov() generating 

I have 6 variables, all factors. 3^2 and 4^4, I want to have a design
can take care of  main effects and two interactions within 2 pair of 
variables v3-v4 and v5-v6, the following is the code

levels = c(v1=3,v2=3, v3=4,v4=4,v5=4,v6=4)


model = ~.+v3:v4+v5:v6

optDgn<-optFederov(model,dat,nRepeat=5,nTrials = 32,criterion = "D",
approximate = F)

this lead to a error msg " nTrials must be greater than or equal to
number of columns in expanded X" . I thought I do not have that many
columns. if I change approximate to T, this error has gone.

if I remove nTrials argument in function call:
> optDgn<-optFederov(~.+v3:v4+v5:v6,dat,nRepeat=5,criterion = 
> "D",approximate = F)
I got a error : "Singular design."

what would be the cause and what is the sullotion?

another question is, how do I measure or evaluate a design to see if it
able to handle which effects(main effects/which intercations)? I got
other designs generated by other packages, so I 'd like to check their


Thanks in advance,


R-help at r-project.org mailing list
PLEASE do read the posting guide
and provide commented, minimal, self-contained, reproducible code.

This email contains information which may be confidential and/or privileged, and is intended only for the individual(s) or organisation(s) named above. If you are not the intended recipient, then please note that any disclosure, copying, distribution or use of the contents of this email is prohibited. Internet communications are not 100% secure and therefore we ask that you acknowledge this. If you have received this email in error, please notify the sender or contact +44(0)20 8943 7000 or postmaster at lgcforensics.com immediately, and delete this email and any attachments and copies from your system. Thank you. 

LGC Limited. Registered in England 2991879. 
Registered office: Queens Road, Teddington, Middlesex TW11 0LY, UK

More information about the R-help mailing list