[R] AlgDesign--exact and approximate design
sun
flyhyena at yahoo.com.cn
Wed Oct 10 10:54:18 CEST 2007
Thanks, Steve. I have read that document a bit, seems I need read it more.
I have 6 variables, all factors. 3^2 and 4^4
the following is the code
################
require(AlgDesign)
set.seed(1)
levels = c(v1=2,v2=2, v3=4,v4=4,v5=4,v6=4)
dat<-gen.factorial(levels,center=FALSE,varNames=names(levels),factors=
c(1,2,3,4,5,6))
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 the
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. And I get
$D
[1] 0.06249726
$A
[1] 47.78238
$Ge
[1] 0.997
$Dea
[1] 0.997
can this be intepreted as 99.7% efficiency in D-effi? If set nTrials = 64
and approximate = F, i got
$D
[1] 0.05602027
$A
[1] 62.87131
$Ge
[1] 0.701
$Dea
[1] 0.653
which is more plausible to me. Is this efficiency good enough for practical
use of this design?
thanks,
Sun
----- Original Message -----
From: "S Ellison" <S.Ellison at lgc.co.uk>
To: <flyhyena at yahoo.com.cn>
Sent: Tuesday, October 09, 2007 5:00 PM
Subject: Re: [R] AlgDesign--exact and approximate design
Have you looked at the file "AlgDesign.pdf" which you can find by browsing
the directory for AlgDesign? (Try using start.help() to get a browser
window, look at packages and follow the link at the top of the AlgDesign
page) (this is pretty much like saying 'try reading the help pages',
because I found it just by looking at the AlgDesign help. But it is not
always that easy to find stuff there.
Your formula will work. I prefer to be more explicit, because my data frames
usualy hold more information than the bare factors and response, so I would
probably take the time to say
~v1+v2+v3+v4+v1:v2 +v3:v4
or, more simply,
~v1*v2+v3*v4
Steve E
>>> "sun" <flyhyena at yahoo.com.cn> 09/10/2007 13:30:55 >>>
More information about the R-help
mailing list