Decompose a matrix with multiple columns of dependent variables

Share:

Description

Decomposes a matrix with multiple columns of dependent variables into a mdm object

Usage

1
apart(X, dependent, use_rownames = TRUE)

Arguments

X

A matrix with columns corresponding to either independent variables or dependent variables. The names of the independent variables are taken from the column names of X

dependent

Vector of length ncol(X). If numeric, interpret as the column numbers of the dependent variable. If logical, TRUE elements correspond to dependent variables

use_rownames

Boolean, with default TRUE meaning to use the rownames of X to create rownames in the returned value

Value

Returns an object of class experiment.

Author(s)

Robin K. S. Hankin

See Also

as.list

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
data(e3mg)
apart(e3mg , 6:7)

a <- round(emulator::latin.hypercube(6,5),2)
rownames(a) <- c("first","second","third","fourth","fifth","sixth")
colnames(a) <- c(letters[1:3],"length","depth")
jj_expt <- apart(a,4:5)    # use of apart()

x <- get_mdm(jj_expt[c(1,7)])
xold(x) <- 0.5

multem(x,jj_expt,hp=as.mhp(x),give=TRUE)