calcVarPart {variancePartition} | R Documentation |
Compute fraction of variation attributable to each variable in regression model. Also interpretable as the intra-class correlation after correcting for all other variables in the model.
calcVarPart(fit, adjust = NULL, adjustAll = FALSE, showWarnings = TRUE, ...) ## S4 method for signature 'lm' calcVarPart(fit, adjust = NULL, adjustAll = FALSE, showWarnings = TRUE, ...) ## S4 method for signature 'lmerMod' calcVarPart(fit, adjust = NULL, adjustAll = FALSE, showWarnings = TRUE, ...)
fit |
model fit from lm() or lmer() |
adjust |
remove variation from specified variables from the denominator. This computes the adjusted ICC with respect to the specified variables |
adjustAll |
adjust for all variables. This computes the adjusted ICC with respect to all variables |
showWarnings |
show warnings about model fit (default TRUE) |
... |
additional arguments (not currently used) |
fraction of variance explained / ICC for each variable in the model
library(lme4) data(varPartData) # Linear mixed model fit <- lmer( geneExpr[1,] ~ (1|Tissue) + Age, info) calcVarPart( fit ) # Linear model # Note that the two models produce slightly different results # This is expected: they are different statistical estimates # of the same underlying value fit <- lm( geneExpr[1,] ~ Tissue + Age, info) calcVarPart( fit )