R中的乘法设计矩阵
Multiplicative design matrix in R
在R
,
是
model.matrix(~ Treatment + Time + Treatment*Time, table_design)
相当于
model.matrix(~ Treatment*Time, table_design)
谢谢。
是的。
table_design<-data.frame(
Treatment=rep(c("A","B"), each=10),
Time=rpois(20,20)
)
all.equal(
model.matrix(~ Treatment + Time + Treatment*Time, table_design),
model.matrix(~ Treatment*Time, table_design)
)
# [1] TRUE
在R
,
是
model.matrix(~ Treatment + Time + Treatment*Time, table_design)
相当于
model.matrix(~ Treatment*Time, table_design)
谢谢。
是的。
table_design<-data.frame(
Treatment=rep(c("A","B"), each=10),
Time=rpois(20,20)
)
all.equal(
model.matrix(~ Treatment + Time + Treatment*Time, table_design),
model.matrix(~ Treatment*Time, table_design)
)
# [1] TRUE