get_design_subset {lazy.sasef} | R Documentation |
Get a subset of design matrix
get_design_subset(obj = NULL, effect = NULL, order = NULL)
obj |
A design object which is a list of the design matrix X and infomation list info. |
effect |
name of the effect whose design matrix is needed. |
order |
order of the effects whose design matrix is needed. |
A design object is a list of the design matrix (X),
infomation list (info) and parameter list (param) where
X is the design matrix
and
info is a list whose length is the number of effects.
info[[i]] contains the following:
ename name of effect[i]
order order of effect[i]: 0, 1, ..., maxorder
elevels # of levels of effect[i]
df degrees of freedom of effect[i]
erange range of effect[i] in the (full rank) estimable functions
range=cbind(from,to) where
from is the starting independent colmn of effect[i] in X
to is the ending independent column of effect[i] in X
rangef=cbind(from,to) where
from is the starting colmn of effect[i] in X
to is the ending column of effect[i] in X
menum vector of main effect number involved in effect[i]
contained vector of effect numbers which contains effect[i]
where effect number is defined according to the order of column of X.
contains vector of effects which effect[i] contais.
param is a list consisting of
type, drop, maxorder, sort, pattern
Information of estimable function may be added to this object later.
A subset of X matrix corresponding to effect or order.
levels <- c(2,3,2) ll <- lapply( levels,function(x) seq(1:x) ) data <- cprod(ll); data <- rbind(data,c(1,1,1)) rownames(data) <- 1:nrow(data); colnames(data)=c("A","B","C") res1 <- design_mat( data ) get_design_subset( res1, effect="AB" ) get_design_subset( res1, order=c(1,3) )