Description Usage Arguments Value Examples
View source: R/prepareDataforGlm.R
Given a design matrix (if the response is also included it has to be named "Response"), rank deficiency is corrected by dropping zero variance variables and one of each pair of highly correlated variables to make the design matrix invertible.
1 | makeRankFull(data, verbose = FALSE)
|
data |
Matrix/data frame holding the design matrix and optionally a response vector named "Response" |
A subset of the original data structure (some of the variables are removed)
1 2 3 4 5 6 7 8 9 10 11 12 13 | # get gene locations
mtor.loc <- findWells(experiments="brucella-du-k1", contents="MTOR")
scra.loc <- findWells(plates=sapply(mtor.loc, getBarcode),
contents="SCRAMBLED", well.names="G23")
# combine for faster fetching
data <- getSingleCellData(list(mtor.loc[[1]], scra.loc[[1]]))
mtor.dat <- meltData(cleanData(data[[1]]$H6))
scra.dat <- meltData(cleanData(data[[1]]$G23))
# prepare data for glm
data <- prepareDataforGlm(mtor.dat$mat$Cells, scra.dat$mat$Cells)
data <- makeRankFull(data)
# run glm (enforcing full rank might be advisbale)
model <- glm("Response ~ .", binomial, data$train)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.