| Title: | Dominance Analysis Methods |
| Version: | 1.3.0 |
| Date: | 2026-4-19 |
| Description: | Dominance analysis relative importance methods that are intended for predictive models. |
| Imports: | parallel, stats, utils |
| Suggests: | dplyr, dominanceanalysis, forcats, Formula, ggplot2, knitr, lme4, parameters, performance, pscl, purrr, relaimpo, rlang, rmarkdown, stringr, systemfit, testthat (≥ 3.0.0), tidyr |
| License: | GPL (≥ 3) |
| URL: | https://github.com/jluchman/domir, https://jluchman.github.io/domir/ |
| BugReports: | https://github.com/jluchman/domir/issues |
| Encoding: | UTF-8 |
| RoxygenNote: | 7.3.3 |
| Config/testthat/edition: | 3 |
| VignetteBuilder: | knitr |
| Language: | en-US |
| NeedsCompilation: | no |
| Packaged: | 2026-04-19 15:08:02 UTC; josephluchman |
| Author: | Joseph Luchman |
| Maintainer: | Joseph Luchman <jluchman@gmail.com> |
| Repository: | CRAN |
| Date/Publication: | 2026-04-19 15:20:02 UTC |
Dominance Analysis Methods
Description
Dominance analysis methods intended for predictive modeling functions.
Details
This package implements several methods to compute dominance analysis (Azen & Budescu, 2004; Budescu, 1993). Dominance analysis is a relative importance analysis approach that derives conceptually from Shapley values (e.g., Grömping, 200; Lipovsky & Conklin, 2001) in that it ascribes 'values' from some function to inputs (known as 'names' in the package) to that function.
When applied to predictive models, the method compares components of a fit metric ascribed to each 'name' (i.e., independent variable, predictor, feature, or parameter estimate) to each other 'name' in a pairwise fashion to determine a hierarchy of dominance or relative importance.
Author(s)
Joseph Luchman jluchman@gmail.com
References
Azen, R., & Budescu, D. V. (2003). The dominance analysis approach for comparing predictors in multiple regression. Psychological Methods, 8(2), 129-148. doi:10.1037/1082-989X.8.2.129
Budescu, D. V. (1993). Dominance analysis: A new approach to the problem of relative importance of predictors in multiple regression. Psychological Bulletin, 114(3), 542-551. doi:10.1037/0033-2909.114.3.542
Grömping, U. (2007). Estimators of relative importance in linear regression based on variance decomposition. The American Statistician, 61(2), 139-147. doi:10.1198/000313007X188252
Lipovetsky, S, & and Conklin, M. (2001). Analysis of regression in game theory approach. Applied Stochastic Models in Business and Industry, 17(4), 319-330. doi:10.1002/asmb.446
Dominance analysis supporting formula-based modeling functions
Description
Computes dominance statistics for predictive modeling functions that accept a formula.
Usage
domin(
formula_overall,
reg,
fitstat,
sets = NULL,
all = NULL,
conditional = TRUE,
complete = TRUE,
consmodel = NULL,
reverse = FALSE,
...
)
Arguments
formula_overall |
An object of class A valid |
reg |
A function implementing the predictive (or "reg"ression) model called. String function names (e.g., "lm"), function names (e.g., The predictive model in |
fitstat |
List providing arguments to call a fit statistic extracting function (see details). The The first element of The second element of All list elements beyond the second are submitted as additional arguments to the fit extractor function call. The fit statistic extractor function in the first list element of The fit statistic produced must be scalar valued (i.e., vector of length 1). |
sets |
A list with each element comprised of vectors containing variable/factor names or Each separate list element-vector in |
all |
A vector of variable/factor names or The entries in |
conditional |
Logical. If If conditional dominance is not desired as an importance criterion, avoiding computing the conditional dominance matrix can save computation time. |
complete |
Logical. If If complete dominance is not desired as an importance criterion, avoiding computing complete dominance designations can save computation time. |
consmodel |
A vector of variable/factor names, The use of Typical usage of As such, this vector is used to set a baseline for the fit statistic when it is non-0. |
reverse |
Logical. If This argument should be changed to |
... |
Additional arguments passed to the function call in the |
Details
domin automates the computation of all possible combination of entries to the dominance analysis (DA), the creation of formula objects based on those entries, the modeling calls/fit statistic capture, and the computation of all the dominance statistics for the user.
domin accepts only a "deconstructed" set of inputs and "reconstructs" them prior to formulating a coherent predictive modeling call.
One specific instance of this deconstruction is in generating the number of entries to the DA. The number of entries is taken as all the terms from formula_overall and the separate list element vectors from sets. The entries themselves are concatenated into a single formula, combined with the entries in all, and submitted to the predictive modeling function in reg. Each different combination of entries to the DA forms a different formula and thus a different model to estimate.
For example, consider this domin call:
domin(y ~ x1 + x2, lm, list(summary, "r.squared"), sets = list(c("x3", "x4")), all = c("c1", "c2"), data = mydata))
This call records three entries and results in seven (i.e., 2^3 - 1) different combinations:
x1
x2
x3, x4
x1, x2
x1, x3, x4
x2, x3, x4
x1, x2, x3, x4
domin parses formula_overall to obtain all the terms in it and combines them with sets. When parsing formula_overall, only the processing that is available in the stats package is applied. Note that domin is not programmed to process terms of order > 1 (i.e., interactions/products) appropriately (i.e., only include in the presence of lower order component terms). domin also does not allow offset terms.
From these combinations, the predictive models are constructed and called. The predictive model call includes the entries in all, applies the appropriate formula, and reconstructs the function itself. The seven combinations above imply the following series of predictive model calls:
-
lm(y ~ x1 + c1 + c2, data = mydata) -
lm(y ~ x2 + c1 + c2, data = mydata) -
lm(y ~ x3 + x4 + c1 + c2, data = mydata) -
lm(y ~ x1 + x2 + c1 + c2, data = mydata) -
lm(y ~ x1 + x3 + x4 + c1 + c2, data = mydata) -
lm(y ~ x2 + x3 + x4 + c1 + c2, data = mydata) -
lm(y ~ x1 + x2 + x3 + x4 + c1 + c2, data = mydata)
It is possible to use a domin with only sets (i.e., no IVs in formula_overall; see examples below). There must be at least two entries to the DA for domin to run.
All the called predictive models are submitted to the fit extractor function implied by the entries in fitstat. Again applying the example above, all seven predictive models' objects would be individually passed as follows:
summary(lm_obj)["r.squared"]
where lm_obj is the model object returned by lm.
The entries to fitstat must be as a list and follow a specific structure:
list(fit_function, element_name, ...)
fit_functionFirst element and function to be applied to the object produced by the
regfunctionelement_nameSecond element and name of the element from the object returned by
fit_functionto be used as a fit statistic. The fit statistic must be scalar-valued/length 1...Subsequent elements and are additional arguments passed to
fit_function
In the case that the model object returned by reg includes its own fit statistic without the need for an extractor function, the user can apply an anonymous function following the required format to extract it.
Value
Returns an object of class "domin".
An object of class "domin" is a list composed of the following elements:
General_DominanceVector of general dominance statistics.
StandardizedVector of general dominance statistics normalized to sum to 1.
RanksVector of ranks applied to the general dominance statistics.
Conditional_DominanceMatrix of conditional dominance statistics. Each row represents a term; each column represents an order of terms.
Complete_DominanceLogical matrix of complete dominance designations. The term represented in each row indicates dominance status; the terms represented in each columns indicates dominated-by status.
Fit_Statistic_OverallValue of fit statistic for the full model.
Fit_Statistic_All_SubsetsValue of fit statistic associated with terms in
all.Fit_Statistic_Constant_ModelValue of fit statistic associated with terms in
consmodel.CallThe matched call.
Subset_DetailsList containing the full model and descriptions of terms in the full model by source.
Notes
domin is an R port of the Stata command with the same name (see Luchman, 2021).
domin has been superseded by domir.
References
Luchman, J. N. (2021). Relative importance analysis in Stata using dominance analysis: domin and domme. The Stata Journal, 21, 2. doi: 10.1177/1536867X211025837.
Examples
## Basic linear model with r-square
domin(mpg ~ am + vs + cyl,
lm,
list("summary", "r.squared"),
data = mtcars)
## Linear model including sets
domin(mpg ~ am + vs + cyl,
lm,
list("summary", "r.squared"),
data = mtcars,
sets = list(c("carb", "gear"), c("disp", "wt")))
## Multivariate linear model with custom multivariate r-square function
## and all subsets variable
Rxy <- function(obj, names, data) {
return(list("r2" = cancor(predict(obj),
as.data.frame(mget(names, as.environment(data))))[["cor"]][1]^2))
}
domin(cbind(wt, mpg) ~ vs + cyl + am,
lm,
list(Rxy, "r2", c("mpg", "wt"), mtcars),
data = mtcars,
all = c("carb"))
## Sets only
domin(mpg ~ 1,
lm,
list("summary", "r.squared"),
data = mtcars,
sets = list(c("am", "vs"), c("cyl", "disp"), c("qsec", "carb")))
## Constant model using AIC
domin(mpg ~ am + carb + cyl,
lm,
list(function(x) list(aic = extractAIC(x)[[2]]), "aic"),
data = mtcars,
reverse = TRUE, consmodel = "1")
Dominance analysis methods
Description
Parses input object to obtain a list of names, determines which combinations of the names are valid, submits valid name combinations to a function, and computes dominance values based on the returned values from the function.
Usage
domir(.obj, ...)
## S3 method for class 'formula'
domir(
.obj,
.fct,
.set = NULL,
.wst = NULL,
.all = NULL,
.adj = FALSE,
.cdl = NULL,
.cpt = NULL,
.rev = FALSE,
.cst = NULL,
.prg = FALSE,
...
)
## S3 method for class 'formula_list'
domir(
.obj,
.fct,
.set = NULL,
.wst = NULL,
.all = NULL,
.adj = FALSE,
.cdl = NULL,
.cpt = NULL,
.rev = FALSE,
.cst = NULL,
.prg = FALSE,
...
)
Arguments
.obj |
A The combinations of names submitted to |
... |
Passes arguments to other methods during method dispatch;
passes arguments to the function in |
.fct |
A |
.set |
A |
.wst |
A |
.all |
A |
.adj |
Logical.
If |
.cdl |
|
.cpt |
|
.rev |
Logical.
If |
.cst |
Object of class c("SOCKcluster", "cluster") from
When non- |
.prg |
Logical.
If |
Details
Name Parsing
.obj is first parsed into a list of names.
How the name list is parsed depends on .obj's class.
formula
The formula method creates a name list using all terms in the formula.
The terms are obtained using terms.formula.
All processing that is normally applied to the right hand side of a
formula is implemented (see formula).
A response/left hand side is not required but, if present, is
included in all formulas passed to .fct.
formula_list
The formula_list creates a name list out of response-term pairs.
The terms are obtained using terms.formula applied to each individual
formula in the list.
The formula_list methods make it possible to implement dominance analysis
for parameter estimates in multivariate predictive models
(e.g., Luchman, Xie, & Kaplan, 2020).
Additional Details
formulas and formula_list elements are assumed to have an intercept
except if explicitly removed with a - 1 in the formula(s) in .obj.
If removed, the intercept will be removed in all formula(s) in each
sapply-ed subset to .fct.
If offsets are included, they are passed, like intercepts, while
sapply-ing subsets to .fct.
Changing Combination Generation
Parsed names are used independently for creating combinations of names
to submit to.fct.
When using .set, .wst, and .all, the way combinations are
created changes.
Names in .set, .wst, and .all must also be present in .obj.
.set
.set binds together names such that they are considered to be one name
when creating combinations.
The names in each .set then pool their returned value together with the
other members of their set.
By default, sets are referred to by set names in all output.
Unnamed .set list elements are called 'set@' where '@' is an integer
indicating the set's position in the list.
The user can give each set in the .set list a name that will be used in
place of the default.
Names of .sets cannot contain the period character '.'.
.set implements the grouped dominance analysis method described by
Luchman (2026).
.wst
.wst binds together names such that they are considered to be one name
when creating combinations with other names that are not in their .wst.
All combinations of names of the members of names within a .wst
are considered valid.
The names in each .wst then pool their returned value together with the
other members of their set when compared to names outside of the .wst
but do not pool their returned value when compared to names within their
.wst.
.wst list elements cannot be named.
.wst implements the within-group dominance analysis method described by
Luchman (2026).
.wst and .set can be used together.
.all
.all binds together names such that they are considered to be one name
when creating combinations and are always included first, before all
other names.
The names in .all will then be included in 'all' valid combinations
of names.
The names in .all are included after the combination with no names but
before any other combinations.
The value associated with .all is also removed from the
dominance analysis and is reported along with the overall value
including all names.
The formula method for .all does not allow the formula in .all to have
a left hand side.
.adj
By default, domir assumes that the combination of no names has a
value of 0.
.adj indicates that the there is an 'adjustment' needed such that the
no names combination has a non-0 value and an intercept-only model should
be supplied to .fct.
The formula method will submit an intercept-only formula to .fct.
The formula_list method creates a separate, intercept-only subset for each
of the formulas in the list.
Both the formula and formula_list methods will respect the user's
removal of an intercept and or inclusion of an offset.
Additional Details
All methods submit combinations of names as an object of the same class as
.obj.
A formula in .obj will submit all combinations of names as
formulas to .fct.
A formula_list in .obj will submit all
combinations of subsets of names as formula_lists to .fct.
In the case that .fct requires a different class (e.g.,
a character vector of names, a Formula::Formula see fmllst2Fml) the
subsets of names will have to be processed in .fct to obtain the correct
class.
The formula or formula_list of names will be submitted to .fct as the
first, unnamed argument.
.fct as Analysis Pipeline
.fct is expected to be a complete analysis pipeline that receives a
subset of names of the same class as .obj and uses these names in the
class as submitted to generate a returned value of the appropriate
type to dominance analyze.
At current, only atomic (i.e., non-list), numeric scalars (i.e.,
vectors of length 1) are allowed as returned values.
domir is designed for use with predictive models and assumes the returned
value is a scalar-valued fit statistic/metric.
The .fct argument is strict about names submitted and returned value
requirements for functions used.
A series of checks to ensure the submitted names and returned value adhere
to these requirements.
The checks include whether the .obj can be submitted to .fct without
producing an error and whether the returned value from .fct is a length 1,
atomic, numeric vector.
In most circumstances, the user will have to make their own named or
anonymous function to supply as .fct to satisfy the checks.
Value
Returns an object of class "domir" composed of:
General_DominanceVector of general dominance values.
StandardizedVector of general dominance values standardized to sum to 1.
RanksVector of ranks applied to the general dominance values.
Conditional_DominanceMatrix of conditional dominance values. Each row represents a name in
.obj; each column represents a number of names included in.fct.Complete_DominanceMatrix of proportions of subsets where the name in the row has a larger value than the name in the column. These proportions determine complete dominance when a value of 1 or 0.
ValueValue returned by
.fctwith all names included.Value_AllValue of
.fctassociated with names included in.all; when.adjisTRUE, this value will be adjusted forValue_Adjust.Value_AdjustValue of
.fctreturned when no names are included.CallThe matched call.
Notes
Prior to version 1.1.0, the formula method allowed a formula
to be submitted to .adj.
Submitting any argument other than a logical is now defunct.
The formula and formula_list methods can be used to pass responses,
intercepts, and offsets to all combinations of names.
If the user seeks to include other model components integral to
estimation (i.e., a random effect term in lme4::glmer()) include them as
update to the submitted formula or formula_list
embedded in .fct.
Second-order or higher terms (i.e., interactions like ~ a*b) are parsed
by default but not used differently from first-order terms for generating
valid combinations.
The values ascribed to such names may not be valid unless the user ensures
that second-order and higher term names are used appropriately in .fct.
References
Luchman, J. N., Lei, X., & Kaplan, S. (2020). Relative Importance Analysis with Multivariate Models: Shifting the Focus from Independent Variables to Parameter Estimates. Journal of Applied Structural Equation Modeling, 4(2), 1-20. doi:https://doi.org/10.47263/JASEM.4(2)02
Luchman, J. N. (2026). Determining Relative Importance with Independent Variable Groups: An Alternative Dominance Analysis Method. Journal of Behavioral Data Science, 6(1), 1-26. doi:https://doi.org/10.35566/jbds/luchman
Examples
## Linear model returning r-square
lm_r2 <-
function(fml, data) {
lm_res <- lm(fml, data = data)
summary(lm_res)[["r.squared"]]
}
domir(mpg ~ am + vs + cyl, lm_r2, data = mtcars)
## Linear model including set
domir(
mpg ~ am + vs + cyl + carb + gear + disp + wt,
lm_r2,
.set = list(~ carb + gear, ~ disp + wt),
data = mtcars
)
## Multivariate regression with multivariate r-square and
## all subsets variable
if (requireNamespace("performance", quietly = TRUE)) {
mlm_rxy <-
function(fml, data) {
mlm_res <- lm(fml, data = data)
performance::r2_mlm(mlm_res)[["Symmetric Rxy"]]
}
domir(
cbind(wt, mpg) ~ vs + cyl + am + carb,
mlm_rxy,
.all = ~ carb,
data = mtcars
)
}
## Named sets
domir(
mpg ~ am + gear + cyl + vs + qsec + drat,
lm_r2,
data = mtcars,
.set =
list(
trns = ~ am + gear,
eng = ~ cyl + vs,
misc = ~ qsec + drat
)
)
## Linear model returning AIC
lm_aic <-
function(fml, data) {
lm_res <- lm(fml, data = data)
AIC(lm_res)
}
domir(
mpg ~ am + carb + cyl,
lm_aic,
.adj = TRUE,
.rev = TRUE,
data = mtcars
)
## 'systemfit' with 'formula_list' method returning AIC
if (requireNamespace("systemfit", quietly = TRUE)) {
domir(
formula_list(mpg ~ am + cyl + carb, qsec ~ wt + cyl + carb),
function(fml) {
res <- systemfit::systemfit(fml, data = mtcars)
AIC(res)
},
.adj = TRUE, .rev = TRUE
)
}
## within-set or within-group dominance analysis
domir(
mpg ~ am + gear + cyl + vs + qsec + drat,
lm_r2,
data = mtcars,
.wst =
list(
~ am + gear,
~ cyl + vs,
~ qsec + drat
)
)
Translate formula_list into Formula::Formula
Description
Translates formula_list objects into a Formula::Formula
Usage
fmllst2Fml(fmllst, drop_lhs = NULL)
Arguments
fmllst |
A |
drop_lhs |
An integer vector. Used as a selection vector to remove response names prior to
generating the This is useful for some |
Value
A Formula::Formula object.
A list composed of formulas
Description
Defines a list object composed of formulas. The purpose of this
class of object is to impose structure of the list to ensure that it
can be used to obtain response-term pairs and will be able to be
parsed in domir.
Usage
formula_list(...)
Arguments
... |
|
Details
The formula_list requires that each element of the list is a formula
and that each formula is unique with a different, non-NULL
dependent variable/response.
Value
A list of class formula_list.
Print method for domin
Description
Reports formatted results from domin class object.
Usage
## S3 method for class 'domin'
print(x, ...)
Arguments
x |
an object of class "domin". |
... |
further arguments passed to or from other methods. Not used currently. |
Details
The print method for class domin objects reports out the following results:
Fit statistic for the full model. The fit statistic for the all subsets model is reported here if there are any entries in
all. The fit statistic for the constant model is reported here if there are any entries inconsmodel.Matrix describing general dominance statistics, standardized general dominance statistics, and the ranking of the general dominance statistics
If
conditionalisTRUE, matrix describing the conditional dominance designationsIf
completeisTRUE, matrix describing the complete dominance designationsIf following
summary.domin, matrix describing the strongest dominance designations between all independent variablesIf there are entries in
setsand/orallthe terms included in each set as well as the terms in all subsets are reported
The domin print method alters dimension names for readability and they do not display as stored in the original domin object.
Value
The "domin" object with altered column and row names for conditional and complete dominance results as displayed in the console.
Print method for domir
Description
Reports formatted results from domir class object.
Usage
## S3 method for class 'domir'
print(x, .cdl = TRUE, .cpt = TRUE, ...)
Arguments
x |
an object of class "domir". |
.cdl |
Logical.
If |
.cpt |
Logical.
If |
... |
further arguments passed to |
Details
The print method for class domir objects reports out the
following results:
Value when all elements are included in
obj.Value for the elements included in
.all, if any.Value for the elements included in
.adj, if any.Matrix describing general dominance values, standardized general dominance values, and the ranking of the general dominance values.
Matrix describing the conditional dominance values if
.cdlisTRUE.Matrix describing the complete dominance designations if
.cptisTRUE.If following
summary.domir, matrix describing the strongest dominance designations between all elements if both.cdland.cptareTRUE.
The domir print method alters dimension names for readability and they
do not display as stored in the domir object.
Value
The submitted "domir" object, invisibly.
Summary method for domin
Description
Reports dominance designation results from the domin class object.
Usage
## S3 method for class 'domin'
summary(object, ...)
Arguments
object |
an object of class "domin". |
... |
further arguments passed to or from other methods. Not used currently. |
Details
The summary method for class domin is used for obtaining the strongest dominance designations (i.e., general, conditional, or complete) among the independent variables.
Value
The originally submitted "domin" object with an additional Strongest_Dominance element added.
Strongest_DominanceMatrix comparing the independent variable in the first row to the independent variable in the third row. The second row denotes the strongest designation between the two independent variables.
Summary method for domir
Description
Reports dominance designation results from the domir
class object.
Usage
## S3 method for class 'domir'
summary(object, ...)
Arguments
object |
an object of class "domir". |
... |
further arguments passed to or from other methods. Not used currently. |
Details
The summary method for class domir objects is used for obtaining
the strongest dominance designations (i.e., general, conditional, or
complete) among all pairs of dominance analyzed names.
Value
The submitted "domir" object with an additional
Strongest_Dominance element added.
Strongest_DominanceMatrix comparing the element in the first row to the element in the third row. The second row denotes the strongest designation between the two names.