# The Determinant Selection Table

To select determinants it is important to inspect the univariate distributions, ideally while looking at the raw data, while simultaneously inspecting bivariate associations with the ultimate target of the intervention (usually a target behavior or proxy thereof). For this purpose, Confidence Interval-Based Estimation of Relevance plots have been developed (`behaviorchange::CIBER()`).

However, sometimes too many determinants have to be compared, and it can be helpful to reduce the available information to facilitate retaining an overview. For this goal, the Potential for Change Index can be used. However, keep in mind that the practice of reducing relatively rich data to single quantitative estimates obfuscates many features of the determinant structures, and so should never be used without also inspecting the raw data.

The `behaviorchange` package has a function that allows you to quickly produce a table with the Potential for Change Indices for a series of (sub-)determinants. This table can be created with the `behaviorchange::determinant_selection_table()` command.

We will first load an example dataset:

    dat <- get(data("BBC_pp15.1", package="behaviorchange"));

Then, for convenience, we will select all expectations (sometimes also called beliefs) relating to the effects of using a high dose of MDMA, and store those variable names in a vector:

    subdets <-
      grep(
        "highDose_AttBeliefs_",
        names(dat),
        value=TRUE
      );

Then we can produce the Determinant Selection Table, using the intention measure as target:

    behaviorchange::determinant_selection_table(
      data=dat,
      determinants = subdets,
      target = 'highDose_intention'
    );

Determinant Selection Table

(Sub-)determinant | Lower bound | Current | Upper bound | Weight | Potential for Change Index
--- | --- | --- | --- | --- | ---
highDose_AttBeliefs_long | -3 | 1.269 | 3 | 0.18 | 0.288
highDose_AttBeliefs_intensity | -1 | 2.042 | 3 | 0.118 | 0.108
highDose_AttBeliefs_intoxicated | -1 | 2.136 | 3 | -0.035 | -0.025
highDose_AttBeliefs_energy | -3 | 0.72 | 3 | 0.141 | 0.319
highDose_AttBeliefs_euphoria | -3 | 0.836 | 3 | 0.385 | 0.829
highDose_AttBeliefs_insight | -3 | -0.15 | 3 | 0.289 | 0.91
highDose_AttBeliefs_connection | -3 | 0.357 | 3 | 0.306 | 0.802
highDose_AttBeliefs_contact | -3 | 0.338 | 3 | 0.322 | 0.85
highDose_AttBeliefs_sex | -3 | -0.254 | 3 | 0.246 | 0.787
highDose_AttBeliefs_coping | -3 | 0.901 | 3 | 0.078 | 0.17
highDose_AttBeliefs_isolated | -3 | 0.573 | 3 | -0.149 | -0.359
highDose_AttBeliefs_boundaries | -3 | -0.061 | 2 | 0.125 | 0.257
highDose_AttBeliefs_music | -3 | 1.118 | 3 | 0.221 | 0.417
highDose_AttBeliefs_hallucinate | -2 | 1.382 | 3 | -0.052 | -0.084
highDose_AttBeliefs_timeAwareness | -2 | 1.66 | 3 | 0.06 | 0.081
highDose_AttBeliefs_memory | -3 | -1.061 | 3 | 0.276 | 1.121
highDose_AttBeliefs_health | -3 | -1.844 | 2 | 0.268 | 1.029
highDose_AttBeliefs_better | -3 | -0.094 | 3 | 0.551 | 1.704
highDose_AttBeliefs_physicalSideEffects | -3 | 1.198 | 3 | -0.34 | -0.613
highDose_AttBeliefs_psychicSideEffects | -3 | 1.09 | 3 | -0.336 | -0.641
highDose_AttBeliefs_regret | -3 | 0.637 | 3 | -0.421 | -0.994

We can also easily sort by one of the columns to pass that column number as `sortBy`. For example, we can sort by the Potential for Change Index (which is in column 6) like this:

    behaviorchange::determinant_selection_table(
      data=dat,
      determinants = subdets,
      target = 'highDose_intention',
      sortBy=6
    );

Determinant Selection Table

