NA
s from 'X' and 'y.' The result is a matrix the first column of which is the 'y' vector, and the remaining columns of which constitute 'X.'mxGREMLDataHandler(data, yvars=character(0), Xvars=list(), addOnes=TRUE,
blockByPheno=TRUE, staggerZeroes=TRUE)
yvars
.TRUE
.TRUE
(default), then the resulting 'y' will contain phenotype #1 for individuals 1 thru n, phenotype #2 for individuals 1 thru n, ... If FALSE
, then observationsTRUE
(default), then each phenotype's covariates in 'X' are "staggered," and 'X' is padded out with zeroes. If FALSE
, then 'X' is formed simply by stacking the phenotypes' covariadataset.is.yX=TRUE
in mxExpectationGREML()
.NA
's. Can be provided as as argument casesToDropFromV
to mxExpectationGREML()
.Xdata
can be a character vector. In a polyphenotype analysis, if the same covariates are to be used with all phenotypes, then Xdata
can be a list of length 1.Note the synergy between the output of mxGREMLDataHandler()
and arguments dataset.is.yX
and casesToDropFromV
to mxExpectationGREML()
.
If the dataframe or matrix supplied for argument data
has n rows, and argument yvars
is of length p, then the resulting 'y' and 'X' matrices will have np rows. Then, if either matrix contains any NA
's, the rows containing the NA
's are trimmed from both 'X' and 'y' before being returned in the output (in which case they will obviously have fewer than np rows). Function mxGREMLDataHandler()
reports which rows of the full-size 'X' and 'y' were trimmed out due to missing observations. These row indices can be provided as argument casesToDropFromV
to mxExpectationGREML()
.
mxExpectationGREML()
. More information about the OpenMx package may be found here.dat <- cbind(rnorm(100),rep(1,100))
colnames(dat) <- c("y","x")
dat[42,1] <- NA
dat[57,2] <- NA
dat2 <- mxGREMLDataHandler(data=dat, yvars="y", Xvars=list("x"),
addOnes = FALSE)
str(dat2)
Run the code above in your browser using DataLab