effect_size {epicmodel} | R Documentation |
Determine standardized effect size of component causes
Description
SCC models teach us that effect strength, e.g., a risk ratio, is no natural constant but depends on the prevalence of component causes and, therefore, differs between populations. However, even without any population, this function derives effect sizes for every component cause by comparing how many sets of component causes with and without a certain cause are sufficient to cause the outcome of interest.
Usage
effect_size(scc, depends = TRUE, output = c("nice", "table"))
Arguments
scc |
An object of class |
depends |
TRUE (default) or FALSE. If FALSE, only includes sufficient causes with suffciency status "always". |
output |
A single element of type character, either "nice" (default) or "table". If "table", returns a data.frame. If "nice", a nicely formated output is printed in the console. |
Details
The following algorithm is used to derive effect sizes from SCC models:
The effect size is derived for one specific component cause. The following steps are repeated for all of them.
Get all potential combinations of component causes
Remove combinations that contain incompatible component causes (ICC), as specified in the steplist
Split the set of possible combinations of component causes into two parts: Sets, in which the component cause of interest is present & sets, in which the component cause of interest is absent. The numbers are recorded and returned in the output table (output = "table") as variables
num_combos_true
(cause is present) andnum_combos_false
(cause is absent). If there are no incompatible component causes (ICC), both values should be the same.Check for all possible combinations of component causes, if they are sufficient for the outcome to occur. The number of sufficient combinations are counted separately for combinations with the component cause of interest present and combinations with the component cause of interest absent. The numbers are recorded and returned in the output table (output = "table") as variables
suff_true
(cause is present) andsuff_false
(cause is absent).A ratio is calculated using the following formula:
(suff_true / num_combos_true) / (suff_false / num_combos_false)
. In the output table (output = "table"), this value is stored in variableratio
. In the nice output (output = "nice"), it is reported in the columnImpact
, which shows:ratio [suff_true/num_combos_true vs. suff_false/num_combos_false]
There are two special cases when calculating the
ratio
. Whensuff_true > 0
butsuff_false == 0
, the outcome only occurs if the corresponding component cause is present. Theratio
then gets valuenecessary
. Whensuff_true == 0
andsuff_false == 0
, theratio
gets valuenot a cause
.
Value
Either a dataframe (output
= "table") with one row for every component cause and with variables id
(step ID), desc
(step
description), suff_true
, suff_false
, num_combos_true
, num_combos_false
, and ratio
, or a nicely formated output in the console
(output
= "nice"). See Details for more information.
Examples
# Create some SCC model
steplist_checked <- check_steplist(steplist_rain)
scc_model <- create_scc(steplist_checked)
# Use the SCC model in effect_size()
effect_size(scc_model)