(Sub-)determinant | Lower bound | Current | Upper bound | Weight | Potential for Change Index
--- | --- | --- | --- | --- | ---
highDose_AttBeliefs_better | -3 | -0.094 | 3 | 0.551 | 1.704
highDose_AttBeliefs_memory | -3 | -1.061 | 3 | 0.276 | 1.121
highDose_AttBeliefs_health | -3 | -1.844 | 2 | 0.268 | 1.029
highDose_AttBeliefs_regret | -3 | 0.637 | 3 | -0.421 | -0.994
highDose_AttBeliefs_insight | -3 | -0.15 | 3 | 0.289 | 0.91
highDose_AttBeliefs_contact | -3 | 0.338 | 3 | 0.322 | 0.85
highDose_AttBeliefs_euphoria | -3 | 0.836 | 3 | 0.385 | 0.829
highDose_AttBeliefs_connection | -3 | 0.357 | 3 | 0.306 | 0.802
highDose_AttBeliefs_sex | -3 | -0.254 | 3 | 0.246 | 0.787
highDose_AttBeliefs_psychicSideEffects | -3 | 1.09 | 3 | -0.336 | -0.641
highDose_AttBeliefs_physicalSideEffects | -3 | 1.198 | 3 | -0.34 | -0.613
highDose_AttBeliefs_music | -3 | 1.118 | 3 | 0.221 | 0.417
highDose_AttBeliefs_isolated | -3 | 0.573 | 3 | -0.149 | -0.359
highDose_AttBeliefs_energy | -3 | 0.72 | 3 | 0.141 | 0.319
highDose_AttBeliefs_long | -3 | 1.269 | 3 | 0.18 | 0.288
highDose_AttBeliefs_boundaries | -3 | -0.061 | 2 | 0.125 | 0.257
highDose_AttBeliefs_coping | -3 | 0.901 | 3 | 0.078 | 0.17
highDose_AttBeliefs_intensity | -1 | 2.042 | 3 | 0.118 | 0.108
highDose_AttBeliefs_hallucinate | -2 | 1.382 | 3 | -0.052 | -0.084
highDose_AttBeliefs_timeAwareness | -2 | 1.66 | 3 | 0.06 | 0.081
highDose_AttBeliefs_intoxicated | -1 | 2.136 | 3 | -0.035 | -0.025

It is also possible to pass labels instead of using the variable names. First, we specify those manually (the original study was in Dutch):

    translations <- matrix(
      c("If I use a high dose of ecstasy,\nmy trip is...", "shorter", "longer",
        "If I use a high dose of ecstasy,\nmy trip is...", "more mild", "more intense",
        "If I use a high dose of ecstasy,\nI get...", "much less\nintoxicated", "much more\nintoxicated",
        "A high dose of ecstasy gives me...", "much less\nenergy", "much more\nenergy",
        "With a high dose of ecstasy,\nthe happy, euphoric feeling is...", "much weaker", "much stronger",
        "If I use a high dose of ecstasy,\nI learn...", "much less\nabout myself", "much more\nabout myself",
        "If I use a high dose of ecstasy,\nI feel...", "much less\nconnected\n to others", "much more\nconnected\nto others",
        "If I use a high dose of ecstasy,\nI can make contact with others...", "much harder", "much easier",
        "If I use a high dose of ecstasy,\nI feel like having sex...", "much less", "much more",
        "If I use a high dose of ecstasy,\nI forget my problems...", "much slower", "much faster",
        "If I use a high dose of ecstasy,\nI feel...", "much less\nself-absorbed", "much more\nself-absorbed",
        "With a high dose of ecstasy,\nI can test my boundaries...", "much less", "much better",
        "If I use a high dose of ecstasy,\nthe music sounds...", "much worse", "much better",
        "If I use a high dose of ecstasy,\nI hallucinate...", "much less", "much more",
        "If I use a high dose of ecstasy,\nI feel time passes...", "much slower", "much faster",
        "If I use a high dose of ecstasy,\nafterwards I remember...", "much less", "much more",
        "For my health, using a high\ndose of ecstasy is...", "much worse", "much better",
        "My experience with using a high\ndose of ecstasy is...", "worse", "better",
        "Do you worry as much, more, or less\nabout the physical side effects of\nusing a high dose of ecstasy?", "worry\nmuch less", "worry\nmuch more",
        "Do you worry as much, more, or less\nabout the emotional and psychic side\neffects of using a high dose of ecstasy?", "worry\nmuch less", "worry\nmuch more",
        "Do you have as much, more, or less\nregret after using a high dose of ecstasy?", "much less\nregret", "much more\nregret"), ncol=3, byrow=TRUE);

    subQuestions <- translations[, 1];
    leftAnchors <- translations[, 2];
    rightAnchors <- translations[, 3];

    subDeterminantLabels <-
      paste0(subQuestions, " [ ",
             leftAnchors, " - ",
             rightAnchors, " ]");

