This function is intended for use in conjunction with RUVIII
, specifically when using the average=TRUE
option. When using the average=TRUE
option, the adjusted data matrix has only one row for each set of replicates. In other words, each set of replicate rows in the orginal data matrix is "collapsed" into a single row in the adjusted data matrix. This function similarly collapses the rows of a dataframe of covariates. Only covariates that are constant within each set of replicates are retained.
collapse.replicates(df, M)
A dataframe.
The replicate structure. See RUVIII
for details.
A sub-dataframe of df.