fit_lmx | R Documentation |
Fit lm, lme, or lmer
fit_lmx(
object,
fit,
formula = default_formula(object),
drop = varlevels_dont_clash(object, all.vars(formula)),
codingfun = contr.treatment,
coefs = colnames(create_design(object, formula = formula, drop = drop, codingfun =
codingfun, verbose = FALSE)),
block = NULL,
opt = "optim",
weightvar = if ("weights" %in% assayNames(object)) "weights" else NULL,
statvars = c("effect", "p", "se", "t")[1:2],
sep = FITSEP,
verbose = TRUE,
plot = FALSE
)
fit_lm(
object,
formula = default_formula(object),
drop = varlevels_dont_clash(object, all.vars(formula)),
codingfun = contr.treatment,
block = NULL,
weightvar = if ("weights" %in% assayNames(object)) "weights" else NULL,
statvars = c("effect", "p", "se", "t")[1:2],
sep = FITSEP,
coefs = colnames(create_design(object, formula = formula, drop = drop, codingfun =
codingfun, verbose = FALSE)),
contrasts = NULL,
verbose = TRUE,
plot = FALSE
)
fit_lme(
object,
formula = default_formula(object),
drop = varlevels_dont_clash(object, all.vars(formula)),
codingfun = contr.treatment,
block = NULL,
weightvar = if ("weights" %in% assayNames(object)) "weights" else NULL,
opt = "optim",
statvars = c("effect", "p", "se", "t")[1:2],
sep = FITSEP,
coefs = colnames(create_design(object, formula = formula, drop = drop, codingfun =
codingfun, verbose = FALSE)),
contrasts = NULL,
verbose = TRUE,
plot = FALSE
)
fit_lmer(
object,
formula = default_formula(object),
drop = varlevels_dont_clash(object, all.vars(formula)),
codingfun = contr.treatment,
block = NULL,
weightvar = if ("weights" %in% assayNames(object)) "weights" else NULL,
statvars = c("effect", "p", "se", "t")[1:2],
sep = FITSEP,
coefs = colnames(create_design(object, formula = formula, drop = drop, codingfun =
codingfun, verbose = FALSE)),
contrasts = NULL,
verbose = TRUE,
plot = FALSE
)
object |
SummarizedExpriment |
fit |
'lm', 'lme', or 'lmer' |
formula |
formula |
drop |
TRUE or FALSE |
codingfun |
coding function |
coefs |
NULL or stringvector |
block |
NULL or svar |
opt |
optimizer used in fit_lme: 'optim' (more robust) or 'nlminb' |
weightvar |
NULL or svar |
statvars |
character vector: subset of c('effect', 'p', 'fdr', 't') |
sep |
string |
verbose |
TRUE or FALSE |
plot |
TRUE or FALSE |
contrasts |
unused. only to allow generic get(fitfun)(contrasts) |
SummarizedExperiment
file <- system.file('extdata/atkin.metabolon.xlsx', package = 'autonomics')
object <- read_metabolon(file)
fit_lm( object, formula = ~subgroup)
fit_limma( object, formula = ~subgroup)
fit_limma( object, formula = ~subgroup, block = 'Subject' )
fit_lme( object, formula = ~subgroup, block = 'Subject' )
fit_lmer( object, formula = ~subgroup, block = 'Subject' )
# fit_lme( object, formula = ~subgroup, block = ~1|Subject) # needs fine-tuning
# fit_lmer( object, formula = ~subgroup + (1|Subject)) # needs fine-tuning
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.