These can then be passed as `determinantLabels`:

    behaviorchange::determinant_selection_table(
      data=dat,
      determinants = subdets,
      target = 'highDose_intention',
      sortBy=6,
      determinantLabels = subDeterminantLabels
    );

Determinant Selection Table

(Sub-)determinant | Lower bound | Current | Upper bound | Weight | Potential for Change Index
--- | --- | --- | --- | --- | ---
My experience with using a high dose of ecstasy is… [ worse - better ] | -3 | -0.094 | 3 | 0.551 | 1.704
If I use a high dose of ecstasy, afterwards I remember… [ much less - much more ] | -3 | -1.061 | 3 | 0.276 | 1.121
For my health, using a high dose of ecstasy is… [ much worse - much better ] | -3 | -1.844 | 2 | 0.268 | 1.029
Do you have as much, more, or less regret after using a high dose of ecstasy? [ much less regret - much more regret ] | -3 | 0.637 | 3 | -0.421 | -0.994
If I use a high dose of ecstasy, I learn… [ much less about myself - much more about myself ] | -3 | -0.15 | 3 | 0.289 | 0.91
If I use a high dose of ecstasy, I can make contact with others… [ much harder - much easier ] | -3 | 0.338 | 3 | 0.322 | 0.85
With a high dose of ecstasy, the happy, euphoric feeling is… [ much weaker - much stronger ] | -3 | 0.836 | 3 | 0.385 | 0.829
If I use a high dose of ecstasy, I feel… [ much less connected to others - much more connected to others ] | -3 | 0.357 | 3 | 0.306 | 0.802
If I use a high dose of ecstasy, I feel like having sex… [ much less - much more ] | -3 | -0.254 | 3 | 0.246 | 0.787
Do you worry as much, more, or less about the emotional and psychic side effects of using a high dose of ecstasy? [ worry much less - worry much more ] | -3 | 1.09 | 3 | -0.336 | -0.641
Do you worry as much, more, or less about the physical side effects of using a high dose of ecstasy? [ worry much less - worry much more ] | -3 | 1.198 | 3 | -0.34 | -0.613
If I use a high dose of ecstasy, the music sounds… [ much worse - much better ] | -3 | 1.118 | 3 | 0.221 | 0.417
If I use a high dose of ecstasy, I feel… [ much less self-absorbed - much more self-absorbed ] | -3 | 0.573 | 3 | -0.149 | -0.359
A high dose of ecstasy gives me… [ much less energy - much more energy ] | -3 | 0.72 | 3 | 0.141 | 0.319
If I use a high dose of ecstasy, my trip is… [ shorter - longer ] | -3 | 1.269 | 3 | 0.18 | 0.288
With a high dose of ecstasy, I can test my boundaries… [ much less - much better ] | -3 | -0.061 | 2 | 0.125 | 0.257
If I use a high dose of ecstasy, I forget my problems… [ much slower - much faster ] | -3 | 0.901 | 3 | 0.078 | 0.17
If I use a high dose of ecstasy, my trip is… [ more mild - more intense ] | -1 | 2.042 | 3 | 0.118 | 0.108
If I use a high dose of ecstasy, I hallucinate… [ much less - much more ] | -2 | 1.382 | 3 | -0.052 | -0.084
If I use a high dose of ecstasy, I feel time passes… [ much slower - much faster ] | -2 | 1.66 | 3 | 0.06 | 0.081
If I use a high dose of ecstasy, I get… [ much less intoxicated - much more intoxicated ] | -1 | 2.136 | 3 | -0.035 | -0.025