.weightit_methods is a list containing the allowable weighting methods that can be supplied by name to the method argument of weightit(), weightitMSM(), and weightit.fit(). Each entry corresponds to an allowed method and contains information about what options are and are not allowed for each method. While this list is primarily for internal use by checking functions in WeightIt, it might be of use for package authors that want to support different weighting methods.
Details
Each component is itself a list containing the following components:
treat_typeat least one of
"binary","multinomial", or"continuous"indicating which treatment types are available for this method.estimandwhich estimands are available for this method. All methods that support binary and multi-category treatments accept
"ATE","ATT", and"ATC", as well as some other estimands depending on the method. Seeget_w_from_ps()for more details about what each estimand means.aliasa character vector of aliases for the method. When an alias is supplied, the corresponding method will still be dispatched. For example, the canonical method to request entropy balancing is
"ebal", but"ebalance"and"entropy"also work. The first value is the canonical name.descriptiona string containing the description of the name in English.
psa logical for whether propensity scores are returned by the method for binary treatments. Propensity scores are never returned for multi-category or continuous treatments.
msm_valida logical for whether the method can be validly used with longitudinal treatments.
msm_method_availablea logical for whether a version of the method can be used that estimates weights using a single model rather than multiplying the weights across time points. This is related to the
is.MSM.methodargument ofweightitMSM().subclass_oka logical for whether
subclasscan be supplied to compute subclassification weights from the propensity scores.packages_neededa character vector of the minimal packages required to use the method. Some methods may require additional packages for certain options.
package_versions_neededa named character vector of the minimal package versions required to use the method. Only present when
packages_neededis not empty.s.weights_oka logical for whether sampling weights can be used with the method.
missinga character vector of the allowed options that can be supplied to
missingwhen missing data is present. All methods accept"ind"for the missingness indicator approach; some other methods accept additional values.moments_int_oka logical for whether
moments,int, andquantilecan be used with the method.moments_defaultwhen
moments_int_okisTRUE, the default value ofmomentsused with the method. For most methods, this is 1.density_oka logical for whether arguments that control the density can be used with the method when used with a continuous treatment.
stabilize_oka logical for whether the
stabilizeargument (andnum.formulafor longitudinal treatments) can be used with the method.plot.weightit_oka logical for whether
plot()can be used on theweightitoutput with the method.
See also
weightit() and weightitMSM() for how the methods are used. Also
see the individual methods pages for information on whether and how each
option can be used.
Examples
# Get all acceptable names
names(.weightit_methods)
#> [1] "glm" "bart" "cbps" "ebal" "energy" "gbm"
#> [7] "ipt" "npcbps" "optweight" "super"
# Get all acceptable names and aliases
lapply(.weightit_methods, `[[`, "alias")
#> $glm
#> [1] "glm" "ps"
#>
#> $bart
#> [1] "bart"
#>
#> $cbps
#> [1] "cbps" "cbgps"
#>
#> $ebal
#> [1] "ebal" "ebalance" "entropy"
#>
#> $energy
#> [1] "energy" "dcows"
#>
#> $gbm
#> [1] "gbm" "gbr"
#>
#> $ipt
#> [1] "ipt"
#>
#> $npcbps
#> [1] "npcbps" "npcbgps"
#>
#> $optweight
#> [1] "optweight" "sbw"
#>
#> $super
#> [1] "super" "superlearner"
#>
# Which estimands are allowed with `method = "bart"`
.weightit_methods[["bart"]]$estimand
#> [1] "ATE" "ATT" "ATC" "ATO" "ATM" "ATOS"
# All methods that support continuous treatments
supp <- sapply(.weightit_methods, function(x) {
"continuous" %in% x$treat_type
})
names(.weightit_methods)[supp]
#> [1] "glm" "bart" "cbps" "ebal" "energy" "gbm"
#> [7] "npcbps" "optweight" "super"
# All methods that return propensity scores (for
# binary treatments only)
supp <- sapply(.weightit_methods, `[[`, "ps")
names(.weightit_methods)[supp]
#> [1] "glm" "bart" "cbps" "gbm" "ipt" "super"
