Description Usage Arguments Details Value Examples
View source: R/mbecs_analyses.R
For a Linear (Mixed) Model, this function extracts the proportion of variance that can be explained by terms and interactions and returns a named row-vector.
1 | mbecVarianceStats(model.fit)
|
model.fit |
A linear (mixed) model object of class 'lm' or 'lmerMod'. |
Linear Model: Perform an analysis of variance (ANOVA) on the model.fit and return the Sum of squares for each term, scaled by the total sum of squares.
Linear Mixed Model: employ helper function 'mbecMixedVariance' to extract residuals, random effects and fixed effects components from the model. The components are then transformed to reflect explained proportions of variance for the model coefficients. The function implements transformation for varying coefficients as well, but NO ADJUSTMENT for single or multiple coefficients at this point.
A named row-vector, containing proportional variance for model terms.
1 2 3 | # This will return the data.frame for plotting.
limo <- stats::lm(dummy.list$cnts[,1] ~ group + batch, data=dummy.list$meta)
vec.variance <- mbecVarianceStats(model.fit=limo)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.