2k-factorial design with 10 parameters
On 30 Nov 2004 at 12:59, Sven wrote:
Hi, I'd like to apply a 2^k factorial design with k=10 parameters. Obviously this results in a quite long term for the model equation due to the high number of combinations of parameters. How can I specify the equation for the linear model (lm) without writing all combinations explicitly down by hand? Does a R command exist for this problematic?
Hi Sven
from
?lm
The specification 'first*second'
indicates the _cross_ of 'first' and 'second'. This is the same
as 'first + second + first:second'
and from
?formula
## Create a formula for a model with a large number of variables:
xnam <- paste("x", 1:25, sep="")
(fmla <- as.formula(paste("y ~ ", paste(xnam, collapse= "+"))))
If you change 1:25 to 1:10 and collapse to * and use fmla in your
model you will get what you want (I suppose). But I woder if it
has any sense.
Cheers
Petr
Thanks for your help in advance, Sven
______________________________________________ R-help at stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Petr Pikal petr.pikal at precheza.cz