construct_outcome: Construct an output for matching.

View source: R/construct_outcome.R

construct_outcomeR Documentation

Construct an output for matching.

Description

This function constructs the output given the relaxsolution to the associated network flow problem and the original dataset.

Usage

construct_outcome(res, dist_list_1, Z, dataset, controls = 1)

Arguments

res

A callrelax output.

dist_list_1

A possibly sparse representation of the first distance matrix.

Z

A vector of treatment status.

dataset

The original dataset.

controls

Number of controls matched to each treated.

Value

This function returns a list of three objects: 1) feasible: 0/1 depending on the feasibility of the matching problem; 2) data_with_matched_set_ind: a data frame that is the same as the original data frame, except that a column called “matched_set” and a column called “distance” are appended to it. “matched_set” column assigns 1,2,...,n_t to each matched set, and NA to those not matched to any treated. Variable “distance” records the distance (as specified in the left network) between each matched control and the treated, and assigns NA to all treated and controls that are left unmatched. If matching is not feasible, NULL will be returned; 3) matched_data_in_order:a dataframe organized in the order of matched sets and otherwise the same as data_with_matched_set_ind. Note that the matched_set column assigns 1,2,...,n_t for as indices for matched sets, and NA for those controls that are not paired. Null will be returned if the matching is unfeasible.


match2C documentation built on March 31, 2023, 6:39 p.m.