compute_counter_weight {CausalGPS}R Documentation

Compute counter or weight of data samples

Description

Computes counter (for matching approach) or weight (for weighting) approach.

Usage

compute_counter_weight(gps_obj, ci_appr, nthread = 1, ...)

Arguments

gps_obj

A gps object that is generated with estimate_gps function. If it is provided, the number of iteration will forced to 1 (Default: NULL).

ci_appr

The causal inference approach. Possible values are:

  • "matching": Matching by GPS

  • "weighting": Weighting by GPS

nthread

An integer value that represents the number of threads to be used by internal packages.

...

Additional arguments passed to different models.

Details

Additional parameters

Causal Inference Approach (ci_appr)

Value

Returns a counter_weight (cgps_cw) object that includes .data and params attributes.

Examples


m_d <- generate_syn_data(sample_size = 100)
gps_obj <- estimate_gps(.data = m_d,
                        .formula = w ~ cf1 + cf2 + cf3 + cf4 + cf5 + cf6,
                        gps_density = "normal",
                        sl_lib = c("SL.xgboost"))

cw_object <- compute_counter_weight(gps_obj = gps_obj,
                                    ci_appr = "matching",
                                    bin_seq = NULL,
                                    nthread = 1,
                                    delta_n = 0.1,
                                    dist_measure = "l1",
                                    scale = 0.5)


[Package CausalGPS version 0.5.0 Index]