[R] 2k-factorial design with 10 parameters
Dimitris Rizopoulos
dimitris.rizopoulos at med.kuleuven.ac.be
Tue Nov 30 13:14:57 CET 2004
Hi Sven,
just use:
lm(y~(x1+x2+x3+...+x10)^10)
e.g.,
y <- rnorm(5000)
x1 <- factor(sample(0:1, 5000, TRUE))
x2 <- factor(sample(0:1, 5000, TRUE))
x3 <- factor(sample(0:1, 5000, TRUE))
x4 <- factor(sample(0:1, 5000, TRUE))
lm1 <- lm(y~(x1+x2+x3+x4)^4)
summary(lm1)
I hope it helps.
Best,
Dimitris
----
Dimitris Rizopoulos
Ph.D. Student
Biostatistical Centre
School of Public Health
Catholic University of Leuven
Address: Kapucijnenvoer 35, Leuven, Belgium
Tel: +32/16/336899
Fax: +32/16/337015
Web: http://www.med.kuleuven.ac.be/biostat
http://www.student.kuleuven.ac.be/~m0390867/dimitris.htm
----- Original Message -----
From: "Sven" <svuwie at gmx.de>
To: <r-help at stat.math.ethz.ch>
Sent: Tuesday, November 30, 2004 12:59 PM
Subject: [R] 2k-factorial design with 10 parameters
> 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?
>
> 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
>
More information about the R-help
mailing list