Skip to content
Joseph Luchman edited this page Sep 5, 2023 · 10 revisions

Homepage

Welcome to the domir wiki!

This wiki will be used as a more flexible supplement to domirs vignettes to illustrate how to use its features and as a place to provide examples of domir applied to data.

This page will focus on discussing how the domir() function was designed. I hope that by explaining its design details, users might be able to debug their functions more easily. If you have not already done so, I recommend you read over the Conceptal Introduction to Dominance Analysis vignette. This vignette provides an example of dominance statistic computations and interpretation as well as a broad overview of what dominance analysis is doing in the background.

The below is a toy example intended to illustrate how domir changes the way in which the name list from the formula is parsed. This example parses the focal formula ~ a + b + c + d + e into components but changes their behavior using several of domirs features. Specifically, an adjustment is made for a non-0 returned value with no predictors, two of the names are grouped, and one of the names is included in all subsets. The function used is intended only to print the formula submitted to .fct in the console and returns a 1 for dominance computations. Those computations are returned invisibly and not reported as the focus of this function is to report on the name list subsets.

domir(
  ~ a + b + c + d + e,
  \(fml) {
    fml |> as.character() |> paste(collapse = "") |> print()
    1
  },
  .set = list(~ a + d),
  .all = ~ e,
  .adj = TRUE
) |> 
  invisible()
## [1] "~a + b + c + d + e"
## [1] "~1"
## [1] "~e + 1"
## [1] "~b + e + 1"
## [1] "~c + e + 1"
## [1] "~b + c + e + 1"
## [1] "~a + d + e + 1"
## [1] "~b + a + d + e + 1"
## [1] "~c + a + d + e + 1"

The five names in the formula would have produced 32 different name list subsets if all the names were given equal priority in the subsets. Because a and d have been grouped into a set and e has been determined to be in all subsets, there are only 8 models—plus an additional one to adjust for the non-0 intercept-only model.

… more later …

Clone this wiki locally